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 CreateDeployTxDataNonPayable ¶
CreateDeployTxDataNonPayable -
func CreateDeployTxDataWithCodeMetadata ¶
CreateDeployTxDataWithCodeMetadata -
Types ¶
type RewardsProcessor ¶
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 EnableRoundsHandler process.EnableRoundsHandler RoundNotifier process.RoundNotifier EnableEpochsHandler common.EnableEpochsHandler UnsignexTxHandler process.TransactionFeeHandler EconomicsFee process.FeeHandler LastConsumedFee uint64 WasmVMChangeLocker common.Locker ScAddress []byte ScCodeMetadata vmcommon.CodeMetadata Accounts *state.AccountsDB TxProcessor process.TransactionProcessor ScProcessor scrCommon.TestSmartContractProcessor QueryService external.SCQueryService VMContainer process.VirtualMachinesContainer BlockchainHook *hooks.BlockChainHookImpl RewardsProcessor RewardsProcessor LastTxHash []byte SCRForwarder *mock.IntermediateTransactionHandlerMock LastSCResults []*smartContractResult.SmartContractResult }
TestContext -
func SetupTestContextWithGasSchedule ¶
func SetupTestContextWithGasSchedule(t *testing.T, gasSchedule map[string]map[string]uint64) *TestContext
SetupTestContextWithGasSchedule -
func SetupTestContextWithGasSchedulePath ¶
func SetupTestContextWithGasSchedulePath(t *testing.T, gasScheduleConfigPath string) *TestContext
SetupTestContextWithGasSchedulePath -
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 ¶
func (context *TestContext) ExecuteSCWithValue(sender *testParticipant, txData string, value *big.Int) error
ExecuteSCWithValue -
func (*TestContext) GetAccountBalance ¶
func (context *TestContext) GetAccountBalance(participant *testParticipant) *big.Int
GetAccountBalance -
func (*TestContext) GetAccountBalanceDelta ¶
func (context *TestContext) GetAccountBalanceDelta(participant *testParticipant) *big.Int
GetAccountBalanceDelta -
func (*TestContext) GetCompositeTestError ¶
func (context *TestContext) GetCompositeTestError() error
GetCompositeTestError -
func (*TestContext) InitAdditionalParticipants ¶
func (context *TestContext) InitAdditionalParticipants(num int)
InitAdditionalParticipants -
func (*TestContext) QuerySCBigInt ¶
func (context *TestContext) QuerySCBigInt(function string, args [][]byte) *big.Int
QuerySCBigInt -
func (*TestContext) QuerySCBytes ¶
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 ¶
func (context *TestContext) QuerySCString(function string, args [][]byte) string
QuerySCString -
func (*TestContext) TakeAccountBalanceSnapshot ¶
func (context *TestContext) TakeAccountBalanceSnapshot(participant *testParticipant)
TakeAccountBalanceSnapshot -
func (*TestContext) UpdateLastSCResults ¶
func (context *TestContext) UpdateLastSCResults() error
UpdateLastSCResults --
Click to show internal directories.
Click to hide internal directories.