package
1.8.2
Repository: https://github.com/multiversx/mx-chain-go.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

AdbEmulateBalanceTxExecution emulates a tx execution by altering the accounts balance and nonce, and printing any encountered error.
AdbEmulateBalanceTxSafeExecution emulates a tx execution by altering the accounts balance and nonce, and printing any encountered error.
AddSelfNotarizedHeaderByMetachain -.
AllShardsProposeBlock simulates each shard selecting a consensus group and proposing/broadcasting/committing a block.
BootstrapDelay will delay the execution to allow the p2p bootstrap.
CheckRootHashes checks the root hash of the proposer in every shard.
CheckTxPresentAndRightNonce verifies that the nonce was updated correctly after the exec of bulk txs.
ClosePeers calls Messenger.Close on the provided peers.
CloseProcessorNodes closes the used TestProcessorNodes and advertiser.
ComputeAndRequestMissingTransactions computes missing transactions for each node, and requests them.
ConnectNodes will try to connect all provided connectable instances in a full mesh fashion.
CreateAccount creates a new account and returns the address.
CreateAccountForNode creates an account for the given node.
CreateAccountForNodes creates accounts for each node and commits the accounts state.
CreateAccountsDB creates an account state with a valid trie implementation but with a memory storage.
CreateAccountsDBWithEnableEpochsHandler creates a new AccountsDb with the given enableEpochsHandler.
CreateAndSendTransaction will generate a transaction with provided parameters, sign it with the provided node's tx sign private key and send it on the transaction topic using the correct node that can send the transaction.
CreateAndSendTransactions creates and sends transactions between given senders and receivers.
CreateAndSendTransactionWithGasLimit generates and send a transaction with provided gas limit/gas price.
CreateAndSendTransactionWithSenderAccount will generate a transaction with provided parameters, sign it with the provided node's tx sign private key and send it on the transaction topic using the correct node that can send the transaction.
CreateCryptoParams generates the crypto parameters (key pairs, key generator and suite) for multiple nodes.
CreateEnableEpochsConfig creates enable epochs definitions to be used in tests.
CreateFixedNetworkOf14Peers assembles a network as following: 0 | 1 | +--+--+--+--+--2--+--+--+--+--+ | | | | | | | | | | | 3 4 5 6 7 8 9 10 11 12 13.
CreateFixedNetworkOf8Peers assembles a network as following: 0------------------- 1 | | 2 ------------------ 3 ------------------ 4 | | | 5 6 7.
CreateFullGenesisBlocks does the full genesis process, deploys smart contract at genesis.
CreateGenesisBlocks creates empty genesis blocks for all known shards, including metachain.
CreateGenesisMetaBlock creates a new mock meta genesis block.
CreateHeaderIntegrityVerifier outputs a valid header integrity verifier handler.
CreateMemUnit returns an in-memory storer implementation (the vast majority of tests do not require effective disk I/O).
CreateMessengerFromConfig creates a new libp2p messenger with provided configuration.
CreateMessengerFromConfigWithPeersRatingHandler creates a new libp2p messenger with provided configuration.
CreateMessengerWithKadDht creates a new libp2p messenger with kad-dht peer discovery.
CreateMessengerWithNoDiscovery creates a new libp2p messenger with no peer discovery.
CreateMessengerWithNoDiscoveryAndPeersRatingHandler creates a new libp2p messenger with no peer discovery.
CreateMetaChain creates a blockchain implementation used by the meta nodes.
CreateMintingForSenders creates account with balances for every node in a given shard.
CreateMintingFromAddresses creates account with balances for given address.
CreateNewDefaultTrie returns a new trie with test hasher and marsahalizer.
CreateNode -.
CreateNodes creates multiple nodes in different shards.
CreateNodesWithBLSSigVerifier creates multiple nodes in different shards.
CreateNodesWithEnableEpochs creates multiple nodes with custom epoch config.
CreateNodesWithEnableEpochsAndVmConfig creates multiple nodes with custom epoch and vm config.
CreateNodesWithEnableEpochsAndVmConfigWithRoundsConfig creates multiple nodes with custom epoch and vm config.
CreateNodesWithEnableEpochsConfig creates multiple nodes in different shards but with custom enable epochs config.
CreateNodesWithFullGenesis creates multiple nodes in different shards.
CreateNodesWithFullGenesisCustomEnableEpochs creates multiple nodes in different shards.
CreateNodesWithNodesCoordinator returns a map with nodes per shard each using a real nodes coordinator.
CreateNodesWithNodesCoordinatorAndHeaderSigVerifier returns a map with nodes per shard each using a real nodes coordinator and header sig verifier.
CreateNodesWithNodesCoordinatorAndTxKeys -.
CreateNodesWithNodesCoordinatorFactory returns a map with nodes per shard each using a real nodes coordinator.
CreateNodesWithNodesCoordinatorKeygenAndSingleSigner returns a map with nodes per shard each using a real nodes coordinator and a given single signer for blocks and a given key gen for blocks.
CreateNodesWithNodesCoordinatorWithCacher returns a map with nodes per shard each using a real nodes coordinator with cacher.
CreateNodesWithTestConsensusNode returns a map with nodes per shard each using TestConsensusNode.
CreateNodesWithTestHeartbeatNode returns a map with nodes per shard each using a real nodes coordinator and TestHeartbeatNode.
CreateNodeWithBLSAndTxKeys -.
CreateP2PConfigWithNoDiscovery creates a new libp2p messenger with no peer discovery.
CreatePkBytes creates 'numShards' public key-like byte slices.
CreateProcessorNodesWithNodesCoordinator creates a map of nodes with a valid nodes coordinator implementation keeping the consistency of generated keys.
CreateRandomAddress creates a random byte array with fixed size.
CreateRandomBytes returns a random byte slice with the given size.
CreateRatingsData creates a mock RatingsData object.
CreateRequesterDataPool creates a datapool with a mock txPool.
CreateResolversDataPool creates a datapool containing a given number of transactions.
CreateSendersAndReceiversInShard creates given number of sender private key and receiver public key pairs, with account in same shard as given node.
CreateSendersWithInitialBalances creates a map of 1 sender per shard with an initial balance.
CreateShardChain creates a blockchain implementation used by the shard nodes.
CreateSimpleGenesisBlock creates a new mock shard genesis block.
CreateSimpleGenesisBlocks creates empty genesis blocks for all known shards, including metachain.
CreateSimpleGenesisMetaBlock creates a new mock meta genesis block.
CreateSimpleTxProcessor returns a transaction processor.
CreateStore creates a storage service for shard nodes.
CreateTestWalletAccount creates a wallet account in a selected shard.
CreateTestWalletAccountWithKeygenAndSingleSigner creates a wallet account in a selected shard.
CreateTrieStorageManager creates the trie storage manager for the tests.
CreateTrieStorageManagerWithPruningStorer creates the trie storage manager for the tests.
DeployScTx creates and sends a SC tx.
DisplayAndStartNodes prints each nodes shard ID, sk and pk, and then starts the node.
DoConsensusSigningOnBlock simulates a consensus aggregated signature on the provided block.
EmptyDataPools clears all the data pools.
ForkChoiceOneBlock rollbacks a block from the given shard.
GenerateAddressJournalAccountAccountsDB returns an account, the accounts address, and the accounts database.
GenerateAndDisseminateTxs generates and sends multiple txs.
GenerateIntraShardTransactions generates intra shard transactions.
GenerateOneAddressPerShard -.
GenerateRandomSlice returns a random byte slice with the given size.
GenerateSkAndPkInShard generates and returns a private and a public key that reside in a given shard.
GenerateTransferTx will generate a move balance transaction.
GenerateTrieKeysForMaxLevel generates a list of keys that will fill a trie until the given level is reached.
GenValidatorsFromPubKeys generates a map of validators per shard out of public keys map.
GenValidatorsFromPubKeysAndTxPubKeys generates a map of validators per shard out of public keys map.
GetConnectableAddress returns a non circuit, non windows default connectable address for provided messenger.
GetDefaultCoreComponents -.
GetDefaultCryptoComponents -.
GetDefaultDataComponents -.
GetDefaultEnableEpochsConfig returns a default EnableEpochs config.
GetDefaultNetworkComponents -.
GetDefaultProcessComponents -.
GetDefaultStateComponents -.
GetDefaultStatusComponents -.
GetMiniBlocksHashesFromShardIds returns miniblock hashes from body.
GetTokenIdentifier returns the token identifier from the metachain for the given ticker.
IncrementAndPrintRound increments the given variable, and prints the message for the beginning of the round.
IncrementNonces increments all the nonces.
IsIntInSlice returns true if idx is found on any position in the provided slice.
MakeDisplayTable will output a string containing counters for received transactions, headers, miniblocks and meta headers for all provided test nodes.
MakeDisplayTableForHeartbeatNodes returns a string containing counters for received messages for all provided test nodes.
MintAddress will create an account (if it does not exist), update the balance with required value, save the account and commit the trie.
MintAllNodes will take each shard node (n) and will mint all nodes that have their pk managed by the iterating node n.
MintAllPlayers mints addresses for all players.
NewCountInterceptor creates a new CountInterceptor instance.
NewMiniNetwork creates a MiniNetwork.
NewTestConsensusNode returns a new TestConsensusNode.
NewTestHeartbeatNode returns a new TestHeartbeatNode instance with a libp2p messenger.
NewTestHeartbeatNodeWithCoordinator returns a new TestHeartbeatNode instance with a libp2p messenger using provided coordinator and keys.
NewTestNetwork creates an unsized TestNetwork; topology must be configured afterwards, before starting.
NewTestNetworkSized creates a new TestNetwork containing topology information; can be started immediately.
NewTestProcessorNode returns a new TestProcessorNode instance with a libp2p messenger and the provided arguments.
NewTestProcessorNodeWithTestWebServer returns a new TestProcessorNodeWithTestWebServer instance with a libp2p messenger.
NewTestStorage return an object of type TestStorage.
PlayerSendsTransaction creates and sends a transaction to the SC.
PrepareRelayedTxDataV1 repares the data for a relayed transaction V1.
PrepareRelayedTxDataV2 prepares the data for a relayed transaction V2.
PrintShardAccount outputs on console a shard account data contained.
ProcessSCOutputAccounts will save account changes in accounts db from vmOutput.
ProposeAndSyncOneBlock proposes a block, syncs the block and then increments the round.
ProposeBlock proposes a block for every shard.
ProposeBlocks proposes blocks for a given number of rounds.
ProposeBlockSignalsEmptyBlock proposes and broadcasts a block.
ProposeBlockWithConsensusSignature proposes.
PubKeysMapFromNodesKeysMap returns a map of public keys per shard from the key pairs per shard map.
PubKeysMapFromTxKeysMap returns a map of public keys per shard from the key pairs per shard map.
ResetHighestProbableNonce resets the highest probable nonce.
SaveDelegationContractsList will save a mock configuration for the delegation contracts list.
SaveDelegationManagerConfig will save a mock configuration for the delegation manager SC.
ScCallTxWithParams creates and sends a SC tx call or deploy with all major parameters provided.
SetEconomicsParameters will set maxGasLimitPerBlock, minGasPrice and minGasLimits to provided nodes.
SetupSyncNodesOneShardAndMeta creates nodes with sync capabilities divided into one shard and a metachain.
StartSyncingBlocks starts the syncing process of all the nodes.
SyncAllShardsWithRoundBlock enforces all nodes in each shard synchronizing the block for the given round.
SyncBlock synchronizes the proposed block in all the other shard nodes.
TestPrivateKeyHasBalance checks if the private key has the expected balance.
TestPublicKeyHasBalance checks if the account corresponding to the given public key has the expected balance.
Uint32InSlice checks if a uint32 value is in a slice.
UpdateRound updates the round for every node.
WaitOperationToBeDone -.
WhiteListTxs -.

# Constants

AddressPrefix is a global testing const.
constants used for the hearbeat node & generated messages.
constants used for the hearbeat node & generated messages.
GasSchedulePath --.
GlobalTopic is a global testing that all nodes will bind an interceptor.
MaxGasLimitPerBlock defines maximum gas limit allowed per one block.
OpGasValueForMockVm represents the gas value that it consumed by each operation called on the mock VM By operation, we mean each go function that is called on the VM implementation.
ScheduledMiniBlocksEnableEpoch defines the epoch for integration tests when scheduled nini blocks are enabled.
ShardTopic is the topic string generator for sharded topics Will generate topics in the following pattern: shard_0, shard_0_1, shard_0_META, shard_1 and so on.
StakingV4Step1EnableEpoch defines the epoch for integration tests when stakingV4 init is enabled.
StakingV4Step2EnableEpoch defines the epoch for integration tests when stakingV4 is enabled; should be greater than StakingV2Epoch.
StakingV4Step3EnableEpoch defines the epoch for integration tests when nodes distribution from auction to waiting list is enabled in staking v4.
UnreachableEpoch defines an unreachable epoch for integration tests.
UserAccount identifies an account holding balance, storage updates, code.
ValidatorAccount identifies an account holding stake, crypto public keys, assigned shard, rating.

# Variables

AdditionalGasLimit is the value that can be added on a transaction in the GasLimit.
ChainID is the chain ID identifier used in integration tests, processing nodes.
DelegationManagerConfigChangeAddress represents the address that can change the config parameters of the delegation manager system smartcontract.
InitialRating is used to initiate a node's info.
MinTransactionVersion is the minimum transaction version used in integration tests, processing nodes.
MinTxGasLimit defines minimum gas limit required by a transaction.
MinTxGasPrice defines minimum gas price required by a transaction.
P2pBootstrapDelay is used so that nodes have enough time to bootstrap.
SoftwareVersion is the software version identifier used in integration tests, processing nodes.
StepDelay is used so that transactions can disseminate properly.
SyncDelay is used so that nodes have enough time to sync.
TestAddressPubkeyConverter represents an address public key converter.
TestAppStatusHandler represents an AppStatusHandler.
TestBalanceComputationHandler represents a balance computation handler.
TestBlockSizeComputation represents a block size computation handler.
TestBlockSizeThrottler represents a block size throttler used in adaptive block size computation.
TestBLSKeyGenerator represents the BLS key generator.
TestBuiltinFunctions is an additional map of builtin functions to be added to the scProcessor.
TestHasher represents a sha256 hasher.
TestKeyGenForAccounts represents a mock key generator for balances.
TestMarshalizer represents the main marshalizer.
TestMarshaller represents the main marshaller.
TestMultiSig represents a mock multisig.
TestP2PKeyGenerator represents the p2p key generator.
TestSingleBlsSigner defines a BlsSingleSigner.
TestSingleSigner defines a Ed25519Signer.
TestThrottler -.
TestTxSignHasher represents a sha3 legacy keccak 256 hasher.
TestTxSignMarshalizer represents the marshalizer used in vm communication.
TestUint64Converter represents an uint64 to byte slice converter.
TestValidatorPubkeyConverter represents an address public key converter.
TestVmMarshalizer represents the marshalizer used in vm communication.
TimeSpanForBadHeaders is the expiry time for an added block header hash.

