mock

package
v1.0.77 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockChainHookStub

type BlockChainHookStub struct {
	AccountExtistsCalled    func(address []byte) (bool, error)
	NewAddressCalled        func(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)
	GetBalanceCalled        func(address []byte) (*big.Int, error)
	GetNonceCalled          func(address []byte) (uint64, error)
	GetStorageDataCalled    func(accountsAddress []byte, index []byte) ([]byte, error)
	IsCodeEmptyCalled       func(address []byte) (bool, error)
	GetCodeCalled           func(address []byte) ([]byte, error)
	GetBlockHashCalled      func(nonce uint64) ([]byte, error)
	LastNonceCalled         func() uint64
	LastRoundCalled         func() uint64
	LastTimeStampCalled     func() uint64
	LastRandomSeedCalled    func() []byte
	LastEpochCalled         func() uint32
	GetStateRootHashCalled  func() []byte
	CurrentNonceCalled      func() uint64
	CurrentRoundCalled      func() uint64
	CurrentTimeStampCalled  func() uint64
	CurrentRandomSeedCalled func() []byte
	CurrentEpochCalled      func() uint32
}

func (*BlockChainHookStub) AccountExists

func (b *BlockChainHookStub) AccountExists(address []byte) (bool, error)

func (*BlockChainHookStub) CurrentEpoch

func (b *BlockChainHookStub) CurrentEpoch() uint32

func (*BlockChainHookStub) CurrentNonce

func (b *BlockChainHookStub) CurrentNonce() uint64

func (*BlockChainHookStub) CurrentRandomSeed

func (b *BlockChainHookStub) CurrentRandomSeed() []byte

func (*BlockChainHookStub) CurrentRound

func (b *BlockChainHookStub) CurrentRound() uint64

func (*BlockChainHookStub) CurrentTimeStamp

func (b *BlockChainHookStub) CurrentTimeStamp() uint64

func (*BlockChainHookStub) GetBalance

func (b *BlockChainHookStub) GetBalance(address []byte) (*big.Int, error)

func (*BlockChainHookStub) GetBlockhash

func (b *BlockChainHookStub) GetBlockhash(nonce uint64) ([]byte, error)

func (*BlockChainHookStub) GetCode

func (b *BlockChainHookStub) GetCode(address []byte) ([]byte, error)

func (*BlockChainHookStub) GetNonce

func (b *BlockChainHookStub) GetNonce(address []byte) (uint64, error)

func (*BlockChainHookStub) GetStateRootHash

func (b *BlockChainHookStub) GetStateRootHash() []byte

func (*BlockChainHookStub) GetStorageData

func (b *BlockChainHookStub) GetStorageData(accountAddress []byte, index []byte) ([]byte, error)

func (*BlockChainHookStub) IsCodeEmpty

func (b *BlockChainHookStub) IsCodeEmpty(address []byte) (bool, error)

func (*BlockChainHookStub) LastEpoch

func (b *BlockChainHookStub) LastEpoch() uint32

func (*BlockChainHookStub) LastNonce

func (b *BlockChainHookStub) LastNonce() uint64

func (*BlockChainHookStub) LastRandomSeed

func (b *BlockChainHookStub) LastRandomSeed() []byte

func (*BlockChainHookStub) LastRound

func (b *BlockChainHookStub) LastRound() uint64

func (*BlockChainHookStub) LastTimeStamp

func (b *BlockChainHookStub) LastTimeStamp() uint64

func (*BlockChainHookStub) NewAddress

func (b *BlockChainHookStub) NewAddress(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)

type SystemEIStub

type SystemEIStub struct {
	TransferCalled                  func(destination []byte, sender []byte, value *big.Int, input []byte) error
	GetBalanceCalled                func(addr []byte) *big.Int
	SetStorageCalled                func(key []byte, value []byte)
	GetStorageCalled                func(key []byte) []byte
	SelfDestructCalled              func(beneficiary []byte)
	CreateVMOutputCalled            func() *vmcommon.VMOutput
	CleanCacheCalled                func()
	FinishCalled                    func(value []byte)
	AddCodeCalled                   func(addr []byte, code []byte)
	AddTxValueToSmartContractCalled func(value *big.Int, scAddress []byte)
	BlockChainHookCalled            func() vmcommon.BlockchainHook
	CryptoHookCalled                func() vmcommon.CryptoHook
}

