xcom

package
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2026 License: GPL-3.0, LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

// Copyright 2021 The PlatON Network Authors // This file is part of the PlatON-Go library. // // The PlatON-Go library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // The PlatON-Go library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with the PlatON-Go library. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

View Source
var (
	AvgPackTimeKey       = []byte("AvgPackTimeKey")
	IncIssuanceNumberKey = []byte("IncIssuanceNumberKey")
	IncIssuanceTimeKey   = []byte("IncIssuanceTimeKey")
)

Functions

func AddLogWithRes added in v0.7.6

func AddLogWithRes(state StateDB, blockNumber uint64, contractAddr common.Address, event, code string, datas ...interface{})

addLog let the result add to event. 参数datas可为空,里面的值不能为空 Log.data字段编码规则: 如果datas为空, rlp([code]), 如果datas不为空,rlp([code,rlp(data1),rlp(data2)...]),

func IsYearEnd added in v0.7.5

func IsYearEnd(hash common.Hash, blockNumber uint64) (bool, error)

Determine whether the block height belongs to the last block at the end of the year according to the passed blockNumber

func LoadAvgPackTime added in v0.7.5

func LoadAvgPackTime(hash common.Hash, snapshotDB snapshotdb.DB) (uint64, error)

gets block average pack time (millisecond) from snapshot db.

func LoadCurrentAvgPackTime added in v0.7.5

func LoadCurrentAvgPackTime() (uint64, error)

gets block average pack time (millisecond) from snapshot db.

func LoadIncIssuanceNumber added in v0.7.5

func LoadIncIssuanceNumber(hash common.Hash, snapshotDB snapshotdb.DB) (uint64, error)

func LoadIncIssuanceTime added in v0.7.5

func LoadIncIssuanceTime(hash common.Hash, snapshotDB snapshotdb.DB) (int64, error)

func NewResult added in v0.7.3

func NewResult(err *common.BizError, data interface{}) []byte

func StorageAvgPackTime added in v0.7.5

func StorageAvgPackTime(hash common.Hash, snapshotDB snapshotdb.DB, avgPackTime uint64) error

saves block average pack time (millisecond) to snapshot db.

func StorageIncIssuanceNumber added in v0.7.5

func StorageIncIssuanceNumber(hash common.Hash, snapshotDB snapshotdb.DB, incIssuanceNumber uint64) error

Stored the height of the block that was actually issuance

func StorageIncIssuanceTime added in v0.7.5

func StorageIncIssuanceTime(hash common.Hash, snapshotDB snapshotdb.DB, incTime int64) error

Store the expected time for increase issuance

Types

type Result

type Result struct {
	Code uint32
	Ret  interface{}
}

type StateDB

type StateDB interface {
	CreateAccount(common.Address)

	SubBalance(common.Address, *big.Int)
	AddBalance(common.Address, *big.Int)
	GetBalance(common.Address) *big.Int

	GetNonce(common.Address) uint64
	SetNonce(common.Address, uint64)

	GetCodeHash(common.Address) common.Hash
	GetCode(common.Address) []byte
	SetCode(common.Address, []byte)
	GetCodeSize(common.Address) int

	AddRefund(uint64)
	SubRefund(uint64)
	GetRefund() uint64

	GetCommittedState(common.Address, []byte) []byte
	//GetState(common.Address, common.Hash) common.Hash
	//SetState(common.Address, common.Hash, common.Hash)
	GetState(common.Address, []byte) []byte
	SetState(common.Address, []byte, []byte)

	GetTransientState(addr common.Address, key []byte) []byte
	SetTransientState(addr common.Address, key, value []byte)

	Suicide(common.Address) bool
	HasSuicided(common.Address) bool

	// Exist reports whether the given account exists in state.
	// Notably this should also return true for suicided accounts.
	Exist(common.Address) bool
	// Empty returns whether the given account is empty. Empty
	// is defined according to EIP161 (balance = nonce = code = 0).
	Empty(common.Address) bool

	RevertToSnapshot(int)
	Snapshot() int

	AddLog(*types.Log)
	AddPreimage(common.Hash, []byte)

	ForEachStorage(common.Address, func([]byte, []byte) bool) error

	//ppos add
	TxHash() common.Hash
	TxIdx() uint32

	IntermediateRoot(deleteEmptyObjects bool) common.Hash
}

StateDB is an Plugin database for full state querying.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL