Documentation ¶
Index ¶
- Variables
- func GetSCCode(fileName string) []byte
- type ScenarioWithBenchmark
- type TestAccount
- func (tAcc *TestAccount) GetAddress() []byte
- func (tAcc *TestAccount) GetBalance() *big.Int
- func (tAcc *TestAccount) GetCode() []byte
- func (tAcc *TestAccount) GetNonce() uint64
- func (tAcc *TestAccount) GetOwner() []byte
- func (tAcc *TestAccount) GetStorage() map[string][]byte
- func (tAcc *TestAccount) WithAddress(address []byte) *TestAccount
- func (tAcc *TestAccount) WithBalance(balance *big.Int) *TestAccount
- func (tAcc *TestAccount) WithCode(code []byte) *TestAccount
- func (tAcc *TestAccount) WithNonce(nonce uint64) *TestAccount
- func (tAcc *TestAccount) WithOwner(owner []byte) *TestAccount
- func (tAcc *TestAccount) WithStorage(storage map[string][]byte) *TestAccount
- type Transaction
- func CreateDeployTransaction(args [][]byte, scCodePath string, sndAddr []byte, gasLimit uint64, ...) *Transaction
- func CreateTransaction(function string, args [][]byte, nonce uint64, value *big.Int, ...) *Transaction
- func CreateUpgradeTransaction(args [][]byte, scCodePath string, sndAddr []byte, rcvAddr []byte, ...) *Transaction
- func NewTransaction() *Transaction
- func (tx *Transaction) GetCallArguments() [][]byte
- func (tx *Transaction) GetCallFunction() string
- func (tx *Transaction) GetCallValue() *big.Int
- func (tx *Transaction) GetDeployData() []byte
- func (tx *Transaction) GetESDTTransfers() []*scenmodel.ESDTTxData
- func (tx *Transaction) GetGasLimitAndPrice() (uint64, uint64)
- func (tx *Transaction) GetNonce() uint64
- func (tx *Transaction) GetReceiverAddress() []byte
- func (tx *Transaction) GetSenderAddress() []byte
- func (tx *Transaction) WithCallArguments(arguments [][]byte) *Transaction
- func (tx *Transaction) WithCallFunction(functionName string) *Transaction
- func (tx *Transaction) WithCallValue(value *big.Int) *Transaction
- func (tx *Transaction) WithDeployData(scCodePath string, args [][]byte) *Transaction
- func (tx *Transaction) WithESDTTransfers(esdtTransfers []*scenmodel.ESDTTxData) *Transaction
- func (tx *Transaction) WithGasLimitAndPrice(gasLimit, gasPrice uint64) *Transaction
- func (tx *Transaction) WithNonce(nonce uint64) *Transaction
- func (tx *Transaction) WithReceiverAddress(address []byte) *Transaction
- func (tx *Transaction) WithSenderAddress(address []byte) *Transaction
Constants ¶
This section is empty.
Variables ¶
var InvalidBenchmarkTxPos = -1
var ScAddressPrefix = []byte{0, 0, 0, 0, 0, 0, 0, 0, 5, 0}
ScAddressPrefix is the smart contract address prefix
var ScAddressPrefixLength = 10
ScAddressPrefixLength defines the length of the smart contract address prefix
Functions ¶
Types ¶
type ScenarioWithBenchmark ¶
type ScenarioWithBenchmark struct { Accs []*TestAccount DeployedAccs []*TestAccount Txs []*Transaction DeployTxs []*Transaction BenchmarkTxPos int }
ScenarioWithBenchmark defines the component used to hold scenario benchmark
func GetAccountsAndTransactionsFromScenarios ¶
func GetAccountsAndTransactionsFromScenarios(testPath string) (stateAndBenchmarkInfo ScenarioWithBenchmark, err error)
GetAccountsAndTransactionsFromScenarios will retrieve the ScenarioWithBenchmark component
type TestAccount ¶
type TestAccount struct {
// contains filtered or unexported fields
}
TestAccount defines the test account structure
func NewTestAccount ¶
func NewTestAccount() *TestAccount
NewTestAccount will create a new instance of type TestAccount
func SetNewAccount ¶
func SetNewAccount(nonce uint64, address []byte, balance *big.Int, storage map[string][]byte, code []byte, ownerAddress []byte) *TestAccount
SetNewAccount will create a new TestAccount
func (*TestAccount) GetAddress ¶
func (tAcc *TestAccount) GetAddress() []byte
GetAddress gets the address
func (*TestAccount) GetBalance ¶
func (tAcc *TestAccount) GetBalance() *big.Int
GetBalance gets the balance
func (*TestAccount) GetStorage ¶
func (tAcc *TestAccount) GetStorage() map[string][]byte
GetStorage gets the storage
func (*TestAccount) WithAddress ¶
func (tAcc *TestAccount) WithAddress(address []byte) *TestAccount
WithAddress sets the address
func (*TestAccount) WithBalance ¶
func (tAcc *TestAccount) WithBalance(balance *big.Int) *TestAccount
WithBalance sets the balance
func (*TestAccount) WithCode ¶
func (tAcc *TestAccount) WithCode(code []byte) *TestAccount
WithCode sets the account's code
func (*TestAccount) WithNonce ¶
func (tAcc *TestAccount) WithNonce(nonce uint64) *TestAccount
WithNonce sets the nonce
func (*TestAccount) WithOwner ¶
func (tAcc *TestAccount) WithOwner(owner []byte) *TestAccount
WithOwner sets the owner
func (*TestAccount) WithStorage ¶
func (tAcc *TestAccount) WithStorage(storage map[string][]byte) *TestAccount
WithStorage sets the account's storage
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction defines the test tranaction structure
func CreateDeployTransaction ¶
func CreateDeployTransaction( args [][]byte, scCodePath string, sndAddr []byte, gasLimit uint64, gasPrice uint64, ) *Transaction
CreateDeployTransaction creates a deploy transaction
func CreateTransaction ¶
func CreateTransaction( function string, args [][]byte, nonce uint64, value *big.Int, esdtTransfers []*scenmodel.ESDTTxData, sndAddr []byte, rcvAddr []byte, gasLimit uint64, gasPrice uint64, ) *Transaction
CreateTransaction will create a transaction based on the parameters provided
func CreateUpgradeTransaction ¶
func CreateUpgradeTransaction( args [][]byte, scCodePath string, sndAddr []byte, rcvAddr []byte, gasLimit uint64, gasPrice uint64, ) *Transaction
CreateUpgradeTransaction creates a deploy transaction
func NewTransaction ¶
func NewTransaction() *Transaction
NewTransaction creates a new transaction instance
func (*Transaction) GetCallArguments ¶
func (tx *Transaction) GetCallArguments() [][]byte
GetCallArguments gets the call arguments
func (*Transaction) GetCallFunction ¶
func (tx *Transaction) GetCallFunction() string
GetCallFunction gets the call function
func (*Transaction) GetCallValue ¶
func (tx *Transaction) GetCallValue() *big.Int
GetCallValue gets the call value
func (*Transaction) GetDeployData ¶
func (tx *Transaction) GetDeployData() []byte
func (*Transaction) GetESDTTransfers ¶
func (tx *Transaction) GetESDTTransfers() []*scenmodel.ESDTTxData
GetESDTTransfers gets the ESDT transfers
func (*Transaction) GetGasLimitAndPrice ¶
func (tx *Transaction) GetGasLimitAndPrice() (uint64, uint64)
GetGasLimitAndPrice gets the gas limit & gas price
func (*Transaction) GetReceiverAddress ¶
func (tx *Transaction) GetReceiverAddress() []byte
GetReceiverAddress gets the receiver address
func (*Transaction) GetSenderAddress ¶
func (tx *Transaction) GetSenderAddress() []byte
GetSenderAddress gets the sender address
func (*Transaction) WithCallArguments ¶
func (tx *Transaction) WithCallArguments(arguments [][]byte) *Transaction
WithCallArguments sets the call arguments
func (*Transaction) WithCallFunction ¶
func (tx *Transaction) WithCallFunction(functionName string) *Transaction
WithCallFunction sets the call function
func (*Transaction) WithCallValue ¶
func (tx *Transaction) WithCallValue(value *big.Int) *Transaction
WithCallValue sets the call value
func (*Transaction) WithDeployData ¶
func (tx *Transaction) WithDeployData(scCodePath string, args [][]byte) *Transaction
WithDeployData sets the deploy data: sc code + arguments
func (*Transaction) WithESDTTransfers ¶
func (tx *Transaction) WithESDTTransfers(esdtTransfers []*scenmodel.ESDTTxData) *Transaction
WithESDTTransfers sets the ESDT transafers
func (*Transaction) WithGasLimitAndPrice ¶
func (tx *Transaction) WithGasLimitAndPrice(gasLimit, gasPrice uint64) *Transaction
WithGasLimitAndPrice sets the gas limit & gas price
func (*Transaction) WithNonce ¶
func (tx *Transaction) WithNonce(nonce uint64) *Transaction
WithNonce sets the nonce
func (*Transaction) WithReceiverAddress ¶
func (tx *Transaction) WithReceiverAddress(address []byte) *Transaction
WithReceiverAddress sets the receiver address
func (*Transaction) WithSenderAddress ¶
func (tx *Transaction) WithSenderAddress(address []byte) *Transaction
WithSenderAddress sets the sender address