mock

package
v1.1.66 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMockMarshalizer = errors.New("MarshalizerMock generic error")

ErrMockMarshalizer -

Functions

This section is empty.

Types

type AccountsStub

type AccountsStub struct {
	AddJournalEntryCalled    func(je state.JournalEntry)
	GetExistingAccountCalled func(address []byte) (state.AccountHandler, error)
	LoadAccountCalled        func(address []byte) (state.AccountHandler, error)
	SaveAccountCalled        func(account state.AccountHandler) error
	RemoveAccountCalled      func(address []byte) error
	CommitCalled             func() ([]byte, error)
	JournalLenCalled         func() int
	RevertToSnapshotCalled   func(snapshot int) error
	RootHashCalled           func() ([]byte, error)
	RecreateTrieCalled       func(rootHash []byte) error
	PruneTrieCalled          func(rootHash []byte, identifier data.TriePruningIdentifier)
	CancelPruneCalled        func(rootHash []byte, identifier data.TriePruningIdentifier)
	SnapshotStateCalled      func(rootHash []byte)
	SetStateCheckpointCalled func(rootHash []byte)
	IsPruningEnabledCalled   func() bool
	GetAllLeavesCalled       func(rootHash []byte) (chan core.KeyValueHolder, error)
	RecreateAllTriesCalled   func(rootHash []byte) (map[string]data.Trie, error)
	GetNumCheckpointsCalled  func() uint32
	IsLowRatingCalled        func(blsKey []byte) bool
	GetCodeCalled            func([]byte) []byte
}

AccountsStub -

func (*AccountsStub) AddJournalEntry

func (as *AccountsStub) AddJournalEntry(je state.JournalEntry)

AddJournalEntry -

func (*AccountsStub) CancelPrune

func (as *AccountsStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)

CancelPrune -

func (*AccountsStub) Commit

func (as *AccountsStub) Commit() ([]byte, error)

Commit -

func (*AccountsStub) GetAllLeaves

func (as *AccountsStub) GetAllLeaves(rootHash []byte, _ context.Context) (chan core.KeyValueHolder, error)

GetAllLeaves -

func (*AccountsStub) GetCode

func (as *AccountsStub) GetCode(codeHash []byte) []byte

GetCode -

func (*AccountsStub) GetExistingAccount

func (as *AccountsStub) GetExistingAccount(address []byte) (state.AccountHandler, error)

GetExistingAccount -

func (*AccountsStub) GetNumCheckpoints

func (as *AccountsStub) GetNumCheckpoints() uint32

GetNumCheckpoints -

func (*AccountsStub) IsInterfaceNil

func (as *AccountsStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*AccountsStub) IsLowRating

func (as *AccountsStub) IsLowRating(blsKey []byte) bool

IsLowRating -

func (*AccountsStub) IsPruningEnabled

func (as *AccountsStub) IsPruningEnabled() bool

IsPruningEnabled -

func (*AccountsStub) JournalLen

func (as *AccountsStub) JournalLen() int

JournalLen -

func (*AccountsStub) LoadAccount

func (as *AccountsStub) LoadAccount(address []byte) (state.AccountHandler, error)

LoadAccount -

func (*AccountsStub) PruneTrie

func (as *AccountsStub) PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier)

PruneTrie -

func (*AccountsStub) RecreateAllTries

func (as *AccountsStub) RecreateAllTries(rootHash []byte, _ context.Context) (map[string]data.Trie, error)

RecreateAllTries -

func (*AccountsStub) RecreateTrie

func (as *AccountsStub) RecreateTrie(rootHash []byte) error

RecreateTrie -

func (*AccountsStub) RemoveAccount

func (as *AccountsStub) RemoveAccount(address []byte) error

RemoveAccount -

func (*AccountsStub) RevertToSnapshot

func (as *AccountsStub) RevertToSnapshot(snapshot int) error

