exrpintegration

package
v9.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 56 Imported by: 0

Documentation

Overview

Copyright Tharsis Labs Ltd.(Evmos) SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)

Copyright Tharsis Labs Ltd.(Evmos) SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)

Copyright Tharsis Labs Ltd.(Evmos) SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultBondedAmount is the amount of tokens that each validator will have initially bonded
	DefaultBondedAmount = sdktypes.TokensFromConsensusPower(1, sdktypes.DefaultPowerReduction)
	// PrefundedAccountInitialBalance is the amount of tokens that each prefunded account has at genesis
	PrefundedAccountInitialBalance, _ = sdkmath.NewIntFromString("100000000000000000000000") // 100k
)

Functions

func BuildFinalizeBlockReq

func BuildFinalizeBlockReq(header cmtproto.Header, validators []*cmttypes.Validator, validatorFlags []cmtproto.BlockIDFlag, misbehaviors []abcitypes.Misbehavior, txs ...[]byte) *abcitypes.RequestFinalizeBlock

buildFinalizeBlockReq is a helper function to build properly the FinalizeBlock request

func DefaultIntegrationConfig

func DefaultIntegrationConfig() exrpcommon.Config

DefaultIntegrationConfig returns the default configuration for a chain.

func GetCommitInfo

func GetCommitInfo(validators []*cmttypes.Validator, validatorFlags []cmtproto.BlockIDFlag) abcitypes.CommitInfo

Types

type BankCustomGenesisState

type BankCustomGenesisState struct {
	// contains filtered or unexported fields
}

type GovCustomGenesisState

type GovCustomGenesisState struct {
	// contains filtered or unexported fields
}

GovCustomGenesisState defines the gov genesis state

type IntegrationNetwork

type IntegrationNetwork struct {
	// contains filtered or unexported fields
}

IntegrationNetwork is the implementation of the Network interface for integration tests.

func New

New configures and initializes a new integration Network instance with the given configuration options. If no configuration options are provided it uses the default configuration.

It panics if an error occurs.

func (*IntegrationNetwork) AccountKeeper

func (n *IntegrationNetwork) AccountKeeper() authkeeper.AccountKeeper

func (*IntegrationNetwork) AuthzKeeper

func (n *IntegrationNetwork) AuthzKeeper() authzkeeper.Keeper

func (*IntegrationNetwork) BankKeeper

func (n *IntegrationNetwork) BankKeeper() bankkeeper.Keeper

func (*IntegrationNetwork) BroadcastTxSync

func (n *IntegrationNetwork) BroadcastTxSync(txBytes []byte) (abcitypes.ExecTxResult, error)

BroadcastTxSync broadcasts the given txBytes to the network and returns the response. TODO - this should be change to gRPC

func (*IntegrationNetwork) CheckTx

func (n *IntegrationNetwork) CheckTx(txBytes []byte) (*abcitypes.ResponseCheckTx, error)

CheckTx calls the BaseApp's CheckTx method with the given txBytes to the network and returns the response.

func (*IntegrationNetwork) DistrKeeper

func (n *IntegrationNetwork) DistrKeeper() distrkeeper.Keeper

func (*IntegrationNetwork) ERC20Keeper

func (n *IntegrationNetwork) ERC20Keeper() erc20keeper.Keeper

func (*IntegrationNetwork) EvmKeeper

func (n *IntegrationNetwork) EvmKeeper() evmkeeper.Keeper

func (*IntegrationNetwork) FeeMarketKeeper

func (n *IntegrationNetwork) FeeMarketKeeper() feemarketkeeper.Keeper

func (*IntegrationNetwork) GetAuthClient

func (n *IntegrationNetwork) GetAuthClient() authtypes.QueryClient

func (*IntegrationNetwork) GetAuthzClient

func (n *IntegrationNetwork) GetAuthzClient() authz.QueryClient

func (*IntegrationNetwork) GetBankClient

func (n *IntegrationNetwork) GetBankClient() banktypes.QueryClient

func (*IntegrationNetwork) GetBaseDecimal