func (*SystemEIStub) AddCode

func (s *SystemEIStub) AddCode(addr []byte, code []byte)

func (*SystemEIStub) AddTxValueToSmartContract

func (s *SystemEIStub) AddTxValueToSmartContract(value *big.Int, scAddress []byte)

func (*SystemEIStub) BlockChainHook

func (s *SystemEIStub) BlockChainHook() vmcommon.BlockchainHook

func (*SystemEIStub) CleanCache

func (s *SystemEIStub) CleanCache()

func (*SystemEIStub) CreateVMOutput

func (s *SystemEIStub) CreateVMOutput() *vmcommon.VMOutput

func (*SystemEIStub) CryptoHook

func (s *SystemEIStub) CryptoHook() vmcommon.CryptoHook

func (*SystemEIStub) Finish

func (s *SystemEIStub) Finish(value []byte)

func (*SystemEIStub) GetBalance

func (s *SystemEIStub) GetBalance(addr []byte) *big.Int

func (*SystemEIStub) GetStorage

func (s *SystemEIStub) GetStorage(key []byte) []byte

func (*SystemEIStub) IsInterfaceNil

func (s *SystemEIStub) IsInterfaceNil() bool

func (*SystemEIStub) SelfDestruct

func (s *SystemEIStub) SelfDestruct(beneficiary []byte)

func (*SystemEIStub) SetSCAddress

func (s *SystemEIStub) SetSCAddress(addr []byte)

func (*SystemEIStub) SetStorage

func (s *SystemEIStub) SetStorage(key []byte, value []byte)

func (*SystemEIStub) Transfer

func (s *SystemEIStub) Transfer(destination []byte, sender []byte, value *big.Int, input []byte) error

type SystemSCContainerStub

type SystemSCContainerStub struct {
	GetCalled     func(key []byte) (vm.SystemSmartContract, error)
	AddCalled     func(key []byte, val vm.SystemSmartContract) error
	ReplaceCalled func(key []byte, val vm.SystemSmartContract) error
	RemoveCalled  func(key []byte)
	LenCalled     func() int
	KeysCalled    func() [][]byte
}

func (*SystemSCContainerStub) Add

func (*SystemSCContainerStub) Get

func (*SystemSCContainerStub) IsInterfaceNil

func (s *SystemSCContainerStub) IsInterfaceNil() bool

func (*SystemSCContainerStub) Keys

func (s *SystemSCContainerStub) Keys() [][]byte

func (*SystemSCContainerStub) Len

func (s *SystemSCContainerStub) Len() int

func (*SystemSCContainerStub) Remove

func (s *SystemSCContainerStub) Remove(key []byte)

func (*SystemSCContainerStub) Replace

func (s *SystemSCContainerStub) Replace(key []byte, val vm.SystemSmartContract) error

type SystemSCStub

type SystemSCStub struct {
	ExecuteCalled func(args *vmcommon.ContractCallInput) vmcommon.ReturnCode
	ValueOfCalled func(key interface{}) interface{}
}

func (*SystemSCStub) Execute

func (*SystemSCStub) IsInterfaceNil

func (s *SystemSCStub) IsInterfaceNil() bool

func (*SystemSCStub) ValueOf

func (s *SystemSCStub) ValueOf(key interface{}) interface{}

type ValidatorSettingsStub

type ValidatorSettingsStub struct {
}

func (*ValidatorSettingsStub) IsInterfaceNil

func (v *ValidatorSettingsStub) IsInterfaceNil() bool

func (*ValidatorSettingsStub) StakeValue added in v1.0.39

func (v *ValidatorSettingsStub) StakeValue() *big.Int

func (*ValidatorSettingsStub) UnBoundPeriod added in v1.0.39

func (v *ValidatorSettingsStub) UnBoundPeriod() uint64

Jump to

Keyboard shortcuts

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