RevertToSnapshot -

func (*AccountsStub) RootHash

func (as *AccountsStub) RootHash() ([]byte, error)

RootHash -

func (*AccountsStub) SaveAccount

func (as *AccountsStub) SaveAccount(account state.AccountHandler) error

SaveAccount -

func (*AccountsStub) SetStateCheckpoint

func (as *AccountsStub) SetStateCheckpoint(rootHash []byte, _ context.Context)

SetStateCheckpoint -

func (*AccountsStub) SnapshotState

func (as *AccountsStub) SnapshotState(rootHash []byte, _ context.Context)

SnapshotState -

type ArgumentParserMock

type ArgumentParserMock struct {
	ParseCallDataCalled               func(data string) (string, [][]byte, error)
	ParseDeployDataCalled             func(data string) (*parsers.DeployArgs, error)
	CreateDataFromStorageUpdateCalled func(storageUpdates []*vmcommon.StorageUpdate) string
	GetStorageUpdatesCalled           func(data string) ([]*vmcommon.StorageUpdate, error)
}

ArgumentParserMock -

func (*ArgumentParserMock) CreateDataFromStorageUpdate

func (ap *ArgumentParserMock) CreateDataFromStorageUpdate(storageUpdates []*vmcommon.StorageUpdate) string

CreateDataFromStorageUpdate -

func (*ArgumentParserMock) GetStorageUpdates

func (ap *ArgumentParserMock) GetStorageUpdates(data string) ([]*vmcommon.StorageUpdate, error)

GetStorageUpdates -

func (*ArgumentParserMock) IsInterfaceNil

func (ap *ArgumentParserMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ArgumentParserMock) ParseCallData

func (ap *ArgumentParserMock) ParseCallData(data string) (string, [][]byte, error)

ParseCallData -

func (*ArgumentParserMock) ParseData

func (ap *ArgumentParserMock) ParseData(data string) (string, [][]byte, error)

ParseData -

func (*ArgumentParserMock) ParseDeployData

func (ap *ArgumentParserMock) ParseDeployData(data string) (*parsers.DeployArgs, error)

ParseDeployData -

type BlockChainHookStub

