Documentation
¶
Index ¶
- Constants
- Variables
- func EVMLogsForEvent(receipt *ethtypes.Receipt, address common.Address, topic common.Hash) []*ethtypes.Log
- func NewMsgCreateValidator(address sdk.ValAddress, pubKey cryptotypes.PubKey, amt sdkmath.Int) *stakingtypes.MsgCreateValidator
- func NewMsgDelegate(delegatorAddress sdk.AccAddress, validatorAddress sdk.ValAddress, ...) *stakingtypes.MsgDelegate
- type ContractArtifact
- type EVMReceiptRecorder
- type EVMTransactionResult
- type TestInput
- func (ti *TestInput) CommitEVMContractCall(t *testing.T, key *ecdsa.PrivateKey, receipts *EVMReceiptRecorder, ...) EVMTransactionResult
- func (ti *TestInput) CommitEVMTransaction(t *testing.T, key *ecdsa.PrivateKey, receipts *EVMReceiptRecorder, ...) EVMTransactionResult
- func (ti *TestInput) CommitTransaction(t *testing.T, txBytes []byte) *abci.ExecTxResult
- func (ti *TestInput) CommitTransactionResult(t *testing.T, txBytes []byte) *abci.ExecTxResult
- func (ti *TestInput) DeployEVMContract(t *testing.T, key *ecdsa.PrivateKey, receipts *EVMReceiptRecorder, ...) (common.Address, abi.ABI)
- func (ti *TestInput) EVMContext() sdk.Context
- func (ti *TestInput) InitAccountWithCoins(addr sdk.AccAddress, coins sdk.Coins) error
- func (ti *TestInput) QueryEVMContract(t *testing.T, from common.Address, address common.Address, contractABI abi.ABI, ...) []interface{}
Constants ¶
const ( TestChainID = "integration_37-1" ValidatorCount = 10 ValidatorSettlementIndex = ValidatorCount ReserveIndex = ValidatorCount + 1 TempIndex = ValidatorCount + 2 ProposerIndex = ValidatorCount + 3 TotalCount = ProposerIndex + 1 )
const DefaultEVMGasLimit = uint64(10_000_000)
DefaultEVMGasLimit is the gas budget for integration contract calls.
Variables ¶
var (
Pks = simtestutil.CreateTestPubKeys(TotalCount)
)
Functions ¶
func EVMLogsForEvent ¶ added in v1.14.0
func EVMLogsForEvent(receipt *ethtypes.Receipt, address common.Address, topic common.Hash) []*ethtypes.Log
EVMLogsForEvent selects logs emitted by an address with the given event signature.
func NewMsgCreateValidator ¶
func NewMsgCreateValidator(address sdk.ValAddress, pubKey cryptotypes.PubKey, amt sdkmath.Int) *stakingtypes.MsgCreateValidator
NewMsgCreateValidator test msg creator
func NewMsgDelegate ¶
func NewMsgDelegate(delegatorAddress sdk.AccAddress, validatorAddress sdk.ValAddress, amt sdkmath.Int) *stakingtypes.MsgDelegate
NewMsgDelegate test msg creator
Types ¶
type ContractArtifact ¶ added in v1.14.0
type ContractArtifact struct {
ABI json.RawMessage `json:"abi"`
Bytecode string `json:"bytecode"`
}
ContractArtifact contains a compiled contract's ABI and deployment bytecode.
type EVMReceiptRecorder ¶ added in v1.14.0
type EVMReceiptRecorder struct {
// contains filtered or unexported fields
}
EVMReceiptRecorder collects receipts when explicitly installed as an EVM keeper hook.
func (*EVMReceiptRecorder) Len ¶ added in v1.14.0
func (r *EVMReceiptRecorder) Len() int
type EVMTransactionResult ¶ added in v1.14.0
type EVMTransactionResult struct {
Response vmtypes.MsgEthereumTxResponse
Receipt *ethtypes.Receipt
Events []abci.Event
}
EVMTransactionResult contains the response, receipt and SDK events of a committed transaction.
type TestInput ¶
type TestInput struct {
App *xplaApp.XplaApp
Ctx sdk.Context
Cdc *codec.LegacyAmino
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
RewardKeeper rewardkeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
DistrKeeper distrkeeper.Keeper
VolunteerKeeper volunteerkeeper.Keeper
StakingHandler *stakingtestutil.Helper
}
TestInput nolint
func CreateTestInput ¶
CreateTestInput initializes keeper, EVM and IBC state with a proposer record. Signed transactions can start at block 1 without committing an empty block.
func (*TestInput) CommitEVMContractCall ¶ added in v1.14.0
func (ti *TestInput) CommitEVMContractCall(t *testing.T, key *ecdsa.PrivateKey, receipts *EVMReceiptRecorder, address common.Address, contractABI abi.ABI, method string, args ...interface{}) EVMTransactionResult
CommitEVMContractCall commits an ABI-encoded call and requires successful EVM execution.
func (*TestInput) CommitEVMTransaction ¶ added in v1.14.0
func (ti *TestInput) CommitEVMTransaction(t *testing.T, key *ecdsa.PrivateKey, receipts *EVMReceiptRecorder, to *common.Address, data []byte, gas uint64) EVMTransactionResult
CommitEVMTransaction signs and commits a transaction through the real block lifecycle. EVM execution failures are returned for rollback assertions; SDK failures fail the test.
func (*TestInput) CommitTransaction ¶ added in v1.14.0
CommitTransaction executes one transaction in the next block and commits its state. Test block timestamps use the block height as Unix seconds.
func (*TestInput) CommitTransactionResult ¶ added in v1.14.0
CommitTransactionResult executes and commits one transaction, returning SDK failures so callers can assert ante-handler rollback.
func (*TestInput) DeployEVMContract ¶ added in v1.14.0
func (ti *TestInput) DeployEVMContract(t *testing.T, key *ecdsa.PrivateKey, receipts *EVMReceiptRecorder, artifacts map[string]ContractArtifact, name string, args ...interface{}) (common.Address, abi.ABI)
DeployEVMContract commits a contract deployment and requires successful EVM execution.
func (*TestInput) EVMContext ¶ added in v1.14.0
EVMContext reads the latest committed state with a fresh gas meter. Its synthetic timestamp matches CommitTransaction's block-height clock.
func (*TestInput) InitAccountWithCoins ¶
func (*TestInput) QueryEVMContract ¶ added in v1.14.0
func (ti *TestInput) QueryEVMContract(t *testing.T, from common.Address, address common.Address, contractABI abi.ABI, method string, args ...interface{}) []interface{}
QueryEVMContract executes and decodes a contract call without committing state changes.