Documentation ¶
Index ¶
- Constants
- Variables
- func CreateDeployTxData(scCode string) string
- func CreateDeployTxDataNonPayable(scCode string) string
- func CreateDeployTxDataWithCodeMetadata(scCode string, codeMetadataHex string) string
- func FormatHexNumber(number uint64) string
- func GetSCCode(fileName string) string
- func RequireAlmostEquals(t *testing.T, expected Balance, actual Balance)
- type Balance
- type RewardsProcessor
- type TestContext
- func (context *TestContext) Close()
- func (context *TestContext) DeploySC(wasmPath string, parametersString string) error
- func (context *TestContext) ExecuteSC(sender *testParticipant, txData string) error
- func (context *TestContext) ExecuteSCWithValue(sender *testParticipant, txData string, value *big.Int) error
- func (context *TestContext) GetAccountBalance(participant *testParticipant) *big.Int
- func (context *TestContext) GetAccountBalanceDelta(participant *testParticipant) *big.Int
- func (context *TestContext) GetCompositeTestError() error
- func (context *TestContext) GoToEpoch(epoch int)
- func (context *TestContext) InitAdditionalParticipants(num int)
- func (context *TestContext) QuerySCBigInt(function string, args [][]byte) *big.Int
- func (context *TestContext) QuerySCBytes(function string, args [][]byte) []byte
- func (context *TestContext) QuerySCInt(function string, args [][]byte) uint64
- func (context *TestContext) QuerySCString(function string, args [][]byte) string
- func (context *TestContext) TakeAccountBalanceSnapshot(participant *testParticipant)
- func (context *TestContext) UpdateLastSCResults() error
- func (context *TestContext) UpgradeSC(wasmPath string, parametersString string) error
Constants ¶
View Source
const DummyCodeMetadataHex = "0102"
DummyCodeMetadataHex -
View Source
const VMTypeHex = "0500"
VMTypeHex -
Variables ¶
View Source
var DNSAddresses = make(map[string]struct{})
DNSAddresses --
Functions ¶
func CreateDeployTxData ¶ added in v1.0.103
CreateDeployTxData -
func CreateDeployTxDataNonPayable ¶ added in v1.1.39
CreateDeployTxDataNonPayable -
func CreateDeployTxDataWithCodeMetadata ¶ added in v1.3.7
CreateDeployTxDataWithCodeMetadata -
Types ¶
type RewardsProcessor ¶ added in v1.1.1
RewardsProcessor -
type TestContext ¶
type TestContext struct { T *testing.T Round uint64 Owner testParticipant Alice testParticipant Bob testParticipant Carol testParticipant Participants []*testParticipant GasLimit uint64 GasSchedule map[string]map[string]uint64 EpochNotifier process.EpochNotifier UnsignexTxHandler process.TransactionFeeHandler EconomicsFee process.FeeHandler LastConsumedFee uint64 ArwenChangeLocker common.Locker ScAddress []byte ScCodeMetadata vmcommon.CodeMetadata Accounts *state.AccountsDB TxProcessor process.TransactionProcessor ScProcessor *smartContract.TestScProcessor QueryService external.SCQueryService VMContainer process.VirtualMachinesContainer BlockchainHook *hooks.BlockChainHookImpl RewardsProcessor RewardsProcessor LastTxHash []byte SCRForwarder *mock.IntermediateTransactionHandlerMock LastSCResults []*smartContractResult.SmartContractResult }
TestContext -
func SetupTestContextWithGasSchedulePath ¶ added in v1.3.29
func SetupTestContextWithGasSchedulePath(t *testing.T, gasScheduleConfigPath string) *TestContext
SetupTestContextWithGasSchedulePath -
func (*TestContext) Close ¶ added in v0.0.5
func (context *TestContext) Close()
Close closes the test context
func (*TestContext) DeploySC ¶
func (context *TestContext) DeploySC(wasmPath string, parametersString string) error
DeploySC -
func (*TestContext) ExecuteSC ¶
func (context *TestContext) ExecuteSC(sender *testParticipant, txData string) error
ExecuteSC -
func (*TestContext) ExecuteSCWithValue ¶ added in v1.1.1
func (context *TestContext) ExecuteSCWithValue(sender *testParticipant, txData string, value *big.Int) error
ExecuteSCWithValue -
func (*TestContext) GetAccountBalance ¶ added in v1.1.1
func (context *TestContext) GetAccountBalance(participant *testParticipant) *big.Int
GetAccountBalance -
func (*TestContext) GetAccountBalanceDelta ¶ added in v1.1.1
func (context *TestContext) GetAccountBalanceDelta(participant *testParticipant) *big.Int
GetAccountBalanceDelta -
func (*TestContext) GetCompositeTestError ¶ added in v1.3.19
func (context *TestContext) GetCompositeTestError() error
GetCompositeTestError -
func (*TestContext) GoToEpoch ¶ added in v1.1.1
func (context *TestContext) GoToEpoch(epoch int)
GoToEpoch -
func (*TestContext) InitAdditionalParticipants ¶ added in v1.1.1
func (context *TestContext) InitAdditionalParticipants(num int)
InitAdditionalParticipants -
func (*TestContext) QuerySCBigInt ¶ added in v1.1.1
func (context *TestContext) QuerySCBigInt(function string, args [][]byte) *big.Int
QuerySCBigInt -
func (*TestContext) QuerySCBytes ¶ added in v1.0.103
func (context *TestContext) QuerySCBytes(function string, args [][]byte) []byte
QuerySCBytes -
func (*TestContext) QuerySCInt ¶
func (context *TestContext) QuerySCInt(function string, args [][]byte) uint64
QuerySCInt -
func (*TestContext) QuerySCString ¶ added in v1.0.103
func (context *TestContext) QuerySCString(function string, args [][]byte) string
QuerySCString -
func (*TestContext) TakeAccountBalanceSnapshot ¶ added in v1.1.1
func (context *TestContext) TakeAccountBalanceSnapshot(participant *testParticipant)
TakeAccountBalanceSnapshot -
func (*TestContext) UpdateLastSCResults ¶ added in v1.1.1
func (context *TestContext) UpdateLastSCResults() error
UpdateLastSCResults --
Click to show internal directories.
Click to hide internal directories.