type BlockChainHookStub struct {
	AccountExtistsCalled          func(address []byte) (bool, error)
	NewAddressCalled              func(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)
	GetStorageDataCalled          func(accountsAddress []byte, index []byte) ([]byte, error)
	GetUserAccountCalled          func(address []byte) (vmcommon.UserAccountHandler, error)
	GetShardOfAddressCalled       func(address []byte) uint32
	IsSmartContractCalled         func(address []byte) bool
	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
	ProcessBuiltInFunctionCalled  func(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
	GetBuiltinFunctionNamesCalled func() vmcommon.FunctionNames
	GetAllStateCalled             func(address []byte) (map[string][]byte, error)
	IsPayableCalled               func(address []byte) (bool, error)
	NumberOfShardsCalled          func() uint32
	GetCodeCalled                 func(account vmcommon.UserAccountHandler) []byte
	GetSnapshotCalled             func() int
	RevertToSnapshotCalled        func(snapshot int) error
}

BlockChainHookStub -

func (*BlockChainHookStub) AccountExists

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

AccountExists -

func (*BlockChainHookStub) CurrentEpoch

func (b *BlockChainHookStub) CurrentEpoch() uint32

CurrentEpoch -

func (*BlockChainHookStub) CurrentNonce

func (b *BlockChainHookStub) CurrentNonce() uint64

CurrentNonce -

func (*BlockChainHookStub) CurrentRandomSeed

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

CurrentRandomSeed -

func (*BlockChainHookStub) CurrentRound

func (b *BlockChainHookStub) CurrentRound() uint64

CurrentRound -

func (*BlockChainHookStub) CurrentTimeStamp

func (b *BlockChainHookStub) CurrentTimeStamp() uint64

CurrentTimeStamp -

func (*BlockChainHookStub) GetAllState

func (b *BlockChainHookStub) GetAllState(address []byte) (map[string][]byte, error)

GetAllState -

func (*BlockChainHookStub) GetBlockhash

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

GetBlockhash -

func (*BlockChainHookStub) GetBuiltinFunctionNames

func (b *BlockChainHookStub) GetBuiltinFunctionNames() vmcommon.FunctionNames

GetBuiltinFunctionNames -

func (*BlockChainHookStub) GetCode

func (b *BlockChainHookStub) GetCode(account vmcommon.UserAccountHandler) []byte

GetCode -

func (*BlockChainHookStub) GetShardOfAddress

func (b *BlockChainHookStub) GetShardOfAddress(address []byte) uint32

GetShardOfAddress -

func (*BlockChainHookStub) GetSnapshot

func (b *BlockChainHookStub) GetSnapshot() int

GetSnapshot -

func (*BlockChainHookStub) GetStateRootHash

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

GetStateRootHash -

func (*BlockChainHookStub) GetStorageData

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

GetStorageData -

func (*BlockChainHookStub) GetUserAccount

func (b *BlockChainHookStub) GetUserAccount(address []byte) (vmcommon.UserAccountHandler, error)

GetUserAccount -

func (*BlockChainHookStub) IsPayable

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

IsPayable -

func (*BlockChainHookStub) IsSmartContract

func (b *BlockChainHookStub) IsSmartContract(address []byte) bool

IsSmartContract -

func (*BlockChainHookStub) LastEpoch

func (b *BlockChainHookStub) LastEpoch() uint32

LastEpoch -

func (*BlockChainHookStub) LastNonce

func (b *BlockChainHookStub) LastNonce() uint64

LastNonce -

func (*BlockChainHookStub) LastRandomSeed

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

LastRandomSeed -

func (*BlockChainHookStub) LastRound

func (b *BlockChainHookStub) LastRound() uint64

LastRound -

func (*BlockChainHookStub) LastTimeStamp

func (b *BlockChainHookStub) LastTimeStamp() uint64

LastTimeStamp -

func (*BlockChainHookStub) NewAddress

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

NewAddress -

func (*BlockChainHookStub) NumberOfShards

func (b *BlockChainHookStub) NumberOfShards() uint32

NumberOfShards -

func (*BlockChainHookStub) ProcessBuiltInFunction

func (b *BlockChainHookStub) ProcessBuiltInFunction(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)

ProcessBuiltInFunction -

func (*BlockChainHookStub) RevertToSnapshot

func (b *BlockChainHookStub) RevertToSnapshot(snapshot int) error

RevertToSnapshot -

type EconomicsHandlerStub

type EconomicsHandlerStub struct {
	TotalSupplyCalled func() *big.Int
}

EconomicsHandlerStub -

func (*EconomicsHandlerStub) GenesisTotalSupply

func (v *EconomicsHandlerStub) GenesisTotalSupply() *big.Int

GenesisTotalSupply -

func (*EconomicsHandlerStub) IsInterfaceNil

func (v *EconomicsHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

type EpochNotifierStub

type EpochNotifierStub struct {
	CheckEpochCalled            func(epoch uint32)
	CurrentEpochCalled          func() uint32
	RegisterNotifyHandlerCalled func(handler core.EpochSubscriberHandler)
}

EpochNotifierStub -

func (*EpochNotifierStub) CheckEpoch

func (ens *EpochNotifierStub) CheckEpoch(epoch uint32)

CheckEpoch -

func (*EpochNotifierStub) CurrentEpoch

func (ens *EpochNotifierStub) CurrentEpoch() uint32

CurrentEpoch -

func (*EpochNotifierStub) IsInterfaceNil

func (ens *EpochNotifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*EpochNotifierStub) RegisterNotifyHandler

func (ens *EpochNotifierStub) RegisterNotifyHandler(handler core.EpochSubscriberHandler)

RegisterNotifyHandler -

type GasScheduleNotifierMock

type GasScheduleNotifierMock struct {
	GasSchedule map[string]map[string]uint64
}

GasScheduleNotifierMock -

func NewGasScheduleNotifierMock

func NewGasScheduleNotifierMock(gasSchedule map[string]map[string]uint64) *GasScheduleNotifierMock

NewGasScheduleNotifierMock -

func (*GasScheduleNotifierMock) IsInterfaceNil

func (g *GasScheduleNotifierMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*GasScheduleNotifierMock) LatestGasSchedule

func (g *GasScheduleNotifierMock) LatestGasSchedule() map[string]map[string]uint64

LatestGasSchedule -

func (*GasScheduleNotifierMock) RegisterNotifyHandler

func (g *GasScheduleNotifierMock) RegisterNotifyHandler(handler core.GasScheduleSubscribeHandler)

RegisterNotifyHandler -

func (*GasScheduleNotifierMock) UnRegisterAll

func (g *GasScheduleNotifierMock) UnRegisterAll()

UnRegisterAll -

type HasherMock

type HasherMock struct {
}

HasherMock that will be used for testing

func (HasherMock) Compute

func (sha HasherMock) Compute(s string) []byte

Compute will output the SHA's equivalent of the input string

func (HasherMock) EmptyHash

func (sha HasherMock) EmptyHash() []byte

EmptyHash will return the equivalent of empty string SHA's

func (HasherMock) IsInterfaceNil

func (sha HasherMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (HasherMock) Size

func (HasherMock) Size() int

Size returns the required size in bytes

type HasherStub

type HasherStub struct {
	ComputeCalled   func(s string) []byte
	EmptyHashCalled func() []byte
}

HasherStub -

func (*HasherStub) Compute

func (hash *HasherStub) Compute(s string) []byte

Compute -

func (*HasherStub) EmptyHash

func (hash *HasherStub) EmptyHash() []byte

EmptyHash -

func (*HasherStub) IsInterfaceNil

func (hash *HasherStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*HasherStub) Size

func (hash *HasherStub) Size() int

Size -

type KeyGenMock

type KeyGenMock struct {
	PublicKeyFromByteArrayCalled func(b []byte) (crypto.PublicKey, error)
}

KeyGenMock -

func (*KeyGenMock) CheckPublicKeyValid

func (keyGen *KeyGenMock) CheckPublicKeyValid(_ []byte) error

CheckPublicKeyValid -

func (*KeyGenMock) GeneratePair

func (keyGen *KeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)

GeneratePair -

func (*KeyGenMock) IsInterfaceNil

func (keyGen *KeyGenMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*KeyGenMock) PrivateKeyFromByteArray

func (keyGen *KeyGenMock) PrivateKeyFromByteArray(_ []byte) (crypto.PrivateKey, error)

PrivateKeyFromByteArray -

func (*KeyGenMock) PublicKeyFromByteArray

func (keyGen *KeyGenMock) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error)

PublicKeyFromByteArray -

func (*KeyGenMock) Suite

func (keyGen *KeyGenMock) Suite() crypto.Suite

Suite -

type MarshalizerMock

type MarshalizerMock struct {
	Fail bool
}

MarshalizerMock that will be used for testing

func (*MarshalizerMock) IsInterfaceNil

func (mm *MarshalizerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MarshalizerMock) Marshal

func (mm *MarshalizerMock) Marshal(obj interface{}) ([]byte, error)

Marshal converts the input object in a slice of bytes

func (*MarshalizerMock) Unmarshal

func (mm *MarshalizerMock) Unmarshal(obj interface{}, buff []byte) error

Unmarshal applies the serialized values over an instantiated object

type MarshalizerStub

type MarshalizerStub struct {
	MarshalCalled   func(obj interface{}) ([]byte, error)
	UnmarshalCalled func(obj interface{}, buff []byte) error
}

MarshalizerStub -

func (*MarshalizerStub) IsInterfaceNil

func (ms *MarshalizerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*MarshalizerStub) Marshal

func (ms *MarshalizerStub) Marshal(obj interface{}) ([]byte, error)

Marshal -

func (*MarshalizerStub) Unmarshal

func (ms *MarshalizerStub) Unmarshal(obj interface{}, buff []byte) error

Unmarshal -

type MessageSignVerifierMock

type MessageSignVerifierMock struct {
	VerifyCalled func(message []byte, signedMessage []byte, pubKey []byte) error
}

MessageSignVerifierMock -

func (*MessageSignVerifierMock) IsInterfaceNil

func (m *MessageSignVerifierMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*MessageSignVerifierMock) Verify

func (m *MessageSignVerifierMock) Verify(message []byte, signedMessage []byte, pubKey []byte) error

Verify -

type NodesConfigProviderStub

type NodesConfigProviderStub struct {
	MinNumberOfNodesCalled               func() uint32
	MinNumberOfNodesWithHysteresisCalled func() uint32
}

NodesConfigProviderStub -

func (*NodesConfigProviderStub) IsInterfaceNil

func (n *NodesConfigProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*NodesConfigProviderStub) MinNumberOfNodes

func (n *NodesConfigProviderStub) MinNumberOfNodes() uint32

MinNumberOfNodes -

func (*NodesConfigProviderStub) MinNumberOfNodesWithHysteresis

func (n *NodesConfigProviderStub) MinNumberOfNodesWithHysteresis() uint32

MinNumberOfNodesWithHysteresis -

type PubkeyConverterMock

type PubkeyConverterMock struct {
	// contains filtered or unexported fields
}

PubkeyConverterMock -

func NewPubkeyConverterMock

func NewPubkeyConverterMock(addressLen int) *PubkeyConverterMock

NewPubkeyConverterMock -

func (*PubkeyConverterMock) Decode

func (pcm *PubkeyConverterMock) Decode(humanReadable string) ([]byte, error)

Decode -

func (*PubkeyConverterMock) Encode

func (pcm *PubkeyConverterMock) Encode(pkBytes []byte) string

Encode -

func (*PubkeyConverterMock) IsInterfaceNil

func (pcm *PubkeyConverterMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*PubkeyConverterMock) Len

func (pcm *PubkeyConverterMock) Len() int

Len -

type PublicKeyMock

type PublicKeyMock struct {
}

PublicKeyMock mocks a public key implementation

func (*PublicKeyMock) IsInterfaceNil

func (pubKey *PublicKeyMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PublicKeyMock) Point

func (pubKey *PublicKeyMock) Point() crypto.Point

Point -

func (*PublicKeyMock) Suite

func (pubKey *PublicKeyMock) Suite() crypto.Suite

Suite -

func (*PublicKeyMock) ToByteArray

func (pubKey *PublicKeyMock) ToByteArray() ([]byte, error)

ToByteArray mocks converting a public key to a byte array

type RaterMock

type RaterMock struct {
	ComputeRatingCalled  func(string, uint32) uint32
	GetRatingCalled      func(string) uint32
	GetStartRatingCalled func() uint32
	GetChancesCalled     func(uint32) uint32
}

RaterMock -

func (*RaterMock) ComputeRating

func (rm *RaterMock) ComputeRating(ratingOptionKey string, previousValue uint32) uint32

ComputeRating -

func (*RaterMock) GetChance

func (rm *RaterMock) GetChance(rating uint32) uint32

GetChance -

func (*RaterMock) GetRating

func (rm *RaterMock) GetRating(pk string) uint32

GetRating -

func (*RaterMock) GetStartRating

func (rm *RaterMock) GetStartRating() uint32

GetStartRating -

func (*RaterMock) IsInterfaceNil

func (rm *RaterMock) IsInterfaceNil() bool

IsInterfaceNil -

type ShardCoordinatorStub

type ShardCoordinatorStub struct {
	NumberOfShardsCalled          func() uint32
	ComputeIdCalled               func(address []byte) uint32
	SelfIdCalled                  func() uint32
	SameShardCalled               func(firstAddress, secondAddress []byte) bool
	CommunicationIdentifierCalled func(destShardID uint32) string
}

ShardCoordinatorStub -

func (*ShardCoordinatorStub) CommunicationIdentifier

func (coordinator *ShardCoordinatorStub) CommunicationIdentifier(destShardID uint32) string

CommunicationIdentifier -

func (*ShardCoordinatorStub) ComputeId

func (coordinator *ShardCoordinatorStub) ComputeId(address []byte) uint32

ComputeId -

func (*ShardCoordinatorStub) IsInterfaceNil

func (coordinator *ShardCoordinatorStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ShardCoordinatorStub) NumberOfShards

func (coordinator *ShardCoordinatorStub) NumberOfShards() uint32

NumberOfShards -

func (*ShardCoordinatorStub) SameShard

func (coordinator *ShardCoordinatorStub) SameShard(firstAddress, secondAddress []byte) bool

SameShard -

func (*ShardCoordinatorStub) SelfId

func (coordinator *ShardCoordinatorStub) SelfId() uint32

SelfId -

type SignerMock

type SignerMock struct {
	SignCalled   func(private crypto.PrivateKey, msg []byte) ([]byte, error)
	VerifyCalled func(public crypto.PublicKey, msg []byte, sig []byte) error
}

SignerMock -

func (*SignerMock) IsInterfaceNil

func (s *SignerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SignerMock) Sign

func (s *SignerMock) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)

Sign -

func (*SignerMock) Verify

func (s *SignerMock) Verify(public crypto.PublicKey, msg []byte, sig []byte) error

Verify -

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)
	AddReturnMessageCalled              func(msg string)
	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() vm.BlockchainHook
	CryptoHookCalled                    func() vmcommon.CryptoHook
	UseGasCalled                        func(gas uint64) error
	IsValidatorCalled                   func(blsKey []byte) bool
	StatusFromValidatorStatisticsCalled func(blsKey []byte) string
	ExecuteOnDestContextCalled          func(destination, sender []byte, value *big.Int, input []byte) (*vmcommon.VMOutput, error)
	DeploySystemSCCalled                func(baseContract []byte, newAddress []byte, caller []byte, initFunction string, value *big.Int, args [][]byte) (vmcommon.ReturnCode, error)
	GetStorageFromAddressCalled         func(address []byte, key []byte) []byte
	SetStorageForAddressCalled          func(address []byte, key []byte, value []byte)
	CanUnJailCalled                     func(blsKey []byte) bool
	IsBadRatingCalled                   func(blsKey []byte) bool
	SendGlobalSettingToAllCalled        func(sender []byte, input []byte)
	GetContractCalled                   func(address []byte) (vm.SystemSmartContract, error)
	GasLeftCalled                       func() uint64
	ReturnMessage                       string
}