func (n *IntegrationNetwork) GetBaseDecimal() evmtypes.Decimals

func (*IntegrationNetwork) GetBaseDenom

func (n *IntegrationNetwork) GetBaseDenom() string

GetDenom returns the network's denom

func (*IntegrationNetwork) GetBondDenom

func (n *IntegrationNetwork) GetBondDenom() string

GetBondDenom returns the network's bond denom

func (*IntegrationNetwork) GetChainID

func (n *IntegrationNetwork) GetChainID() string

GetChainID returns the network's chainID

func (*IntegrationNetwork) GetContext

func (n *IntegrationNetwork) GetContext() sdktypes.Context

GetContext returns the network's context

func (*IntegrationNetwork) GetDistrClient

func (n *IntegrationNetwork) GetDistrClient() distrtypes.QueryClient

func (*IntegrationNetwork) GetEIP155ChainID

func (n *IntegrationNetwork) GetEIP155ChainID() *big.Int

GetEIP155ChainID returns the network EIp-155 chainID number

func (*IntegrationNetwork) GetERC20Client

func (n *IntegrationNetwork) GetERC20Client() erc20types.QueryClient

func (*IntegrationNetwork) GetEVMChainConfig

func (n *IntegrationNetwork) GetEVMChainConfig() *gethparams.ChainConfig

GetChainConfig returns the network's chain config

func (*IntegrationNetwork) GetEncodingConfig

func (n *IntegrationNetwork) GetEncodingConfig() sdktestutil.TestEncodingConfig

GetOtherDenoms returns network's other supported denoms

func (*IntegrationNetwork) GetEvmClient

func (n *IntegrationNetwork) GetEvmClient() evmtypes.QueryClient

func (*IntegrationNetwork) GetFeeMarketClient

func (n *IntegrationNetwork) GetFeeMarketClient() feemarkettypes.QueryClient

func (*IntegrationNetwork) GetGovClient

func (n *IntegrationNetwork) GetGovClient() govtypes.QueryClient

func (*IntegrationNetwork) GetIBCChain

GetIBCChain returns a TestChain instance for the given network. Note: the sender accounts are not populated. Do not use this accounts to send transactions during tests. The keyring should be used instead.

func (*IntegrationNetwork) GetMinDepositAmt

func (n *IntegrationNetwork) GetMinDepositAmt() sdkmath.Int

GetMinDepositAmt returns the network's min deposit amount

func (*IntegrationNetwork) GetMintClient

func (n *IntegrationNetwork) GetMintClient() minttypes.QueryClient

NOTE: Not needed

func (*IntegrationNetwork) GetOtherDenoms

func (n *IntegrationNetwork) GetOtherDenoms() []string

GetOtherDenoms returns network's other supported denoms

func (*IntegrationNetwork) GetStakingClient

func (n *IntegrationNetwork) GetStakingClient() stakingtypes.QueryClient

func (*IntegrationNetwork) GetValidatorSet

func (n *IntegrationNetwork) GetValidatorSet() *cmttypes.ValidatorSet

GetValidatorSet returns the network's validator set

func (*IntegrationNetwork) GetValidatorSigners

func (n *IntegrationNetwork) GetValidatorSigners() map[string]cmttypes.PrivValidator

GetValidatorSigners returns the network's validator signers

func (*IntegrationNetwork) GetValidators

func (n *IntegrationNetwork) GetValidators() []stakingtypes.Validator

GetValidators returns the network's validators

func (*IntegrationNetwork) GovKeeper

func (n *IntegrationNetwork) GovKeeper() *govkeeper.Keeper

func (*IntegrationNetwork) NextBlock

func (n *IntegrationNetwork) NextBlock() error

NextBlock is a private helper function that runs the EndBlocker logic, commits the changes, updates the header and runs the BeginBlocker

func (*IntegrationNetwork) NextBlockAfter

func (n *IntegrationNetwork) NextBlockAfter(duration time.Duration) error

