Documentation ¶
Index ¶
- func CreateSnapshotBlock(chainInstance chain.Chain, options *SnapshotOptions) *ledger.SnapshotBlock
- type Account
- func (acc *Account) AddUnreceivedBlock(block *ledger.AccountBlock)
- func (acc *Account) CreateRequestTx(toAccount *Account, options *CreateTxOptions) []*vm_context.VmAccountBlock
- func (acc *Account) CreateResponseTx(options *CreateTxOptions) []*vm_context.VmAccountBlock
- func (acc *Account) HasUnreceivedBlock() bool
- func (acc *Account) Hash() types.Hash
- func (acc *Account) Height() uint64
- func (acc *Account) PopUnreceivedBlock() *ledger.AccountBlock
- type CreateTxOptions
- type MockVmDatabase
- func (context *MockVmDatabase) AddBalance(tokenTypeId *types.TokenTypeId, amount *big.Int)
- func (context *MockVmDatabase) AddLog(log *ledger.VmLog)
- func (context *MockVmDatabase) Address() *types.Address
- func (context *MockVmDatabase) CopyAndFreeze() vmctxt_interface.VmDatabase
- func (context *MockVmDatabase) CurrentSnapshotBlock() *ledger.SnapshotBlock
- func (context *MockVmDatabase) DebugGetStorage() map[string][]byte
- func (context *MockVmDatabase) GetAccountBlockByHash(hash *types.Hash) *ledger.AccountBlock
- func (context *MockVmDatabase) GetBalance(addr *types.Address, tokenTypeId *types.TokenTypeId) *big.Int
- func (context *MockVmDatabase) GetBalanceList(snapshotHash types.Hash, tokenTypeId types.TokenTypeId, ...) (map[types.Address]*big.Int, error)
- func (context *MockVmDatabase) GetConsensusGroupList(snapshotHash types.Hash) ([]*types.ConsensusGroupInfo, error)
- func (context *MockVmDatabase) GetContractCode(addr *types.Address) []byte
- func (context *MockVmDatabase) GetGenesisSnapshotBlock() *ledger.SnapshotBlock
- func (context *MockVmDatabase) GetGid() *types.Gid
- func (context *MockVmDatabase) GetLogListHash() *types.Hash
- func (context *MockVmDatabase) GetOneHourQuota() (uint64, error)
- func (context *MockVmDatabase) GetOriginalStorage(key []byte) []byte
- func (context *MockVmDatabase) GetReceiveBlockHeights(hash *types.Hash) ([]uint64, error)
- func (context *MockVmDatabase) GetRegisterList(snapshotHash types.Hash, gid types.Gid) ([]*types.Registration, error)
- func (context *MockVmDatabase) GetSelfAccountBlockByHeight(height uint64) *ledger.AccountBlock
- func (context *MockVmDatabase) GetSnapshotBlockBeforeTime(timestamp *time.Time) (*ledger.SnapshotBlock, error)
- func (context *MockVmDatabase) GetSnapshotBlockByHash(hash *types.Hash) *ledger.SnapshotBlock
- func (context *MockVmDatabase) GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error)
- func (context *MockVmDatabase) GetSnapshotBlocks(startHeight, count uint64, forward, containSnapshotContent bool) []*ledger.SnapshotBlock
- func (context *MockVmDatabase) GetStorage(addr *types.Address, key []byte) []byte
- func (context *MockVmDatabase) GetStorageBySnapshotHash(addr *types.Address, key []byte, snapshotHash *types.Hash) []byte
- func (context *MockVmDatabase) GetStorageHash() *types.Hash
- func (context *MockVmDatabase) GetVoteMap(snapshotHash types.Hash, gid types.Gid) ([]*types.VoteInfo, error)
- func (context *MockVmDatabase) IsAddressExisted(addr *types.Address) bool
- func (context *MockVmDatabase) NewStorageIterator(addr *types.Address, prefix []byte) vmctxt_interface.StorageIterator
- func (context *MockVmDatabase) NewStorageIteratorBySnapshotHash(addr *types.Address, prefix []byte, snapshotHash *types.Hash) vmctxt_interface.StorageIterator
- func (context *MockVmDatabase) PrevAccountBlock() *ledger.AccountBlock
- func (context *MockVmDatabase) Reset()
- func (context *MockVmDatabase) SetContractCode(code []byte)
- func (context *MockVmDatabase) SetContractGid(gid *types.Gid, addr *types.Address)
- func (context *MockVmDatabase) SetStorage(key []byte, value []byte)
- func (context *MockVmDatabase) SubBalance(tokenTypeId *types.TokenTypeId, amount *big.Int)
- func (context *MockVmDatabase) UnsavedCache() vmctxt_interface.UnsavedCache
- type SnapshotOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSnapshotBlock ¶
func CreateSnapshotBlock(chainInstance chain.Chain, options *SnapshotOptions) *ledger.SnapshotBlock
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func (*Account) AddUnreceivedBlock ¶
func (acc *Account) AddUnreceivedBlock(block *ledger.AccountBlock)
func (*Account) CreateRequestTx ¶
func (acc *Account) CreateRequestTx(toAccount *Account, options *CreateTxOptions) []*vm_context.VmAccountBlock
No state hash
func (*Account) CreateResponseTx ¶
func (acc *Account) CreateResponseTx(options *CreateTxOptions) []*vm_context.VmAccountBlock
No state hash
func (*Account) HasUnreceivedBlock ¶
func (*Account) PopUnreceivedBlock ¶
func (acc *Account) PopUnreceivedBlock() *ledger.AccountBlock
type CreateTxOptions ¶
type MockVmDatabase ¶
type MockVmDatabase struct{}
func (*MockVmDatabase) AddBalance ¶
func (context *MockVmDatabase) AddBalance(tokenTypeId *types.TokenTypeId, amount *big.Int)
func (*MockVmDatabase) AddLog ¶
func (context *MockVmDatabase) AddLog(log *ledger.VmLog)
func (*MockVmDatabase) Address ¶
func (context *MockVmDatabase) Address() *types.Address
func (*MockVmDatabase) CopyAndFreeze ¶
func (context *MockVmDatabase) CopyAndFreeze() vmctxt_interface.VmDatabase
func (*MockVmDatabase) CurrentSnapshotBlock ¶
func (context *MockVmDatabase) CurrentSnapshotBlock() *ledger.SnapshotBlock
func (*MockVmDatabase) DebugGetStorage ¶
func (context *MockVmDatabase) DebugGetStorage() map[string][]byte
func (*MockVmDatabase) GetAccountBlockByHash ¶
func (context *MockVmDatabase) GetAccountBlockByHash(hash *types.Hash) *ledger.AccountBlock
func (*MockVmDatabase) GetBalance ¶
func (context *MockVmDatabase) GetBalance(addr *types.Address, tokenTypeId *types.TokenTypeId) *big.Int
func (*MockVmDatabase) GetBalanceList ¶
func (*MockVmDatabase) GetConsensusGroupList ¶
func (context *MockVmDatabase) GetConsensusGroupList(snapshotHash types.Hash) ([]*types.ConsensusGroupInfo, error)
func (*MockVmDatabase) GetContractCode ¶
func (context *MockVmDatabase) GetContractCode(addr *types.Address) []byte
func (*MockVmDatabase) GetGenesisSnapshotBlock ¶
func (context *MockVmDatabase) GetGenesisSnapshotBlock() *ledger.SnapshotBlock
func (*MockVmDatabase) GetGid ¶
func (context *MockVmDatabase) GetGid() *types.Gid
func (*MockVmDatabase) GetLogListHash ¶
func (context *MockVmDatabase) GetLogListHash() *types.Hash
func (*MockVmDatabase) GetOneHourQuota ¶
func (context *MockVmDatabase) GetOneHourQuota() (uint64, error)
func (*MockVmDatabase) GetOriginalStorage ¶ added in v1.3.2
func (context *MockVmDatabase) GetOriginalStorage(key []byte) []byte
func (*MockVmDatabase) GetReceiveBlockHeights ¶ added in v1.3.0
func (context *MockVmDatabase) GetReceiveBlockHeights(hash *types.Hash) ([]uint64, error)
func (*MockVmDatabase) GetRegisterList ¶
func (context *MockVmDatabase) GetRegisterList(snapshotHash types.Hash, gid types.Gid) ([]*types.Registration, error)
func (*MockVmDatabase) GetSelfAccountBlockByHeight ¶ added in v1.3.2
func (context *MockVmDatabase) GetSelfAccountBlockByHeight(height uint64) *ledger.AccountBlock
func (*MockVmDatabase) GetSnapshotBlockBeforeTime ¶
func (context *MockVmDatabase) GetSnapshotBlockBeforeTime(timestamp *time.Time) (*ledger.SnapshotBlock, error)
func (*MockVmDatabase) GetSnapshotBlockByHash ¶
func (context *MockVmDatabase) GetSnapshotBlockByHash(hash *types.Hash) *ledger.SnapshotBlock
func (*MockVmDatabase) GetSnapshotBlockByHeight ¶
func (context *MockVmDatabase) GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error)
func (*MockVmDatabase) GetSnapshotBlocks ¶
func (context *MockVmDatabase) GetSnapshotBlocks(startHeight, count uint64, forward, containSnapshotContent bool) []*ledger.SnapshotBlock
func (*MockVmDatabase) GetStorage ¶
func (context *MockVmDatabase) GetStorage(addr *types.Address, key []byte) []byte
func (*MockVmDatabase) GetStorageBySnapshotHash ¶
func (*MockVmDatabase) GetStorageHash ¶
func (context *MockVmDatabase) GetStorageHash() *types.Hash
func (*MockVmDatabase) GetVoteMap ¶
func (*MockVmDatabase) IsAddressExisted ¶
func (context *MockVmDatabase) IsAddressExisted(addr *types.Address) bool
func (*MockVmDatabase) NewStorageIterator ¶
func (context *MockVmDatabase) NewStorageIterator(addr *types.Address, prefix []byte) vmctxt_interface.StorageIterator
func (*MockVmDatabase) NewStorageIteratorBySnapshotHash ¶
func (context *MockVmDatabase) NewStorageIteratorBySnapshotHash(addr *types.Address, prefix []byte, snapshotHash *types.Hash) vmctxt_interface.StorageIterator
func (*MockVmDatabase) PrevAccountBlock ¶
func (context *MockVmDatabase) PrevAccountBlock() *ledger.AccountBlock
func (*MockVmDatabase) Reset ¶
func (context *MockVmDatabase) Reset()
func (*MockVmDatabase) SetContractCode ¶
func (context *MockVmDatabase) SetContractCode(code []byte)
func (*MockVmDatabase) SetContractGid ¶
func (context *MockVmDatabase) SetContractGid(gid *types.Gid, addr *types.Address)
func (*MockVmDatabase) SetStorage ¶
func (context *MockVmDatabase) SetStorage(key []byte, value []byte)
func (*MockVmDatabase) SubBalance ¶
func (context *MockVmDatabase) SubBalance(tokenTypeId *types.TokenTypeId, amount *big.Int)
func (*MockVmDatabase) UnsavedCache ¶
func (context *MockVmDatabase) UnsavedCache() vmctxt_interface.UnsavedCache
type SnapshotOptions ¶
type SnapshotOptions struct {
MockTrie bool
}
Click to show internal directories.
Click to hide internal directories.