SystemEIStub -

func (*SystemEIStub) AddCode

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

AddCode -

func (*SystemEIStub) AddReturnMessage

func (s *SystemEIStub) AddReturnMessage(msg string)

AddReturnMessage -

func (*SystemEIStub) AddTxValueToSmartContract

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

AddTxValueToSmartContract -

func (*SystemEIStub) BlockChainHook

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

BlockChainHook -

func (*SystemEIStub) CanUnJail

func (s *SystemEIStub) CanUnJail(blsKey []byte) bool

CanUnJail -

func (*SystemEIStub) CleanCache

func (s *SystemEIStub) CleanCache()

CleanCache -

func (*SystemEIStub) CreateVMOutput

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

CreateVMOutput -

func (*SystemEIStub) CryptoHook

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

CryptoHook -

func (*SystemEIStub) DeploySystemSC

func (s *SystemEIStub) DeploySystemSC(
	baseContract []byte,
	newAddress []byte,
	ownerAddress []byte,
	initFunction string,
	value *big.Int,
	input [][]byte,
) (vmcommon.ReturnCode, error)

DeploySystemSC -

func (*SystemEIStub) ExecuteOnDestContext

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

ExecuteOnDestContext -

func (*SystemEIStub) Finish

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

Finish -

func (*SystemEIStub) GasLeft

