test_tools

package
v1.2.3-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

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 MakeAccounts

func MakeAccounts(num uint64, chainInstance chain.Chain) []*Account

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 (acc *Account) HasUnreceivedBlock() bool

func (*Account) Hash

func (acc *Account) Hash() types.Hash

func (*Account) Height

func (acc *Account) Height() uint64

func (*Account) PopUnreceivedBlock

func (acc *Account) PopUnreceivedBlock() *ledger.AccountBlock

type CreateTxOptions

type CreateTxOptions struct {
	MockVmContext bool
	MockSignature bool
	Quota         uint64
}

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 (context *MockVmDatabase) GetBalanceList(snapshotHash types.Hash, tokenTypeId types.TokenTypeId, addressList []types.Address) (map[types.Address]*big.Int, error)

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) 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) 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 (context *MockVmDatabase) GetStorageBySnapshotHash(addr *types.Address, key []byte, snapshotHash *types.Hash) []byte

func (*MockVmDatabase) GetStorageHash

func (context *MockVmDatabase) GetStorageHash() *types.Hash

func (*MockVmDatabase) GetVoteMap

func (context *MockVmDatabase) GetVoteMap(snapshotHash types.Hash, gid types.Gid) ([]*types.VoteInfo, error)

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
}

Jump to

Keyboard shortcuts

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