Versions in this module Expand all Collapse all v1 v1.1.66 Jun 17, 2021 v1.1.65 Jun 17, 2021 Changes in this version + var ErrMockMarshalizer = errors.New("MarshalizerMock generic error") + type AccountsStub struct + AddJournalEntryCalled func(je state.JournalEntry) + CancelPruneCalled func(rootHash []byte, identifier data.TriePruningIdentifier) + CommitCalled func() ([]byte, error) + GetAllLeavesCalled func(rootHash []byte) (chan core.KeyValueHolder, error) + GetCodeCalled func([]byte) []byte + GetExistingAccountCalled func(address []byte) (state.AccountHandler, error) + GetNumCheckpointsCalled func() uint32 + IsLowRatingCalled func(blsKey []byte) bool + IsPruningEnabledCalled func() bool + JournalLenCalled func() int + LoadAccountCalled func(address []byte) (state.AccountHandler, error) + PruneTrieCalled func(rootHash []byte, identifier data.TriePruningIdentifier) + RecreateAllTriesCalled func(rootHash []byte) (map[string]data.Trie, error) + RecreateTrieCalled func(rootHash []byte) error + RemoveAccountCalled func(address []byte) error + RevertToSnapshotCalled func(snapshot int) error + RootHashCalled func() ([]byte, error) + SaveAccountCalled func(account state.AccountHandler) error + SetStateCheckpointCalled func(rootHash []byte) + SnapshotStateCalled func(rootHash []byte) + func (as *AccountsStub) AddJournalEntry(je state.JournalEntry) + func (as *AccountsStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier) + func (as *AccountsStub) Commit() ([]byte, error) + func (as *AccountsStub) GetAllLeaves(rootHash []byte, _ context.Context) (chan core.KeyValueHolder, error) + func (as *AccountsStub) GetCode(codeHash []byte) []byte + func (as *AccountsStub) GetExistingAccount(address []byte) (state.AccountHandler, error) + func (as *AccountsStub) GetNumCheckpoints() uint32 + func (as *AccountsStub) IsInterfaceNil() bool + func (as *AccountsStub) IsLowRating(blsKey []byte) bool + func (as *AccountsStub) IsPruningEnabled() bool + func (as *AccountsStub) JournalLen() int + func (as *AccountsStub) LoadAccount(address []byte) (state.AccountHandler, error) + func (as *AccountsStub) PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier) + func (as *AccountsStub) RecreateAllTries(rootHash []byte, _ context.Context) (map[string]data.Trie, error) + func (as *AccountsStub) RecreateTrie(rootHash []byte) error + func (as *AccountsStub) RemoveAccount(address []byte) error + func (as *AccountsStub) RevertToSnapshot(snapshot int) error + func (as *AccountsStub) RootHash() ([]byte, error) + func (as *AccountsStub) SaveAccount(account state.AccountHandler) error + func (as *AccountsStub) SetStateCheckpoint(rootHash []byte, _ context.Context) + func (as *AccountsStub) SnapshotState(rootHash []byte, _ context.Context) + type ArgumentParserMock struct + CreateDataFromStorageUpdateCalled func(storageUpdates []*vmcommon.StorageUpdate) string + GetStorageUpdatesCalled func(data string) ([]*vmcommon.StorageUpdate, error) + ParseCallDataCalled func(data string) (string, [][]byte, error) + ParseDeployDataCalled func(data string) (*parsers.DeployArgs, error) + func (ap *ArgumentParserMock) CreateDataFromStorageUpdate(storageUpdates []*vmcommon.StorageUpdate) string + func (ap *ArgumentParserMock) GetStorageUpdates(data string) ([]*vmcommon.StorageUpdate, error) + func (ap *ArgumentParserMock) IsInterfaceNil() bool + func (ap *ArgumentParserMock) ParseCallData(data string) (string, [][]byte, error) + func (ap *ArgumentParserMock) ParseData(data string) (string, [][]byte, error) + func (ap *ArgumentParserMock) ParseDeployData(data string) (*parsers.DeployArgs, error) + type BlockChainHookStub struct + AccountExtistsCalled func(address []byte) (bool, error) + CurrentEpochCalled func() uint32 + CurrentNonceCalled func() uint64 + CurrentRandomSeedCalled func() []byte + CurrentRoundCalled func() uint64 + CurrentTimeStampCalled func() uint64 + GetAllStateCalled func(address []byte) (map[string][]byte, error) + GetBlockHashCalled func(nonce uint64) ([]byte, error) + GetBuiltinFunctionNamesCalled func() vmcommon.FunctionNames + GetCodeCalled func(account vmcommon.UserAccountHandler) []byte + GetShardOfAddressCalled func(address []byte) uint32 + GetSnapshotCalled func() int + GetStateRootHashCalled func() []byte + GetStorageDataCalled func(accountsAddress []byte, index []byte) ([]byte, error) + GetUserAccountCalled func(address []byte) (vmcommon.UserAccountHandler, error) + IsPayableCalled func(address []byte) (bool, error) + IsSmartContractCalled func(address []byte) bool + LastEpochCalled func() uint32 + LastNonceCalled func() uint64 + LastRandomSeedCalled func() []byte + LastRoundCalled func() uint64 + LastTimeStampCalled func() uint64 + NewAddressCalled func(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error) + NumberOfShardsCalled func() uint32 + ProcessBuiltInFunctionCalled func(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error) + RevertToSnapshotCalled func(snapshot int) error + func (b *BlockChainHookStub) AccountExists(address []byte) (bool, error) + func (b *BlockChainHookStub) CurrentEpoch() uint32 + func (b *BlockChainHookStub) CurrentNonce() uint64 + func (b *BlockChainHookStub) CurrentRandomSeed() []byte + func (b *BlockChainHookStub) CurrentRound() uint64 + func (b *BlockChainHookStub) CurrentTimeStamp() uint64 + func (b *BlockChainHookStub) GetAllState(address []byte) (map[string][]byte, error) + func (b *BlockChainHookStub) GetBlockhash(nonce uint64) ([]byte, error) + func (b *BlockChainHookStub) GetBuiltinFunctionNames() vmcommon.FunctionNames + func (b *BlockChainHookStub) GetCode(account vmcommon.UserAccountHandler) []byte + func (b *BlockChainHookStub) GetShardOfAddress(address []byte) uint32 + func (b *BlockChainHookStub) GetSnapshot() int + func (b *BlockChainHookStub) GetStateRootHash() []byte + func (b *BlockChainHookStub) GetStorageData(accountAddress []byte, index []byte) ([]byte, error) + func (b *BlockChainHookStub) GetUserAccount(address []byte) (vmcommon.UserAccountHandler, error) + func (b *BlockChainHookStub) IsPayable(address []byte) (bool, error) + func (b *BlockChainHookStub) IsSmartContract(address []byte) bool + func (b *BlockChainHookStub) LastEpoch() uint32 + func (b *BlockChainHookStub) LastNonce() uint64 + func (b *BlockChainHookStub) LastRandomSeed() []byte + func (b *BlockChainHookStub) LastRound() uint64 + func (b *BlockChainHookStub) LastTimeStamp() uint64 + func (b *BlockChainHookStub) NewAddress(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error) + func (b *BlockChainHookStub) NumberOfShards() uint32 + func (b *BlockChainHookStub) ProcessBuiltInFunction(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error) + func (b *BlockChainHookStub) RevertToSnapshot(snapshot int) error + type EconomicsHandlerStub struct + TotalSupplyCalled func() *big.Int + func (v *EconomicsHandlerStub) GenesisTotalSupply() *big.Int + func (v *EconomicsHandlerStub) IsInterfaceNil() bool + type EpochNotifierStub struct + CheckEpochCalled func(epoch uint32) + CurrentEpochCalled func() uint32 + RegisterNotifyHandlerCalled func(handler core.EpochSubscriberHandler) + func (ens *EpochNotifierStub) CheckEpoch(epoch uint32) + func (ens *EpochNotifierStub) CurrentEpoch() uint32 + func (ens *EpochNotifierStub) IsInterfaceNil() bool + func (ens *EpochNotifierStub) RegisterNotifyHandler(handler core.EpochSubscriberHandler) + type GasScheduleNotifierMock struct + GasSchedule map[string]map[string]uint64 + func NewGasScheduleNotifierMock(gasSchedule map[string]map[string]uint64) *GasScheduleNotifierMock + func (g *GasScheduleNotifierMock) IsInterfaceNil() bool + func (g *GasScheduleNotifierMock) LatestGasSchedule() map[string]map[string]uint64 + func (g *GasScheduleNotifierMock) RegisterNotifyHandler(handler core.GasScheduleSubscribeHandler) + func (g *GasScheduleNotifierMock) UnRegisterAll() + type HasherMock struct + func (HasherMock) Size() int + func (sha HasherMock) Compute(s string) []byte + func (sha HasherMock) EmptyHash() []byte + func (sha HasherMock) IsInterfaceNil() bool + type HasherStub struct + ComputeCalled func(s string) []byte + EmptyHashCalled func() []byte + func (hash *HasherStub) Compute(s string) []byte + func (hash *HasherStub) EmptyHash() []byte + func (hash *HasherStub) IsInterfaceNil() bool + func (hash *HasherStub) Size() int + type KeyGenMock struct + PublicKeyFromByteArrayCalled func(b []byte) (crypto.PublicKey, error) + func (keyGen *KeyGenMock) CheckPublicKeyValid(_ []byte) error + func (keyGen *KeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey) + func (keyGen *KeyGenMock) IsInterfaceNil() bool + func (keyGen *KeyGenMock) PrivateKeyFromByteArray(_ []byte) (crypto.PrivateKey, error) + func (keyGen *KeyGenMock) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error) + func (keyGen *KeyGenMock) Suite() crypto.Suite + type MarshalizerMock struct + Fail bool + func (mm *MarshalizerMock) IsInterfaceNil() bool + func (mm *MarshalizerMock) Marshal(obj interface{}) ([]byte, error) + func (mm *MarshalizerMock) Unmarshal(obj interface{}, buff []byte) error + type MarshalizerStub struct + MarshalCalled func(obj interface{}) ([]byte, error) + UnmarshalCalled func(obj interface{}, buff []byte) error + func (ms *MarshalizerStub) IsInterfaceNil() bool + func (ms *MarshalizerStub) Marshal(obj interface{}) ([]byte, error) + func (ms *MarshalizerStub) Unmarshal(obj interface{}, buff []byte) error + type MessageSignVerifierMock struct + VerifyCalled func(message []byte, signedMessage []byte, pubKey []byte) error + func (m *MessageSignVerifierMock) IsInterfaceNil() bool + func (m *MessageSignVerifierMock) Verify(message []byte, signedMessage []byte, pubKey []byte) error + type NodesConfigProviderStub struct + MinNumberOfNodesCalled func() uint32 + MinNumberOfNodesWithHysteresisCalled func() uint32 + func (n *NodesConfigProviderStub) IsInterfaceNil() bool + func (n *NodesConfigProviderStub) MinNumberOfNodes() uint32 + func (n *NodesConfigProviderStub) MinNumberOfNodesWithHysteresis() uint32 + type PubkeyConverterMock struct + func NewPubkeyConverterMock(addressLen int) *PubkeyConverterMock + func (pcm *PubkeyConverterMock) Decode(humanReadable string) ([]byte, error) + func (pcm *PubkeyConverterMock) Encode(pkBytes []byte) string + func (pcm *PubkeyConverterMock) IsInterfaceNil() bool + func (pcm *PubkeyConverterMock) Len() int + type PublicKeyMock struct + func (pubKey *PublicKeyMock) IsInterfaceNil() bool + func (pubKey *PublicKeyMock) Point() crypto.Point + func (pubKey *PublicKeyMock) Suite() crypto.Suite + func (pubKey *PublicKeyMock) ToByteArray() ([]byte, error) + type RaterMock struct + ComputeRatingCalled func(string, uint32) uint32 + GetChancesCalled func(uint32) uint32 + GetRatingCalled func(string) uint32 + GetStartRatingCalled func() uint32 + func (rm *RaterMock) ComputeRating(ratingOptionKey string, previousValue uint32) uint32 + func (rm *RaterMock) GetChance(rating uint32) uint32 + func (rm *RaterMock) GetRating(pk string) uint32 + func (rm *RaterMock) GetStartRating() uint32 + func (rm *RaterMock) IsInterfaceNil() bool + type ShardCoordinatorStub struct + CommunicationIdentifierCalled func(destShardID uint32) string + ComputeIdCalled func(address []byte) uint32 + NumberOfShardsCalled func() uint32 + SameShardCalled func(firstAddress, secondAddress []byte) bool + SelfIdCalled func() uint32 + func (coordinator *ShardCoordinatorStub) CommunicationIdentifier(destShardID uint32) string + func (coordinator *ShardCoordinatorStub) ComputeId(address []byte) uint32 + func (coordinator *ShardCoordinatorStub) IsInterfaceNil() bool + func (coordinator *ShardCoordinatorStub) NumberOfShards() uint32 + func (coordinator *ShardCoordinatorStub) SameShard(firstAddress, secondAddress []byte) bool + func (coordinator *ShardCoordinatorStub) SelfId() uint32 + type SignerMock struct + SignCalled func(private crypto.PrivateKey, msg []byte) ([]byte, error) + VerifyCalled func(public crypto.PublicKey, msg []byte, sig []byte) error + func (s *SignerMock) IsInterfaceNil() bool + func (s *SignerMock) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error) + func (s *SignerMock) Verify(public crypto.PublicKey, msg []byte, sig []byte) error + type SystemEIStub struct + AddCodeCalled func(addr []byte, code []byte) + AddReturnMessageCalled func(msg string) + AddTxValueToSmartContractCalled func(value *big.Int, scAddress []byte) + BlockChainHookCalled func() vm.BlockchainHook + CanUnJailCalled func(blsKey []byte) bool + CleanCacheCalled func() + CreateVMOutputCalled func() *vmcommon.VMOutput + CryptoHookCalled func() vmcommon.CryptoHook + DeploySystemSCCalled func(baseContract []byte, newAddress []byte, caller []byte, initFunction string, ...) (vmcommon.ReturnCode, error) + ExecuteOnDestContextCalled func(destination, sender []byte, value *big.Int, input []byte) (*vmcommon.VMOutput, error) + FinishCalled func(value []byte) + GasLeftCalled func() uint64 + GetBalanceCalled func(addr []byte) *big.Int + GetContractCalled func(address []byte) (vm.SystemSmartContract, error) + GetStorageCalled func(key []byte) []byte + GetStorageFromAddressCalled func(address []byte, key []byte) []byte + IsBadRatingCalled func(blsKey []byte) bool + IsValidatorCalled func(blsKey []byte) bool + ReturnMessage string + SelfDestructCalled func(beneficiary []byte) + SendGlobalSettingToAllCalled func(sender []byte, input []byte) + SetStorageCalled func(key []byte, value []byte) + SetStorageForAddressCalled func(address []byte, key []byte, value []byte) + StatusFromValidatorStatisticsCalled func(blsKey []byte) string + TransferCalled func(destination []byte, sender []byte, value *big.Int, input []byte) error + UseGasCalled func(gas uint64) error + func (s *SystemEIStub) AddCode(addr []byte, code []byte) + func (s *SystemEIStub) AddReturnMessage(msg string) + func (s *SystemEIStub) AddTxValueToSmartContract(value *big.Int, scAddress []byte) + func (s *SystemEIStub) BlockChainHook() vm.BlockchainHook + func (s *SystemEIStub) CanUnJail(blsKey []byte) bool + func (s *SystemEIStub) CleanCache() + func (s *SystemEIStub) CreateVMOutput() *vmcommon.VMOutput + func (s *SystemEIStub) CryptoHook() vmcommon.CryptoHook + func (s *SystemEIStub) DeploySystemSC(baseContract []byte, newAddress []byte, ownerAddress []byte, ...) (vmcommon.ReturnCode, error) + func (s *SystemEIStub) ExecuteOnDestContext(destination []byte, sender []byte, value *big.Int, input []byte) (*vmcommon.VMOutput, error) + func (s *SystemEIStub) Finish(value []byte) + func (s *SystemEIStub) GasLeft() uint64 + func (s *SystemEIStub) GetBalance(addr []byte) *big.Int + func (s *SystemEIStub) GetContract(address []byte) (vm.SystemSmartContract, error) + func (s *SystemEIStub) GetStorage(key []byte) []byte + func (s *SystemEIStub) GetStorageFromAddress(address []byte, key []byte) []byte + func (s *SystemEIStub) IsBadRating(blsKey []byte) bool + func (s *SystemEIStub) IsInterfaceNil() bool + func (s *SystemEIStub) IsValidator(blsKey []byte) bool + func (s *SystemEIStub) SelfDestruct(beneficiary []byte) + func (s *SystemEIStub) SendGlobalSettingToAll(sender []byte, input []byte) + func (s *SystemEIStub) SetGasProvided(_ uint64) + func (s *SystemEIStub) SetSCAddress(_ []byte) + func (s *SystemEIStub) SetStorage(key []byte, value []byte) + func (s *SystemEIStub) SetStorageForAddress(address []byte, key []byte, value []byte) + func (s *SystemEIStub) SetSystemSCContainer(_ vm.SystemSCContainer) error + func (s *SystemEIStub) StatusFromValidatorStatistics(blsKey []byte) string + func (s *SystemEIStub) Transfer(destination []byte, sender []byte, value *big.Int, input []byte, _ uint64) error + func (s *SystemEIStub) UseGas(gas uint64) error + type SystemSCContainerStub struct + AddCalled func(key []byte, val vm.SystemSmartContract) error + GetCalled func(key []byte) (vm.SystemSmartContract, error) + KeysCalled func() [][]byte + LenCalled func() int + RemoveCalled func(key []byte) + ReplaceCalled func(key []byte, val vm.SystemSmartContract) error + func (s *SystemSCContainerStub) Add(key []byte, val vm.SystemSmartContract) error + func (s *SystemSCContainerStub) Get(key []byte) (vm.SystemSmartContract, error) + func (s *SystemSCContainerStub) IsInterfaceNil() bool + func (s *SystemSCContainerStub) Keys() [][]byte + func (s *SystemSCContainerStub) Len() int + func (s *SystemSCContainerStub) Remove(key []byte) + func (s *SystemSCContainerStub) Replace(key []byte, val vm.SystemSmartContract) error + type SystemSCStub struct + ExecuteCalled func(args *vmcommon.ContractCallInput) vmcommon.ReturnCode + SetNewGasCostCalled func(gasCost vm.GasCost) + func (s *SystemSCStub) CanUseContract() bool + func (s *SystemSCStub) Execute(args *vmcommon.ContractCallInput) vmcommon.ReturnCode + func (s *SystemSCStub) IsInterfaceNil() bool + func (s *SystemSCStub) SetNewGasCost(gasCost vm.GasCost)