func (s *SystemEIStub) GasLeft() uint64

GasLeft -

func (*SystemEIStub) GetBalance

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

GetBalance -

func (*SystemEIStub) GetContract

func (s *SystemEIStub) GetContract(address []byte) (vm.SystemSmartContract, error)

GetContract -

func (*SystemEIStub) GetStorage

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

GetStorage -

func (*SystemEIStub) GetStorageFromAddress

func (s *SystemEIStub) GetStorageFromAddress(address []byte, key []byte) []byte

GetStorageFromAddress -

func (*SystemEIStub) IsBadRating

func (s *SystemEIStub) IsBadRating(blsKey []byte) bool

IsBadRating -

func (*SystemEIStub) IsInterfaceNil

func (s *SystemEIStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*SystemEIStub) IsValidator

func (s *SystemEIStub) IsValidator(blsKey []byte) bool

IsValidator -

func (*SystemEIStub) SelfDestruct

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

SelfDestruct -

func (*SystemEIStub) SendGlobalSettingToAll

func (s *SystemEIStub) SendGlobalSettingToAll(sender []byte, input []byte)

SendGlobalSettingToAll -

func (*SystemEIStub) SetGasProvided

func (s *SystemEIStub) SetGasProvided(_ uint64)

SetGasProvided -

func (*SystemEIStub) SetSCAddress

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

