Documentation
¶
Overview ¶
Copyright Tharsis Labs Ltd.(Evmos) SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)
Index ¶
- Constants
- Variables
- func CreateExrpApp(chainID string, customBaseAppOptions ...func(*baseapp.BaseApp)) *app.App
- func CustomizeGenesis(exrpApp *app.App, customGen CustomGenesisState, genesisState app.GenesisState) (app.GenesisState, error)
- func GetAuthClient(n NetworkKeepers) authtypes.QueryClient
- func GetAuthzClient(n NetworkKeepers) authz.QueryClient
- func GetBankClient(n NetworkKeepers) banktypes.QueryClient
- func GetDistrClient(n NetworkKeepers) distrtypes.QueryClient
- func GetERC20Client(n NetworkKeepers) erc20types.QueryClient
- func GetEvmClient(n NetworkKeepers) evmtypes.QueryClient
- func GetFeeMarketClient(n NetworkKeepers) feemarkettypes.QueryClient
- func GetGovClient(n NetworkKeepers) govtypes.QueryClient
- func GetPoaClient(n NetworkKeepers) poatypes.QueryClient
- func GetSlashingClient(n NetworkKeepers) slashingtypes.QueryClient
- func GetStakingClient(n NetworkKeepers) stakingtypes.QueryClient
- func MustGetIntegrationTestNodeHome() string
- func SetupSdkConfig()
- type ChainCoins
- func (cc ChainCoins) BaseCoin() network.CoinInfo
- func (cc ChainCoins) BaseDecimals() evmtypes.Decimals
- func (cc ChainCoins) BaseDenom() string
- func (cc ChainCoins) DenomDecimalsMap() map[string]evmtypes.Decimals
- func (cc ChainCoins) EVMCoin() network.CoinInfo
- func (cc ChainCoins) EVMDecimals() evmtypes.Decimals
- func (cc ChainCoins) EVMDenom() string
- func (cc ChainCoins) IsBaseEqualToEVM() bool
- type Config
- type ConfigOption
- func WithAmountOfValidators(amount int) ConfigOption
- func WithBalances(balances ...banktypes.Balance) ConfigOption
- func WithBondDenom(denom string) ConfigOption
- func WithCustomBaseAppOpts(opts ...func(*baseapp.BaseApp)) ConfigOption
- func WithCustomGenesis(customGenesis CustomGenesisState) ConfigOption
- func WithDenom(denom string) ConfigOption
- func WithMaxValidators(maxValidators uint32) ConfigOption
- func WithMinDepositAmt(minDepositAmt sdkmath.Int) ConfigOption
- func WithOtherDenoms(otherDenoms []string) ConfigOption
- func WithPreFundedAccounts(accounts ...sdktypes.AccAddress) ConfigOption
- func WithQuorum(quorum string) ConfigOption
- func WithValidatorOperators(keys []sdktypes.AccAddress) ConfigOption
- type CustomGenesisState
- type GenSetupFn
- type Network
- type NetworkKeepers
Constants ¶
const (
ChainID = "exrp_1449999-1"
)
Variables ¶
var DefaultConsensusParams = &cmtproto.ConsensusParams{ Block: &cmtproto.BlockParams{ MaxBytes: 200000, MaxGas: -1, }, Evidence: &cmtproto.EvidenceParams{ MaxAgeNumBlocks: 302400, MaxAgeDuration: 504 * time.Hour, MaxBytes: 10000, }, Validator: &cmtproto.ValidatorParams{ PubKeyTypes: []string{ cmttypes.ABCIPubKeyTypeEd25519, }, }, }
DefaultConsensusParams defines the default Tendermint consensus params used in Evmos testing.
Functions ¶
func CreateExrpApp ¶
createExrpApp creates an exrp app
func CustomizeGenesis ¶
func CustomizeGenesis(exrpApp *app.App, customGen CustomGenesisState, genesisState app.GenesisState) (app.GenesisState, error)
CustomizeGenesis modifies genesis state if there're any custom genesis state for specific modules
func GetAuthClient ¶
func GetAuthClient(n NetworkKeepers) authtypes.QueryClient
func GetAuthzClient ¶
func GetAuthzClient(n NetworkKeepers) authz.QueryClient
func GetBankClient ¶
func GetBankClient(n NetworkKeepers) banktypes.QueryClient
func GetDistrClient ¶
func GetDistrClient(n NetworkKeepers) distrtypes.QueryClient
func GetERC20Client ¶
func GetERC20Client(n NetworkKeepers) erc20types.QueryClient
func GetEvmClient ¶
func GetEvmClient(n NetworkKeepers) evmtypes.QueryClient
func GetFeeMarketClient ¶
func GetFeeMarketClient(n NetworkKeepers) feemarkettypes.QueryClient
func GetGovClient ¶
func GetGovClient(n NetworkKeepers) govtypes.QueryClient
func GetPoaClient ¶
func GetPoaClient(n NetworkKeepers) poatypes.QueryClient
func GetSlashingClient ¶
func GetSlashingClient(n NetworkKeepers) slashingtypes.QueryClient
func GetStakingClient ¶
func GetStakingClient(n NetworkKeepers) stakingtypes.QueryClient
func MustGetIntegrationTestNodeHome ¶
func MustGetIntegrationTestNodeHome() string
func SetupSdkConfig ¶
func SetupSdkConfig()
Types ¶
type ChainCoins ¶
type ChainCoins struct {
// contains filtered or unexported fields
}
func DefaultChainCoins ¶
func DefaultChainCoins() ChainCoins
func (ChainCoins) BaseCoin ¶
func (cc ChainCoins) BaseCoin() network.CoinInfo
func (ChainCoins) BaseDecimals ¶
func (cc ChainCoins) BaseDecimals() evmtypes.Decimals
func (ChainCoins) BaseDenom ¶
func (cc ChainCoins) BaseDenom() string
func (ChainCoins) DenomDecimalsMap ¶
func (cc ChainCoins) DenomDecimalsMap() map[string]evmtypes.Decimals
DenomDecimalsMap returns a map of unique Denom -> Decimals for the chain coins.
func (ChainCoins) EVMCoin ¶
func (cc ChainCoins) EVMCoin() network.CoinInfo
func (ChainCoins) EVMDecimals ¶
func (cc ChainCoins) EVMDecimals() evmtypes.Decimals
func (ChainCoins) EVMDenom ¶
func (cc ChainCoins) EVMDenom() string
func (ChainCoins) IsBaseEqualToEVM ¶
func (cc ChainCoins) IsBaseEqualToEVM() bool
type Config ¶
type Config struct {
ChainID string
EIP155ChainID *big.Int
AmountOfValidators int
PreFundedAccounts []sdktypes.AccAddress
Balances []banktypes.Balance
BondDenom string
MaxValidators uint32
Denom string
CustomGenesisState CustomGenesisState
GenesisBytes []byte
OtherCoinDenom []string
OperatorsAddrs []sdktypes.AccAddress
CustomBaseAppOpts []func(*baseapp.BaseApp)
MinDepositAmt sdkmath.Int
Quorum string
ChainCoins ChainCoins
}
Config defines the configuration for a chain. It allows for customization of the network to adjust to testing needs.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default configuration for a chain.
type ConfigOption ¶
type ConfigOption func(*Config)
ConfigOption defines a function that can modify the NetworkConfig. The purpose of this is to force to be declarative when the default configuration requires to be changed.
func WithAmountOfValidators ¶
func WithAmountOfValidators(amount int) ConfigOption
WithAmountOfValidators sets the amount of validators for the network.
func WithBalances ¶
func WithBalances(balances ...banktypes.Balance) ConfigOption
WithBalances sets the specific balances for the pre-funded accounts, that are being set up for the network.
func WithBondDenom ¶
func WithBondDenom(denom string) ConfigOption
WithBondDenom sets the bond denom for the network.
func WithCustomBaseAppOpts ¶
func WithCustomBaseAppOpts(opts ...func(*baseapp.BaseApp)) ConfigOption
WithCustomBaseAppOpts sets custom base app options for the network.
func WithCustomGenesis ¶
func WithCustomGenesis(customGenesis CustomGenesisState) ConfigOption
WithCustomGenesis sets the custom genesis of the network for specific modules.
func WithDenom ¶
func WithDenom(denom string) ConfigOption
WithDenom sets the denom for the network.
func WithMaxValidators ¶
func WithMaxValidators(maxValidators uint32) ConfigOption
WithMaxValidators sets the max validators for the network.
func WithMinDepositAmt ¶
func WithMinDepositAmt(minDepositAmt sdkmath.Int) ConfigOption
WithMinDepositAmt sets the min deposit amount for the network.
func WithOtherDenoms ¶
func WithOtherDenoms(otherDenoms []string) ConfigOption
WithOtherDenoms sets other possible coin denominations for the network.
func WithPreFundedAccounts ¶
func WithPreFundedAccounts(accounts ...sdktypes.AccAddress) ConfigOption
WithPreFundedAccounts sets the pre-funded accounts for the network.
func WithQuorum ¶
func WithQuorum(quorum string) ConfigOption
func WithValidatorOperators ¶
func WithValidatorOperators(keys []sdktypes.AccAddress) ConfigOption
WithValidatorOperators overwrites the used operator address for the network instantiation.
type CustomGenesisState ¶
type CustomGenesisState map[string]interface{}
type GenSetupFn ¶
type GenSetupFn func(exrpApp *app.App, genesisState app.GenesisState, customGenesis interface{}) (app.GenesisState, error)
GenSetupFn is the type for the module genesis setup functions
func GenStateSetter ¶
func GenStateSetter[T proto.Message](moduleName string) GenSetupFn
GenStateSetter is a generic function to set module-specific genesis state
type Network ¶
type Network interface {
// Keepers
NetworkKeepers
// Clients
BroadcastTxSync(txBytes []byte) (abcitypes.ExecTxResult, error)
Simulate(txBytes []byte) (*txtypes.SimulateResponse, error)
CheckTx(txBytes []byte) (*abcitypes.ResponseCheckTx, error)
// GetIBCChain returns the IBC test chain.
// NOTE: this is only used for testing IBC related functionality.
// The idea is to deprecate this eventually.
GetIBCChain(t *testing.T, coord *ibctesting.Coordinator) *ibctesting.TestChain
GetEncodingConfig() sdktestutil.TestEncodingConfig
// Getters
GetContext() sdktypes.Context
GetChainID() string
GetBondDenom() string
GetDenom() string
GetOtherDenoms() []string
GetValidators() []stakingtypes.Validator
// ABCI
NextBlock() error
NextBlockAfter(duration time.Duration) error
NextBlockWithTxs(txBytes ...[]byte) (*abcitypes.ResponseFinalizeBlock, error)
}
type NetworkKeepers ¶
type NetworkKeepers interface {
GetContext() sdktypes.Context
GetEncodingConfig() testutil.TestEncodingConfig
ERC20Keeper() erc20keeper.Keeper
EvmKeeper() evmkeeper.Keeper
GovKeeper() *govkeeper.Keeper
BankKeeper() bankkeeper.Keeper
StakingKeeper() *stakingkeeper.Keeper
SlashingKeeper() slashingkeeper.Keeper
DistrKeeper() distrkeeper.Keeper
AccountKeeper() authkeeper.AccountKeeper
AuthzKeeper() authzkeeper.Keeper
FeeMarketKeeper() feemarketkeeper.Keeper
PoaKeeper() poakeeper.Keeper
}