Documentation ¶
Index ¶
- type StateDB
- func (sdb *StateDB) BeginBlock(transaction *statedb.Transaction)
- func (sdb *StateDB) CheckAccountNonce(exAddress smc.Address, nonce uint64) error
- func (sdb *StateDB) CommitBlock() error
- func (sdb *StateDB) CommitTx(txBuffer map[string][]byte)
- func (sdb *StateDB) Get(key string) ([]byte, error)
- func (sdb *StateDB) GetAccountNonce(exAddress smc.Address) (uint64, error)
- func (sdb *StateDB) GetAllValidators() ([]types.Validator, error)
- func (sdb *StateDB) GetBalance(contractAddress smc.Address, exAddress smc.Address) (big.Int, error)
- func (sdb *StateDB) GetBlockBuffer() []byte
- func (sdb *StateDB) GetChainID() string
- func (sdb *StateDB) GetContract(contractAddr smc.Address) (*types.Contract, error)
- func (sdb *StateDB) GetContractAddrList() ([]string, error)
- func (sdb *StateDB) GetGenesisContract(contractAddr smc.Address) (*types.Contract, error)
- func (sdb *StateDB) GetGenesisContractList() ([]string, error)
- func (sdb *StateDB) GetGenesisToken() (*types.IssueToken, error)
- func (sdb *StateDB) GetToken(contractAddr smc.Address) (*types.IssueToken, error)
- func (sdb *StateDB) GetTokenAddrList() ([]string, error)
- func (sdb *StateDB) GetTokenBalListWithAccAddr(accountAddr smc.Address) ([]types.TokenBalance, error)
- func (sdb *StateDB) GetValidator(nodeAddr string) (*types.Validator, error)
- func (sdb *StateDB) GetWorldAppState() (*abci.AppState, error)
- func (sdb *StateDB) NewTxState(contractAddress smc.Address, senderAddress smc.Address) *TxState
- func (sdb *StateDB) RollBlock()
- func (sdb *StateDB) Set(key string, value []byte)
- func (sdb *StateDB) SetAccountNonce(exAddress smc.Address, nonce uint64) (nonceBuffer map[string][]byte, err error)
- func (sdb *StateDB) SetChainID(chainID string)
- func (sdb *StateDB) SetGenesisContract(contract *types.Contract) error
- func (sdb *StateDB) SetGenesisToken(genesisToken *types.IssueToken) error
- func (sdb *StateDB) SetStrategys(strategys []types.RewardStrategy) error
- func (sdb *StateDB) SetValidator(validator *types.Validator) error
- func (sdb *StateDB) SetWorldAppState(appState *abci.AppState) error
- type TxState
- func (txState *TxState) AddChildKey(key string, childKey string) error
- func (txState *TxState) CheckBlackAddress(address smc.Address) bool
- func (txState *TxState) CommitTx() ([]byte, map[string][]byte)
- func (txState *TxState) DeleteContractAddr(exAddress smc.Address, contractAddr smc.Address) error
- func (txState *TxState) Get(key string) ([]byte, error)
- func (txState *TxState) GetAllValidatorPubKeys() ([]string, error)
- func (txState *TxState) GetBalance(exAddress smc.Address, tokenAddress smc.Address) (big.Int, error)
- func (txState *TxState) GetBaseGasPrice() uint64
- func (txState *TxState) GetChainID() string
- func (txState *TxState) GetContractsListByName(name string) ([]smc.Address, error)
- func (txState *TxState) GetGas(contractAddr smc.Address, methodId uint32) (uint64, error)
- func (txState *TxState) GetGenesisToken() (*types.IssueToken, error)
- func (txState *TxState) GetStrategys() ([]types.RewardStrategy, error)
- func (txState *TxState) GetToken(tokenAddr smc.Address) (*types.IssueToken, error)
- func (txState *TxState) GetTokenAddrByName(name string) (smc.Address, error)
- func (txState *TxState) GetTokenAddrBySymbol(name string) (smc.Address, error)
- func (txState *TxState) GetUDCNonce() (uint64, error)
- func (txState *TxState) GetUDCOrder(udcHash []byte) (*types.UDCOrder, error)
- func (txState *TxState) RollbackTx()
- func (txState *TxState) Set(key string, value []byte) error
- func (txState *TxState) SetBalance(exAddress smc.Address, tokenAddress smc.Address, value big.Int) error
- func (txState *TxState) SetBaseGasPrice(gasPrice uint64) error
- func (txState *TxState) SetStrategys(strategys []types.RewardStrategy) error
- func (txState *TxState) SetToken(issueToken *types.IssueToken) error
- func (txState *TxState) SetTokenContract(contract *types.Contract) error
- func (txState *TxState) SetUDCNonce(nonce uint64) error
- func (txState *TxState) SetUDCOrder(udcOrder *types.UDCOrder) error
- func (txState *TxState) SetValidator(validator *types.Validator) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StateDB ¶
type StateDB struct {
Transaction *statedb.Transaction
}
func NewStateDB ¶
func NewStateDB() *StateDB
func (*StateDB) BeginBlock ¶
func (sdb *StateDB) BeginBlock(transaction *statedb.Transaction)
func (*StateDB) CheckAccountNonce ¶
CheckTx需要调用此接口检查nonce
func (*StateDB) CommitBlock ¶
func (*StateDB) GetAccountNonce ¶
Get nonce of the account
func (*StateDB) GetAllValidators ¶
func (*StateDB) GetBalance ¶
先在内存中找,如果找不到,再到db中找
func (*StateDB) GetBlockBuffer ¶
func (*StateDB) GetChainID ¶
func (*StateDB) GetContract ¶
func (*StateDB) GetContractAddrList ¶
func (*StateDB) GetGenesisContract ¶
func (*StateDB) GetGenesisContractList ¶
func (*StateDB) GetGenesisToken ¶
func (sdb *StateDB) GetGenesisToken() (*types.IssueToken, error)
func (*StateDB) GetTokenAddrList ¶
func (*StateDB) GetTokenBalListWithAccAddr ¶
func (*StateDB) GetValidator ¶
func (*StateDB) NewTxState ¶
func (*StateDB) SetAccountNonce ¶
func (sdb *StateDB) SetAccountNonce(exAddress smc.Address, nonce uint64) (nonceBuffer map[string][]byte, err error)
DeliverTx需要调用此接口检查并设置nonce
func (*StateDB) SetChainID ¶
func (*StateDB) SetGenesisContract ¶
func (*StateDB) SetGenesisToken ¶
func (sdb *StateDB) SetGenesisToken(genesisToken *types.IssueToken) error
先设置合约,再设置代币
func (*StateDB) SetStrategys ¶
func (sdb *StateDB) SetStrategys(strategys []types.RewardStrategy) error
type TxState ¶
type TxState struct { StateDB *StateDB //read ContractAddress smc.Address SenderAddress smc.Address Tx *statedb.Tx }
func (*TxState) AddChildKey ¶
func (*TxState) CheckBlackAddress ¶
func (*TxState) DeleteContractAddr ¶
func (*TxState) GetAllValidatorPubKeys ¶
func (*TxState) GetBalance ¶
func (*TxState) GetBaseGasPrice ¶
func (*TxState) GetChainID ¶
func (*TxState) GetContractsListByName ¶
func (*TxState) GetGenesisToken ¶
func (txState *TxState) GetGenesisToken() (*types.IssueToken, error)
func (*TxState) GetStrategys ¶
func (txState *TxState) GetStrategys() ([]types.RewardStrategy, error)
func (*TxState) GetTokenAddrByName ¶
func (*TxState) GetTokenAddrBySymbol ¶
func (*TxState) GetUDCNonce ¶
func (*TxState) GetUDCOrder ¶
func (*TxState) RollbackTx ¶
func (txState *TxState) RollbackTx()
func (*TxState) SetBalance ¶
func (*TxState) SetBaseGasPrice ¶
func (*TxState) SetStrategys ¶
func (txState *TxState) SetStrategys(strategys []types.RewardStrategy) error
func (*TxState) SetToken ¶
func (txState *TxState) SetToken(issueToken *types.IssueToken) error
只设置Token信息,不设置账户的代币
func (*TxState) SetTokenContract ¶
func (*TxState) SetUDCNonce ¶
Click to show internal directories.
Click to hide internal directories.