Versions in this module Expand all Collapse all v0 v0.0.1 Oct 18, 2022 Changes in this version + var ErrInvalidAddressLength = errors.New("invalid address length") + var ErrOperationNotPermitted = errors.New("operation not permitted") + func NewMultiShardsCoordinatorMock(nrShard uint32) *multipleShardsCoordinatorMock + func NewMultipleShardsCoordinatorMock() *multipleShardsCoordinatorMock + type Account struct + Address []byte + Balance *big.Int + Code []byte + CodeHash []byte + CodeMetadata []byte + DeveloperReward *big.Int + Nonce uint64 + OwnerAddress []byte + RootHash []byte + Storage map[string][]byte + Username []byte + func NewUserAccount(address []byte) *Account + func (a *Account) AccountDataHandler() vmcommon.AccountDataHandler + func (a *Account) AddToBalance(value *big.Int) error + func (a *Account) AddToDeveloperReward(value *big.Int) + func (a *Account) AddressBytes() []byte + func (a *Account) ChangeOwnerAddress(sender []byte, newAddress []byte) error + func (a *Account) ClaimDeveloperRewards(sender []byte) (*big.Int, error) + func (a *Account) ClearDataCaches() + func (a *Account) Clone() *Account + func (a *Account) DirtyData() map[string][]byte + func (a *Account) GetBalance() *big.Int + func (a *Account) GetCode() []byte + func (a *Account) GetCodeHash() []byte + func (a *Account) GetCodeMetadata() []byte + func (a *Account) GetDeveloperReward() *big.Int + func (a *Account) GetNonce() uint64 + func (a *Account) GetOwnerAddress() []byte + func (a *Account) GetRootHash() []byte + func (a *Account) GetUserName() []byte + func (a *Account) IncreaseNonce(nonce uint64) + func (a *Account) IsInterfaceNil() bool + func (a *Account) RetrieveValue(key []byte) ([]byte, error) + func (a *Account) SaveKeyValue(key []byte, value []byte) error + func (a *Account) SetBalance(balance int64) + func (a *Account) SetCode(code []byte) + func (a *Account) SetCodeAndMetadata(code []byte, codeMetadata *vmcommon.CodeMetadata) + func (a *Account) SetCodeHash(hash []byte) + func (a *Account) SetCodeMetadata(codeMetadata []byte) + func (a *Account) SetOwnerAddress(address []byte) + func (a *Account) SetRootHash(hash []byte) + func (a *Account) SetUserName(userName []byte) + func (a *Account) StorageValue(key string) []byte + func (a *Account) SubFromBalance(value *big.Int) error + type AccountWrapMock struct + MockValue int + SetCodeHashWithJournalCalled func(codeHash []byte) error + SetCodeWithJournalCalled func(codeHash []byte) error + SetNonceWithJournalCalled func(nonce uint64) error + func NewAccountWrapMock(adr []byte) *AccountWrapMock + func (awm *AccountWrapMock) AccountDataHandler() vmcommon.AccountDataHandler + func (awm *AccountWrapMock) AddToBalance(_ *big.Int) error + func (awm *AccountWrapMock) AddToDeveloperReward(*big.Int) + func (awm *AccountWrapMock) AddressBytes() []byte + func (awm *AccountWrapMock) ChangeOwnerAddress([]byte, []byte) error + func (awm *AccountWrapMock) ClaimDeveloperRewards([]byte) (*big.Int, error) + func (awm *AccountWrapMock) ClearDataCaches() + func (awm *AccountWrapMock) DirtyData() map[string][]byte + func (awm *AccountWrapMock) GetBalance() *big.Int + func (awm *AccountWrapMock) GetCodeHash() []byte + func (awm *AccountWrapMock) GetCodeMetadata() []byte + func (awm *AccountWrapMock) GetDeveloperReward() *big.Int + func (awm *AccountWrapMock) GetNonce() uint64 + func (awm *AccountWrapMock) GetOwnerAddress() []byte + func (awm *AccountWrapMock) GetRootHash() []byte + func (awm *AccountWrapMock) GetUserName() []byte + func (awm *AccountWrapMock) HasNewCode() bool + func (awm *AccountWrapMock) IncreaseNonce(val uint64) + func (awm *AccountWrapMock) IsInterfaceNil() bool + func (awm *AccountWrapMock) RetrieveValue(key []byte) ([]byte, error) + func (awm *AccountWrapMock) SaveKeyValue(key []byte, value []byte) error + func (awm *AccountWrapMock) SetCode(code []byte) + func (awm *AccountWrapMock) SetCodeHash(codeHash []byte) + func (awm *AccountWrapMock) SetCodeMetadata(codeMetadata []byte) + func (awm *AccountWrapMock) SetOwnerAddress([]byte) + func (awm *AccountWrapMock) SetRootHash(rootHash []byte) + func (awm *AccountWrapMock) SetUserName(_ []byte) + func (awm *AccountWrapMock) SubFromBalance(_ *big.Int) error + type AccountsStub struct + CommitCalled func() ([]byte, error) + GetCodeCalled func([]byte) []byte + GetExistingAccountCalled func(address []byte) (vmcommon.AccountHandler, error) + IsPruningEnabledCalled func() bool + JournalLenCalled func() int + LoadAccountCalled func(address []byte) (vmcommon.AccountHandler, error) + RecreateTrieCalled func(rootHash []byte) error + RemoveAccountCalled func(address []byte) error + RevertToSnapshotCalled func(snapshot int) error + RootHashCalled func() ([]byte, error) + SaveAccountCalled func(account vmcommon.AccountHandler) error + SetStateCheckpointCalled func(rootHash []byte) + SnapshotStateCalled func(rootHash []byte) + func (as *AccountsStub) Commit() ([]byte, error) + func (as *AccountsStub) GetCode(codeHash []byte) []byte + func (as *AccountsStub) GetExistingAccount(address []byte) (vmcommon.AccountHandler, error) + func (as *AccountsStub) IsInterfaceNil() bool + func (as *AccountsStub) IsPruningEnabled() bool + func (as *AccountsStub) JournalLen() int + func (as *AccountsStub) LoadAccount(address []byte) (vmcommon.AccountHandler, 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 vmcommon.AccountHandler) error + func (as *AccountsStub) SetStateCheckpoint(rootHash []byte, _ context.Context) + func (as *AccountsStub) SnapshotState(rootHash []byte, _ context.Context) + type BuiltInFunctionStub struct + IsActiveCalled func() bool + ProcessBuiltinFunctionCalled func(acntSnd, acntDst vmcommon.UserAccountHandler, ...) (*vmcommon.VMOutput, error) + SetNewGasConfigCalled func(gasCost *vmcommon.GasCost) + func (b *BuiltInFunctionStub) IsActive() bool + func (b *BuiltInFunctionStub) IsInterfaceNil() bool + func (b *BuiltInFunctionStub) ProcessBuiltinFunction(acntSnd, acntDst vmcommon.UserAccountHandler, ...) (*vmcommon.VMOutput, error) + func (b *BuiltInFunctionStub) SetNewGasConfig(gasCost *vmcommon.GasCost) + type DataTrieTrackerStub struct + ClearDataCachesCalled func() + DirtyDataCalled func() map[string][]byte + RetrieveValueCalled func(key []byte) ([]byte, error) + SaveKeyValueCalled func(key []byte, value []byte) error + func (dtts *DataTrieTrackerStub) ClearDataCaches() + func (dtts *DataTrieTrackerStub) DirtyData() map[string][]byte + func (dtts *DataTrieTrackerStub) IsInterfaceNil() bool + func (dtts *DataTrieTrackerStub) RetrieveValue(key []byte) ([]byte, error) + func (dtts *DataTrieTrackerStub) SaveKeyValue(key []byte, value []byte) error + type EpochNotifierStub struct + CurrentEpochCalled func() uint32 + RegisterNotifyHandlerCalled func(handler vmcommon.EpochSubscriberHandler) + func (ens *EpochNotifierStub) IsInterfaceNil() bool + func (ens *EpochNotifierStub) RegisterNotifyHandler(handler vmcommon.EpochSubscriberHandler) + type GlobalSettingsHandlerStub struct + IsBurnForAllCalled func(token []byte) bool + IsLimiterTransferCalled func(token []byte) bool + IsPausedCalled func(token []byte) bool + IsSenderOrDestinationWithTransferRoleCalled func(sender, destionation, tokenID []byte) bool + func (p *GlobalSettingsHandlerStub) IsBurnForAll(token []byte) bool + func (p *GlobalSettingsHandlerStub) IsInterfaceNil() bool + func (p *GlobalSettingsHandlerStub) IsLimitedTransfer(token []byte) bool + func (p *GlobalSettingsHandlerStub) IsPaused(token []byte) bool + func (p *GlobalSettingsHandlerStub) IsSenderOrDestinationWithTransferRole(sender, destination, tokenID []byte) bool + type MECTRoleHandlerStub struct + CheckAllowedToExecuteCalled func(account vmcommon.UserAccountHandler, tokenID []byte, action []byte) error + func (e *MECTRoleHandlerStub) CheckAllowedToExecute(account vmcommon.UserAccountHandler, tokenID []byte, action []byte) error + func (e *MECTRoleHandlerStub) IsInterfaceNil() bool + 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 PayableHandlerStub struct + CheckPayableCalled func(vmInput *vmcommon.ContractCallInput, dstAddress []byte, minArgs int) error + DetermineIsSCCallAfterCalled func(vmInput *vmcommon.ContractCallInput, dstAddress []byte, mintArgs int) bool + IsPayableCalled func(address []byte) (bool, error) + func (p *PayableHandlerStub) CheckPayable(vmInput *vmcommon.ContractCallInput, dstAddress []byte, minArgs int) error + func (p *PayableHandlerStub) DetermineIsSCCallAfter(vmInput *vmcommon.ContractCallInput, dstAddress []byte, minArgs int) bool + func (p *PayableHandlerStub) IsInterfaceNil() bool + func (p *PayableHandlerStub) IsPayable(_, address []byte) (bool, error) + 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 UserAccountStub struct + AccountDataHandlerCalled func() vmcommon.AccountDataHandler + AddToBalanceCalled func(value *big.Int) error + func (u *UserAccountStub) AccountDataHandler() vmcommon.AccountDataHandler + func (u *UserAccountStub) AddToBalance(value *big.Int) error + func (u *UserAccountStub) AddToDeveloperReward(*big.Int) + func (u *UserAccountStub) AddressBytes() []byte + func (u *UserAccountStub) ChangeOwnerAddress([]byte, []byte) error + func (u *UserAccountStub) ClaimDeveloperRewards([]byte) (*big.Int, error) + func (u *UserAccountStub) GetBalance() *big.Int + func (u *UserAccountStub) GetCodeHash() []byte + func (u *UserAccountStub) GetCodeMetadata() []byte + func (u *UserAccountStub) GetDeveloperReward() *big.Int + func (u *UserAccountStub) GetNonce() uint64 + func (u *UserAccountStub) GetOwnerAddress() []byte + func (u *UserAccountStub) GetRootHash() []byte + func (u *UserAccountStub) GetUserName() []byte + func (u *UserAccountStub) HasNewCode() bool + func (u *UserAccountStub) IncreaseNonce(_ uint64) + func (u *UserAccountStub) IsInterfaceNil() bool + func (u *UserAccountStub) SetCode(_ []byte) + func (u *UserAccountStub) SetCodeHash(_ []byte) + func (u *UserAccountStub) SetCodeMetadata(_ []byte) + func (u *UserAccountStub) SetOwnerAddress([]byte) + func (u *UserAccountStub) SetRootHash(_ []byte) + func (u *UserAccountStub) SetUserName(_ []byte) + func (u *UserAccountStub) SubFromBalance(_ *big.Int) error