Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrBLSPublicKeyMissmatch = errors.New("public key missmatch")
ErrBLSPublicKeyMissmatch signals that public keys do not match
var ErrIncorrectConfig = errors.New("config incorrect")
ErrIncorrectConfig signals that auction config is incorrect
var ErrInputArgsIsNil = errors.New("input system smart contract arguments are nil")
ErrInputArgsIsNil signals that input arguments are nil for system smart contract
var ErrInputCallValueIsNil = errors.New("input value for system smart contract is nil")
ErrInputCallValueIsNil signals that input call value is nil for system smart contract
var ErrInputCallerAddrIsNil = errors.New("input called address for system smart contract is nil")
ErrInputCallerAddrIsNil signals that input caller address is nil for system smart contract
var ErrInputFunctionIsNil = errors.New("input function for system smart contract is nil")
ErrInputFunctionIsNil signals that input function is nil for system smart contract
var ErrInputRecipientAddrIsNil = errors.New("input recipient address for system smart contract is nil")
ErrInputRecipientAddrIsNil signals that input recipient address for system smart contract is nil
var ErrInvalidJailAccessAddress = errors.New("invalid jailing access address")
ErrInvalidJailAccessAddress signals that invalid jailing access address was provided
var ErrInvalidStakingAccessAddress = errors.New("invalid staking access address")
ErrInvalidStakingAccessAddress signals that invalid staking access address was provided
var ErrKeyAlreadyRegistered = errors.New("bls key already registered")
ErrKeyAlreadyRegistered signals that bls key is already registered
var ErrNegativeInitialStakeValue = errors.New("initial stake value is negative")
ErrNegativeInitialStakeValue signals that a negative initial stake value was provided
var ErrNilArgumentsParser = errors.New("nil arguments parser")
ErrNilArgumentsParser signals that arguments parses is nil
var ErrNilAuctionSmartContractAddress = errors.New("nil auction smart contract address")
ErrNilAuctionSmartContractAddress signals that auction smart contract address is nil
var ErrNilBlockchainHook = errors.New("blockchain hook is nil")
ErrNilBlockchainHook signals that blockchain hook is nil
var ErrNilCryptoHook = errors.New("crypto hook is nil")
ErrNilCryptoHook signals that crypto hook is nil
var ErrNilEconomicsData = errors.New("nil economics data")
ErrNilEconomicsData signals that nil economics data has been provided
var ErrNilInitialStakeValue = errors.New("initial stake value is nil")
ErrNilInitialStakeValue signals that nil initial stake value was provided
var ErrNilKeyGenerator = errors.New("nil key generator")
ErrNilKeyGenerator signals that key generator is nil
var ErrNilMessageSignVerifier = errors.New("nil message sign verifier")
ErrNilMessageSignVerifier signals that message sign verifier is nil
var ErrNilOrEmptyKey = errors.New("nil or empty key")
ErrNilOrEmptyKey signals that key is nil or empty
var ErrNilStakingSmartContractAddress = errors.New("nil staking smart contract address")
ErrNilStakingSmartContractAddress signals that staking smart contract address is nil
var ErrNilSystemContractsContainer = errors.New("system contract container is nil")
ErrNilSystemContractsContainer signals that the provided system contract container is nil
var ErrNilSystemEnvironmentInterface = errors.New("system environment interface is nil")
ErrNilSystemEnvironmentInterface signals that a nil system environment interface was provided
var ErrNilVMType = errors.New("vm type is nil")
ErrNilVMType signals that the provided vm type is nil
var ErrNilValidatorSettings = errors.New("nil validator settings")
ErrNilValidatorSettings signals that validator settings is nil
var ErrNotEnoughArgumentsToStake = errors.New("not enough arguments to stake")
ErrNotEnoughArgumentsToStake signals that the arguments provided are not enough
var ErrNotEnoughGas = errors.New("not enough gas")
ErrNotEnoughGas signals that there is not enough gas for execution
var ErrNotEnoughQualifiedNodes = errors.New("not enough qualified nodes")
ErrNotEnoughQualifiedNodes signals that there are insufficient number of qualified nodes
var ErrOnExecutionAtStakingSC = errors.New("execution error at staking sc")
ErrOnExecutionAtStakingSC signals that there was an error at staking sc call
var ErrSingleSigner = errors.New("nil single signer")
ErrSingleSigner signals that single signer is nil
var ErrUnknownSystemSmartContract = errors.New("missing system smart contract on selected address")
ErrUnknownSystemSmartContract signals that there is no system smart contract on the provided address
Functions ¶
This section is empty.
Types ¶
type ArgumentsParser ¶
type ArgumentsParser interface { GetFunctionArguments() ([][]byte, error) GetFunction() (string, error) ParseData(data string) error IsInterfaceNil() bool }
ArgumentsParser defines the functionality to parse transaction data into arguments and code for smart contracts
type BaseOperationCost ¶
type BaseOperationCost struct { StorePerByte uint64 ReleasePerByte uint64 DataCopyPerByte uint64 PersistPerByte uint64 CompilePerByte uint64 }
BaseOperationCost defines cost for base operation cost
type ContextHandler ¶
type ContextHandler interface { SystemEI SetSystemSCContainer(scContainer SystemSCContainer) error CreateVMOutput() *vmcommon.VMOutput CleanCache() SetSCAddress(addr []byte) AddCode(addr []byte, code []byte) AddTxValueToSmartContract(value *big.Int, scAddress []byte) SetGasProvided(gasProvided uint64) }
ContextHandler defines the methods needed to execute system smart contracts
type GasCost ¶
type GasCost struct { BaseOperationCost BaseOperationCost MetaChainSystemSCsCost MetaChainSystemSCsCost }
GasCost holds all the needed gas costs for system smart contracts
type MessageSignVerifier ¶
type MessageSignVerifier interface { Verify(message []byte, signedMessage []byte, pubKey []byte) error IsInterfaceNil() bool }
MessageSignVerifier is used to verify if message was signed with given public key
type MetaChainSystemSCsCost ¶
type MetaChainSystemSCsCost struct { Stake uint64 UnStake uint64 UnBond uint64 Claim uint64 Get uint64 ChangeRewardAddress uint64 ChangeValidatorKeys uint64 UnJail uint64 }
MetaChainSystemSCsCost defines the cost of system staking SCs methods
type SystemEI ¶
type SystemEI interface { ExecuteOnDestContext(destination []byte, sender []byte, value *big.Int, input []byte) (*vmcommon.VMOutput, error) Transfer(destination []byte, sender []byte, value *big.Int, input []byte) error GetBalance(addr []byte) *big.Int SetStorage(key []byte, value []byte) GetStorage(key []byte) []byte Finish(value []byte) UseGas(gasToConsume uint64) error BlockChainHook() vmcommon.BlockchainHook CryptoHook() vmcommon.CryptoHook IsInterfaceNil() bool }
SystemEI defines the environment interface system smart contract can use
type SystemSCContainer ¶
type SystemSCContainer interface { Get(key []byte) (SystemSmartContract, error) Add(key []byte, val SystemSmartContract) error Replace(key []byte, val SystemSmartContract) error Remove(key []byte) Len() int Keys() [][]byte IsInterfaceNil() bool }
SystemSCContainer defines a system smart contract holder data type with basic functionality
type SystemSCContainerFactory ¶
type SystemSCContainerFactory interface { Create() (SystemSCContainer, error) IsInterfaceNil() bool }
SystemSCContainerFactory defines the functionality to create a system smart contract container
type SystemSmartContract ¶
type SystemSmartContract interface { Execute(args *vmcommon.ContractCallInput) vmcommon.ReturnCode IsInterfaceNil() bool }
SystemSmartContract interface defines the function a system smart contract should have
type ValidatorSettingsHandler ¶
type ValidatorSettingsHandler interface { UnBondPeriod() uint64 GenesisNodePrice() *big.Int MinStepValue() *big.Int UnJailValue() *big.Int TotalSupply() *big.Int NumNodes() uint32 AuctionEnableNonce() uint64 StakeEnableNonce() uint64 NumRoundsWithoutBleed() uint64 BleedPercentagePerRound() float64 MaximumPercentageToBleed() float64 IsInterfaceNil() bool }
ValidatorSettingsHandler defines the functionality which is needed for validators' settings