mock

package
v1.0.29 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: GPL-3.0 Imports: 3 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(offset *big.Int) ([]byte, error)
}

func (*BlockChainHookStub) AccountExists

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

func (*BlockChainHookStub) GetBalance

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

func (*BlockChainHookStub) GetBlockhash

func (b *BlockChainHookStub) GetBlockhash(offset *big.Int) ([]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) GetStorageData

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

func (*BlockChainHookStub) IsCodeEmpty

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

func (*BlockChainHookStub) NewAddress

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

type CryptoHookStub added in v1.0.28

type CryptoHookStub struct {
	Sha256Called    func(str string) (string, error)
	Keccak256Called func(str string) (string, error)
}

func (*CryptoHookStub) Bn128add added in v1.0.28

func (*CryptoHookStub) Bn128ate added in v1.0.28

func (c *CryptoHookStub) Bn128ate(l1 []vmcommon.Bn128Point, l2 []vmcommon.Bn128G2Point) (bool, error)

func (*CryptoHookStub) Bn128g2valid added in v1.0.28

func (c *CryptoHookStub) Bn128g2valid(p vmcommon.Bn128G2Point) (bool, error)

func (*CryptoHookStub) Bn128mul added in v1.0.28

func (*CryptoHookStub) Bn128valid added in v1.0.28

func (c *CryptoHookStub) Bn128valid(p vmcommon.Bn128Point) (bool, error)

func (*CryptoHookStub) EcdsaRecover added in v1.0.28

func (c *CryptoHookStub) EcdsaRecover(hash string, v *big.Int, r string, s string) (string, error)

func (*CryptoHookStub) Keccak256 added in v1.0.28

func (c *CryptoHookStub) Keccak256(str string) (string, error)

func (*CryptoHookStub) Ripemd160 added in v1.0.28

func (c *CryptoHookStub) Ripemd160(str string) (string, error)

func (*CryptoHookStub) Sha256 added in v1.0.28

func (c *CryptoHookStub) Sha256(str string) (string, 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()
}

func (*SystemEIStub) CleanCache

func (s *SystemEIStub) CleanCache()

func (*SystemEIStub) CreateVMOutput

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

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{}

Jump to

Keyboard shortcuts

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