# Structs

ArgIndexHashedNodesCoordinatorFactory -.
ArgsTestConsensusNode represents the arguments for the test consensus node constructor(s).
ArgTestProcessorNode represents the DTO used to create a new TestProcessorNode.
CountInterceptor represents an interceptors that counts received messages on topics.
CryptoParams holds crypto parameters.
IndexHashedNodesCoordinatorFactory -.
IndexHashedNodesCoordinatorWithRaterFactory -.
IntWrapper defines a wrapped int used as an optional parameter.
MiniNetwork is a mini network, useful for some integration tests.
NodesWithRater -.
TestBuiltinFunction wraps a builtin function defined ad-hoc, for testing.
TestConsensusNode represents a structure used in integration tests used for consensus tests.
TestHeartbeatNode represents a container type of class used in integration tests with all its fields exported.
TestKeyPair holds a pair of private/public Keys.
TestNetwork wraps a set of TestProcessorNodes along with a set of test Wallets, instantiates them, controls them and provides operations with them; designed to be used in integration tests.
TestNodeKeys will hold the main key along the handled keys of a node.
TestProcessorNode represents a container type of class used in integration tests with all its fields exported.
TestProcessorNodeWithTestWebServer represents a TestProcessorNode with a test web server.
TestStorage represents a container type of class used in integration tests for storage.
TestWalletAccount creates and account with balance and crypto necessary to sign transactions.

# Interfaces

Connectable defines the operations for a struct to become connectable by other struct In other words, all instances that implement this interface are able to connect with each other.
Facade is the node facade used to decouple the node implementation with the web server.
NetworkShardingUpdater defines the updating methods used by the network sharding component.
NodesCoordinatorFactory is used for creating a nodesCoordinator in the integration tests.
TestBootstrapper extends the Bootstrapper interface with some functions intended to be used only in tests as it simplifies the reproduction of edge cases.
TestEpochStartTrigger extends the epochStart trigger interface with some functions intended to by used only in tests as it simplifies the reproduction of test scenarios.

# Type aliases

Address is a slice of bytes used to identify an account.
GasScheduleMap is a map containing the predefined gas costs.
NodesByShardMap is a map that groups TestProcessorNodes by their shard ID.
NodeSlice is a slice of TestProcessorNode instances.
ShardIdentifier is the numeric index of a shard.
Type defines account types to save in accounts trie.