NextBlockAfter is a private helper function that runs the FinalizeBlock logic, updates the context and commits the changes to have a block time after the given duration.

func (*IntegrationNetwork) NextBlockWithMisBehaviors

func (n *IntegrationNetwork) NextBlockWithMisBehaviors(misbehaviors []abcitypes.Misbehavior) error

NextBlockWithMisBehaviors is a helper function that runs the FinalizeBlock logic with the provided misbehaviors, updates the context and commits the changes to have a block time after the given duration.

func (*IntegrationNetwork) NextBlockWithTxs

func (n *IntegrationNetwork) NextBlockWithTxs(txBytes ...[]byte) (*abcitypes.ResponseFinalizeBlock, error)

NextBlockWithTxs is a helper function that runs the FinalizeBlock logic with the provided tx bytes, updates the context and commits the changes to have a block time after the given duration.

func (*IntegrationNetwork) NextNBlocksWithValidatorFlags

func (n *IntegrationNetwork) NextNBlocksWithValidatorFlags(blocks int64, validatorFlags []cmtproto.BlockIDFlag) error

NextNBlocksWithValidatorFlags is a helper function that runs the FinalizeBlock logic with the provided validator flags, updates the context and commits the changes to have a block time after the given duration.

func (*IntegrationNetwork) PoaKeeper

func (n *IntegrationNetwork) PoaKeeper() poakeeper.Keeper

func (*IntegrationNetwork) Simulate

func (n *IntegrationNetwork) Simulate(txBytes []byte) (*txtypes.SimulateResponse, error)

Simulate simulates the given txBytes to the network and returns the simulated response. TODO - this should be change to gRPC

func (*IntegrationNetwork) SlashingKeeper

func (n *IntegrationNetwork) SlashingKeeper() slashingkeeper.Keeper

func (*IntegrationNetwork) StakingKeeper

func (n *IntegrationNetwork) StakingKeeper() *stakingkeeper.Keeper

func (*IntegrationNetwork) WithIsCheckTxCtx

func (n *IntegrationNetwork) WithIsCheckTxCtx(isCheckTx bool) sdktypes.Context

WithIsCheckTxCtx switches the network's checkTx property

type Network

type Network interface {
	network.Network

	GetGovClient() govtypes.QueryClient

	GetEIP155ChainID() *big.Int
	GetValidatorSet() *cmttypes.ValidatorSet

	GetMinDepositAmt() sdkmath.Int
}

Network is the interface that wraps the methods to interact with integration test network.

It was designed to avoid users to access module's keepers directly and force integration tests to be closer to the real user's behavior.

type SlashingCustomGenesisState

type SlashingCustomGenesisState struct {
	// contains filtered or unexported fields
}

SlashingCustomGenesisState defines the corresponding validators signing info and missed blocks for the genesis state

type StakingCustomGenesisState

type StakingCustomGenesisState struct {
	// contains filtered or unexported fields
}

StakingCustomGenesisState defines the staking genesis state

type UnitTestIntegrationNetwork

type UnitTestIntegrationNetwork struct {
	IntegrationNetwork
	App *app.App
}

UnitTestIntegrationNetwork is the implementation of the Network interface for unit tests. It embeds the IntegrationNetwork struct to reuse its methods and makes the App public for easier testing.

func NewUnitTestNetwork

func NewUnitTestNetwork(opts ...exrpcommon.ConfigOption) *UnitTestIntegrationNetwork

NewUnitTestNetwork configures and initializes a new Evmos Network instance with the given configuration options. If no configuration options are provided it uses the default configuration.

It panics if an error occurs. Note: Only uses for Unit Tests

func (*UnitTestIntegrationNetwork) FundAccount

func (n *UnitTestIntegrationNetwork) FundAccount(addr sdktypes.AccAddress, coins sdktypes.Coins) error

FundAccount funds the given account with the given amount of coins.

func (*UnitTestIntegrationNetwork) GetStateDB

func (n *UnitTestIntegrationNetwork) GetStateDB() *statedb.StateDB

GetStateDB returns the state database for the current block.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL