Documentation ¶
Index ¶
- Constants
- Variables
- type AccountsParser
- type AccountsParserArgs
- type DelegationDataHandler
- type DelegationResult
- type DeployProcessor
- type IndexingData
- type InitialAccountHandler
- type InitialNodesHandler
- type InitialSmartContractHandler
- type InitialSmartContractParser
- type NodesListSplitter
- type TxExecutionProcessor
- type VersionedHeaderFactory
Constants ¶
const DNSType = "dns"
DNSType defines the constant used when checking if a smart contract is of dns type
const DelegationType = "delegation"
DelegationType defines the constant used when checking if a smart contract is of delegation type
Variables ¶
var ErrAccountAlreadyExists = errors.New("account already exists")
ErrAccountAlreadyExists signals that an account already exists
var ErrAccountNotCreated = errors.New("account not created")
ErrAccountNotCreated signals that an account could not have been created
var ErrAddressIsSmartContract = errors.New("address is a smart contract")
ErrAddressIsSmartContract signals that provided address is of type smart contract
var ErrBLSKeyNotStaked = errors.New("bls key not staked")
ErrBLSKeyNotStaked signals that bls staking was not successful
var ErrChangeOwnerAddressFailed = errors.New("change owner address failed")
ErrChangeOwnerAddressFailed signals that change owner address failed
var ErrDelegationValueIsNotEnough = errors.New("delegation value is not enough")
ErrDelegationValueIsNotEnough signals that the delegation value provided is not enough for provided node(s)
var ErrDuplicateAddress = errors.New("duplicate address")
ErrDuplicateAddress signals that the same address was found more than one time
var ErrEmptyAddress = errors.New("empty address")
ErrEmptyAddress signals that an empty address was found in genesis file
var ErrEmptyDelegationAddress = errors.New("empty delegation address")
ErrEmptyDelegationAddress signals that the delegation address is empty
var ErrEmptyOwnerAddress = errors.New("empty owner address")
ErrEmptyOwnerAddress signals that an empty owner address was found in genesis file
var ErrEmptyPubKey = errors.New("empty public key")
ErrEmptyPubKey signals that empty public key has been provided
var ErrEmptyReturnData = errors.New("empty return data")
ErrEmptyReturnData signals an empty return data from vmOutput was received
var ErrEmptyVmType = errors.New("empty vm type")
ErrEmptyVmType signals that the provided VM type is empty
var ErrEntireSupplyMismatch = errors.New("entire supply mismatch")
ErrEntireSupplyMismatch signals that the provided entire supply mismatches the computed one
var ErrFilenameIsDirectory = errors.New("provided name is actually a directory")
ErrFilenameIsDirectory signals that the provided filename is a directory
var ErrGetVersionFromSC = errors.New("get version from contract returned an invalid response")
ErrGetVersionFromSC signals that a call to "version" function on a contract resulted in an unexpected result
var ErrInvalidAddress = errors.New("invalid address")
ErrInvalidAddress signals that an invalid address was found
var ErrInvalidBalance = errors.New("invalid balance")
ErrInvalidBalance signals that the balance field is invalid
var ErrInvalidBalanceString = errors.New("invalid balance string")
ErrInvalidBalanceString signals that the balance string is not a valid number
var ErrInvalidDelegationAddress = errors.New("invalid delegation address")
ErrInvalidDelegationAddress signals that the delegation address is invalid
var ErrInvalidDelegationValue = errors.New("invalid delegation value")
ErrInvalidDelegationValue signals that the delegation value field is invalid
var ErrInvalidDelegationValueString = errors.New("invalid delegation value string")
ErrInvalidDelegationValueString signals that the delegation balance string is not a valid number
var ErrInvalidEntireSupply = errors.New("invalid entire supply")
ErrInvalidEntireSupply signals that the provided entire supply is invalid
var ErrInvalidInitialNodePrice = errors.New("invalid initial node price")
ErrInvalidInitialNodePrice signals that the provided initial node price is invalid
var ErrInvalidOwnerAddress = errors.New("invalid owner address")
ErrInvalidOwnerAddress signals that an invalid owner address was found
var ErrInvalidPubKey = errors.New("invalid public key")
ErrInvalidPubKey signals that an invalid public key has been provided
var ErrInvalidStakingBalance = errors.New("invalid staking balance")
ErrInvalidStakingBalance signals that the staking balance field is invalid
var ErrInvalidStakingBalanceString = errors.New("invalid staking balance string")
ErrInvalidStakingBalanceString signals that the staking balance string is not a valid number
var ErrInvalidSupply = errors.New("invalid supply")
ErrInvalidSupply signals that the supply field is invalid
var ErrInvalidSupplyString = errors.New("invalid supply string")
ErrInvalidSupplyString signals that the supply string is not a valid number
var ErrInvalidVmType = errors.New("invalid vm type")
ErrInvalidVmType signals that the provided VM type is invalid
var ErrMissingDeployedSC = errors.New("missing deployed SC")
ErrMissingDeployedSC signals that a delegation referenced an un-deployed contract
var ErrNilAccountsParser = errors.New("nil accounts parser")
ErrNilAccountsParser signals that the provided accounts parser is nil
var ErrNilDelegationHandler = errors.New("nil delegation handler")
ErrNilDelegationHandler signals that a nil delegation handler has been used
var ErrNilEntireSupply = errors.New("nil entire supply")
ErrNilEntireSupply signals that the provided entire supply is nil
var ErrNilEpochConfig = errors.New("nil epoch config")
ErrNilEpochConfig signals that a nil epoch config was provided
var ErrNilGasSchedule = errors.New("nil gas schedule")
ErrNilGasSchedule signals that an operation has been attempted with a nil gas schedule
var ErrNilHasher = errors.New("nil Hasher")
ErrNilHasher signals that an operation has been attempted to or with a nil hasher implementation
var ErrNilInitialNodePrice = errors.New("nil initial node price")
ErrNilInitialNodePrice signals that the provided initial node price is nil
var ErrNilKeyGenerator = errors.New("nil key generator")
ErrNilKeyGenerator signals that nil key generator has been provided
var ErrNilMarshalizer = errors.New("nil Marshalizer")
ErrNilMarshalizer signals that an operation has been attempted to or with a nil Marshalizer implementation
var ErrNilNodesListSplitter = errors.New("nil nodes list splitter")
ErrNilNodesListSplitter signals that a nil nodes handler has been provided
var ErrNilNodesSetup = errors.New("nil nodes setup")
ErrNilNodesSetup signals that a nil nodes setup handler has been provided
var ErrNilPubkeyConverter = errors.New("nil pubkey converter")
ErrNilPubkeyConverter signals that the provided public key converter is nil
var ErrNilQueryService = errors.New("nil query service")
ErrNilQueryService signals that a nil query service has been provided
var ErrNilRoundConfig = errors.New("nil round config")
ErrNilRoundConfig signals that a nil round config was provided
var ErrNilShardCoordinator = errors.New("nil shard coordinator")
ErrNilShardCoordinator signals that the provided shard coordinator is nil
var ErrNilSmartContractParser = errors.New("nil smart contract parser")
ErrNilSmartContractParser signals that the smart contract parser is nil
var ErrNilTrieStorageManager = errors.New("nil trie storage manager")
ErrNilTrieStorageManager signals that a nil trie storage manager has been provided
var ErrNilTxExecutionProcessor = errors.New("nil tx execution processor")
ErrNilTxExecutionProcessor signals that a nil tx execution processor has been provided
var ErrNodeNotStaked = errors.New("for the provided node, no one staked")
ErrNodeNotStaked signals that no one staked for the provided node
var ErrSignatureMismatch = errors.New("signature mismatch")
ErrSignatureMismatch signals a signature mismatch occurred
var ErrSmartContractWasNotDeployed = errors.New("smart contract was not deployed")
ErrSmartContractWasNotDeployed signals that smart contract was not deployed
var ErrStakingValueIsNotEnough = errors.New("staking value is not enough")
ErrStakingValueIsNotEnough signals that the staking value provided is not enough for provided node(s)
var ErrSupplyMismatch = errors.New("supply value mismatch")
ErrSupplyMismatch signals that the supply value provided is not valid when summing the other fields
var ErrTooManyDNSContracts = errors.New("too many DNS contracts")
ErrTooManyDNSContracts signals that too many DNS contracts are in genesis contracts json file
var ErrWhileVerifyingDelegation = errors.New("error occurred while verifying delegation SC")
ErrWhileVerifyingDelegation signals that a verification error occurred
var ErrWrongTypeAssertion = errors.New("wrong type assertion")
ErrWrongTypeAssertion signals that a wrong type assertion occurred
var InitialDNSAddress = bytes.Repeat([]byte{1}, 32)
InitialDNSAddress defines the initial address from where the DNS contracts are deployed
Functions ¶
This section is empty.
Types ¶
type AccountsParser ¶
type AccountsParser interface { InitialAccountsSplitOnAddressesShards(shardCoordinator sharding.Coordinator) (map[uint32][]InitialAccountHandler, error) InitialAccounts() []InitialAccountHandler GenesisMintingAddress() string GetTotalStakedForDelegationAddress(delegationAddress string) *big.Int GetInitialAccountsForDelegated(addressBytes []byte) []InitialAccountHandler GenerateInitialTransactions(shardCoordinator sharding.Coordinator, initialIndexingData map[uint32]*IndexingData) ([]*block.MiniBlock, map[uint32]*outport.TransactionPool, error) IsInterfaceNil() bool }
AccountsParser contains the parsed genesis json file and has some functionality regarding processed data
type AccountsParserArgs ¶
type AccountsParserArgs struct { GenesisFilePath string EntireSupply *big.Int MinterAddress string PubkeyConverter core.PubkeyConverter KeyGenerator crypto.KeyGenerator Hasher hashing.Hasher Marshalizer marshal.Marshalizer }
AccountsParserArgs holds all dependencies required by the accounts parser in order to create new instances
type DelegationDataHandler ¶
type DelegationDataHandler interface { GetAddress() string AddressBytes() []byte GetValue() *big.Int IsInterfaceNil() bool }
DelegationDataHandler represents the interface that describes the data held by a delegation address
type DelegationResult ¶
DelegationResult represents the DTO that contains the delegation results metrics
type DeployProcessor ¶
type DeployProcessor interface { Deploy(sc InitialSmartContractHandler) ([][]byte, error) IsInterfaceNil() bool }
DeployProcessor is able to deploy a smart contract
type IndexingData ¶
type IndexingData struct { DelegationTxs []data.TransactionHandler ScrsTxs map[string]data.TransactionHandler StakingTxs []data.TransactionHandler DeploySystemScTxs []data.TransactionHandler DeployInitialScTxs []data.TransactionHandler }
IndexingData specifies transactions sets that will be used for indexing
type InitialAccountHandler ¶
type InitialAccountHandler interface { Clone() InitialAccountHandler GetAddress() string AddressBytes() []byte GetStakingValue() *big.Int GetBalanceValue() *big.Int GetSupply() *big.Int GetDelegationHandler() DelegationDataHandler IsInterfaceNil() bool }
InitialAccountHandler represents the interface that describes the data held by an initial account
type InitialNodesHandler ¶
type InitialNodesHandler interface { InitialNodesInfo() (map[uint32][]nodesCoordinator.GenesisNodeInfoHandler, map[uint32][]nodesCoordinator.GenesisNodeInfoHandler) MinNumberOfNodes() uint32 MinNumberOfNodesWithHysteresis() uint32 IsInterfaceNil() bool }
InitialNodesHandler contains the initial nodes setup
type InitialSmartContractHandler ¶
type InitialSmartContractHandler interface { GetOwner() string OwnerBytes() []byte GetFilename() string GetVmType() string GetInitParameters() string GetType() string VmTypeBytes() []byte AddAddressBytes(addressBytes []byte) AddressesBytes() [][]byte AddAddress(address string) Addresses() []string GetVersion() string IsInterfaceNil() bool }
InitialSmartContractHandler represents the interface that describes the initial smart contract
type InitialSmartContractParser ¶
type InitialSmartContractParser interface { InitialSmartContractsSplitOnOwnersShards(shardCoordinator sharding.Coordinator) (map[uint32][]InitialSmartContractHandler, error) GetDeployedSCAddresses(scType string) (map[string]struct{}, error) InitialSmartContracts() []InitialSmartContractHandler IsInterfaceNil() bool }
InitialSmartContractParser contains the parsed genesis initial smart contracts json file and has some functionality regarding processed data
type NodesListSplitter ¶
type NodesListSplitter interface { GetAllNodes() []nodesCoordinator.GenesisNodeInfoHandler GetDelegatedNodes(delegationScAddress []byte) []nodesCoordinator.GenesisNodeInfoHandler IsInterfaceNil() bool }
NodesListSplitter is able to split de initial nodes based on some criteria
type TxExecutionProcessor ¶
type TxExecutionProcessor interface { ExecuteTransaction(nonce uint64, sndAddr []byte, rcvAddress []byte, value *big.Int, data []byte) error GetAccount(address []byte) (state.UserAccountHandler, bool) GetNonce(senderBytes []byte) (uint64, error) AddBalance(senderBytes []byte, value *big.Int) error AddNonce(senderBytes []byte, nonce uint64) error GetExecutedTransactions() []data.TransactionHandler IsInterfaceNil() bool }
TxExecutionProcessor represents a transaction builder and executor containing also related helper functions
type VersionedHeaderFactory ¶
type VersionedHeaderFactory interface { Create(epoch uint32) data.HeaderHandler IsInterfaceNil() bool }
VersionedHeaderFactory creates versioned headers