SetSCAddress -

func (*SystemEIStub) SetStorage

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

SetStorage -

func (*SystemEIStub) SetStorageForAddress

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

SetStorageForAddress -

func (*SystemEIStub) SetSystemSCContainer

func (s *SystemEIStub) SetSystemSCContainer(_ vm.SystemSCContainer) error

SetSystemSCContainer -

func (*SystemEIStub) StatusFromValidatorStatistics

func (s *SystemEIStub) StatusFromValidatorStatistics(blsKey []byte) string

StatusFromValidatorStatistics -

func (*SystemEIStub) Transfer

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

Transfer -

func (*SystemEIStub) UseGas

func (s *SystemEIStub) UseGas(gas uint64) error

UseGas -

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
}

SystemSCContainerStub -

func (*SystemSCContainerStub) Add

Add -

func (*SystemSCContainerStub) Get

Get -

func (*SystemSCContainerStub) IsInterfaceNil

func (s *SystemSCContainerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*SystemSCContainerStub) Keys

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

Keys -

func (*SystemSCContainerStub) Len

func (s *SystemSCContainerStub) Len() int

Len -

func (*SystemSCContainerStub) Remove

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

Remove -

func (*SystemSCContainerStub) Replace

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

Replace -

type SystemSCStub

type SystemSCStub struct {
	ExecuteCalled       func(args *vmcommon.ContractCallInput) vmcommon.ReturnCode
	SetNewGasCostCalled func(gasCost vm.GasCost)
}

SystemSCStub -

func (*SystemSCStub) CanUseContract

func (s *SystemSCStub) CanUseContract() bool

CanUseContract -

func (*SystemSCStub) Execute

Execute -

func (*SystemSCStub) IsInterfaceNil

func (s *SystemSCStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*SystemSCStub) SetNewGasCost

func (s *SystemSCStub) SetNewGasCost(gasCost vm.GasCost)

SetNewGasCost -

Jump to

Keyboard shortcuts

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