Documentation ¶
Index ¶
- type ArgumentParserMock
- func (ap *ArgumentParserMock) CreateDataFromStorageUpdate(storageUpdates []*vmcommon.StorageUpdate) string
- func (ap *ArgumentParserMock) GetArguments() ([][]byte, error)
- func (ap *ArgumentParserMock) GetCode() ([]byte, error)
- func (ap *ArgumentParserMock) GetFunction() (string, error)
- func (ap *ArgumentParserMock) GetSeparator() string
- func (ap *ArgumentParserMock) GetStorageUpdates(data string) ([]*vmcommon.StorageUpdate, error)
- func (ap *ArgumentParserMock) IsInterfaceNil() bool
- func (ap *ArgumentParserMock) ParseData(data string) error
- type BlockChainHookStub
- 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) GetBalance(address []byte) (*big.Int, error)
- func (b *BlockChainHookStub) GetBlockhash(nonce uint64) ([]byte, error)
- func (b *BlockChainHookStub) GetCode(address []byte) ([]byte, error)
- func (b *BlockChainHookStub) GetNonce(address []byte) (uint64, error)
- func (b *BlockChainHookStub) GetStateRootHash() []byte
- func (b *BlockChainHookStub) GetStorageData(accountAddress []byte, index []byte) ([]byte, error)
- func (b *BlockChainHookStub) IsCodeEmpty(address []byte) (bool, error)
- 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)
- type KeyGenMock
- 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 MessageSignVerifierMock
- type PublicKeyMock
- type SignerMock
- type SystemEIStub
- func (s *SystemEIStub) AddCode(addr []byte, code []byte)
- func (s *SystemEIStub) AddTxValueToSmartContract(value *big.Int, scAddress []byte)
- func (s *SystemEIStub) BlockChainHook() vmcommon.BlockchainHook
- func (s *SystemEIStub) CleanCache()
- func (s *SystemEIStub) CreateVMOutput() *vmcommon.VMOutput
- func (s *SystemEIStub) CryptoHook() vmcommon.CryptoHook
- func (s *SystemEIStub) ExecuteOnDestContext(_ []byte, _ []byte, _ *big.Int, _ []byte) (*vmcommon.VMOutput, error)
- func (s *SystemEIStub) Finish(value []byte)
- func (s *SystemEIStub) GetBalance(addr []byte) *big.Int
- func (s *SystemEIStub) GetStorage(key []byte) []byte
- func (s *SystemEIStub) IsInterfaceNil() bool
- func (s *SystemEIStub) SelfDestruct(beneficiary []byte)
- func (s *SystemEIStub) SetGasProvided(_ uint64)
- func (s *SystemEIStub) SetSCAddress(_ []byte)
- func (s *SystemEIStub) SetStorage(key []byte, value []byte)
- func (s *SystemEIStub) SetSystemSCContainer(_ vm.SystemSCContainer) error
- func (s *SystemEIStub) Transfer(destination []byte, sender []byte, value *big.Int, input []byte) error
- func (s *SystemEIStub) UseGas(_ uint64) error
- type SystemSCContainerStub
- 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
- type ValidatorSettingsStub
- func (v *ValidatorSettingsStub) AuctionEnableNonce() uint64
- func (v *ValidatorSettingsStub) BleedPercentagePerRound() float64
- func (v *ValidatorSettingsStub) GenesisNodePrice() *big.Int
- func (v *ValidatorSettingsStub) IsInterfaceNil() bool
- func (v *ValidatorSettingsStub) MaximumPercentageToBleed() float64
- func (v *ValidatorSettingsStub) MinStepValue() *big.Int
- func (v *ValidatorSettingsStub) NumNodes() uint32
- func (v *ValidatorSettingsStub) NumRoundsWithoutBleed() uint64
- func (v *ValidatorSettingsStub) StakeEnableNonce() uint64
- func (v *ValidatorSettingsStub) TotalSupply() *big.Int
- func (v *ValidatorSettingsStub) UnBondPeriod() uint64
- func (v *ValidatorSettingsStub) UnJailValue() *big.Int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgumentParserMock ¶
type ArgumentParserMock struct { ParseDataCalled func(data string) error GetArgumentsCalled func() ([][]byte, error) GetCodeCalled func() ([]byte, error) GetFunctionCalled func() (string, error) GetSeparatorCalled func() string 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) GetArguments ¶
func (ap *ArgumentParserMock) GetArguments() ([][]byte, error)
GetArguments -
func (*ArgumentParserMock) GetCode ¶
func (ap *ArgumentParserMock) GetCode() ([]byte, error)
GetCode -
func (*ArgumentParserMock) GetFunction ¶
func (ap *ArgumentParserMock) GetFunction() (string, error)
GetFunction -
func (*ArgumentParserMock) GetSeparator ¶
func (ap *ArgumentParserMock) GetSeparator() string
GetSeparator -
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) ParseData ¶
func (ap *ArgumentParserMock) ParseData(data string) error
ParseData -
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 }
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) GetBalance ¶
func (b *BlockChainHookStub) GetBalance(address []byte) (*big.Int, error)
GetBalance -
func (*BlockChainHookStub) GetBlockhash ¶
func (b *BlockChainHookStub) GetBlockhash(nonce uint64) ([]byte, error)
GetBlockhash -
func (*BlockChainHookStub) GetCode ¶
func (b *BlockChainHookStub) GetCode(address []byte) ([]byte, error)
GetCode -
func (*BlockChainHookStub) GetNonce ¶
func (b *BlockChainHookStub) GetNonce(address []byte) (uint64, error)
GetNonce -
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) IsCodeEmpty ¶
func (b *BlockChainHookStub) IsCodeEmpty(address []byte) (bool, error)
IsCodeEmpty -
func (*BlockChainHookStub) LastRandomSeed ¶
func (b *BlockChainHookStub) LastRandomSeed() []byte
LastRandomSeed -
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 -
type KeyGenMock ¶
KeyGenMock -
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 -
type MessageSignVerifierMock ¶
type MessageSignVerifierMock struct {
VerifyCalled func(message []byte, signedMessage []byte, pubKey []byte) error
}
MessageSignVerifierMock -
func (*MessageSignVerifierMock) IsInterfaceNil ¶
func (m *MessageSignVerifierMock) IsInterfaceNil() bool
IsInterfaceNil -
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) ToByteArray ¶
func (pubKey *PublicKeyMock) ToByteArray() ([]byte, error)
ToByteArray mocks converting a public key to a byte array
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 -
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 }
SystemEIStub -
func (*SystemEIStub) AddTxValueToSmartContract ¶
func (s *SystemEIStub) AddTxValueToSmartContract(value *big.Int, scAddress []byte)
AddTxValueToSmartContract -
func (*SystemEIStub) BlockChainHook ¶
func (s *SystemEIStub) BlockChainHook() vmcommon.BlockchainHook
BlockChainHook -
func (*SystemEIStub) CreateVMOutput ¶
func (s *SystemEIStub) CreateVMOutput() *vmcommon.VMOutput
CreateVMOutput -
func (*SystemEIStub) CryptoHook ¶
func (s *SystemEIStub) CryptoHook() vmcommon.CryptoHook
CryptoHook -
func (*SystemEIStub) ExecuteOnDestContext ¶
func (s *SystemEIStub) ExecuteOnDestContext(_ []byte, _ []byte, _ *big.Int, _ []byte) (*vmcommon.VMOutput, error)
ExecuteOnDestContext -
func (*SystemEIStub) GetBalance ¶
func (s *SystemEIStub) GetBalance(addr []byte) *big.Int
GetBalance -
func (*SystemEIStub) SelfDestruct ¶
func (s *SystemEIStub) SelfDestruct(beneficiary []byte)
SelfDestruct -
func (*SystemEIStub) SetGasProvided ¶
func (s *SystemEIStub) SetGasProvided(_ uint64)
SetGasProvided -
func (*SystemEIStub) SetStorage ¶
func (s *SystemEIStub) SetStorage(key []byte, value []byte)
SetStorage -
func (*SystemEIStub) SetSystemSCContainer ¶
func (s *SystemEIStub) SetSystemSCContainer(_ vm.SystemSCContainer) error
SetSystemSCContainer -
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 ¶
func (s *SystemSCContainerStub) Add(key []byte, val vm.SystemSmartContract) error
Add -
func (*SystemSCContainerStub) Get ¶
func (s *SystemSCContainerStub) Get(key []byte) (vm.SystemSmartContract, error)
Get -
func (*SystemSCContainerStub) IsInterfaceNil ¶
func (s *SystemSCContainerStub) IsInterfaceNil() bool
IsInterfaceNil -
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 ValueOfCalled func(key interface{}) interface{} }
SystemSCStub -
func (*SystemSCStub) Execute ¶
func (s *SystemSCStub) Execute(args *vmcommon.ContractCallInput) vmcommon.ReturnCode
Execute -
func (*SystemSCStub) ValueOf ¶
func (s *SystemSCStub) ValueOf(key interface{}) interface{}
ValueOf -
type ValidatorSettingsStub ¶
type ValidatorSettingsStub struct { MinStepValueCalled func() *big.Int TotalSupplyCalled func() *big.Int NumNodesCalled func() uint32 AuctionEnableNonceCalled func() uint64 StakeEnableNonceCalled func() uint64 UnBondPeriodCalled func() uint64 StakeValueCalled func() *big.Int UnJailValueCalled func() *big.Int NumRoundsWithoutBleedCalled func() uint64 BleedPercentagePerRoundCalled func() float64 MaximumPercentageToBleedCalled func() float64 }
ValidatorSettingsStub -
func (*ValidatorSettingsStub) AuctionEnableNonce ¶
func (v *ValidatorSettingsStub) AuctionEnableNonce() uint64
AuctionEnableNonce -
func (*ValidatorSettingsStub) BleedPercentagePerRound ¶
func (v *ValidatorSettingsStub) BleedPercentagePerRound() float64
BleedPercentagePerRound -
func (*ValidatorSettingsStub) GenesisNodePrice ¶
func (v *ValidatorSettingsStub) GenesisNodePrice() *big.Int
GenesisNodePrice -
func (*ValidatorSettingsStub) IsInterfaceNil ¶
func (v *ValidatorSettingsStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*ValidatorSettingsStub) MaximumPercentageToBleed ¶
func (v *ValidatorSettingsStub) MaximumPercentageToBleed() float64
MaximumPercentageToBleed -
func (*ValidatorSettingsStub) MinStepValue ¶
func (v *ValidatorSettingsStub) MinStepValue() *big.Int
MinStepValue -
func (*ValidatorSettingsStub) NumNodes ¶
func (v *ValidatorSettingsStub) NumNodes() uint32
NumNodes -
func (*ValidatorSettingsStub) NumRoundsWithoutBleed ¶
func (v *ValidatorSettingsStub) NumRoundsWithoutBleed() uint64
NumRoundsWithoutBleed -
func (*ValidatorSettingsStub) StakeEnableNonce ¶
func (v *ValidatorSettingsStub) StakeEnableNonce() uint64
StakeEnableNonce -
func (*ValidatorSettingsStub) TotalSupply ¶
func (v *ValidatorSettingsStub) TotalSupply() *big.Int
TotalSupply -
func (*ValidatorSettingsStub) UnBondPeriod ¶
func (v *ValidatorSettingsStub) UnBondPeriod() uint64
UnBondPeriod -
func (*ValidatorSettingsStub) UnJailValue ¶
func (v *ValidatorSettingsStub) UnJailValue() *big.Int
UnJailValue -