Documentation
¶
Index ¶
- Variables
- type BankCustomGenesisState
- type Config
- type ConfigOption
- func WithAmountOfValidators(amount int) ConfigOption
- func WithBalances(balances ...banktypes.Balance) ConfigOption
- func WithChainID(chainID string) ConfigOption
- func WithCustomBaseAppOpts(opts ...func(*baseapp.BaseApp)) ConfigOption
- func WithCustomGenesis(customGenesis CustomGenesisState) ConfigOption
- func WithDenom(denom string) ConfigOption
- func WithOtherDenoms(otherDenoms []string) ConfigOption
- func WithPreFundedAccounts(accounts ...sdktypes.AccAddress) ConfigOption
- func WithStartTime(startTime time.Time) ConfigOption
- func WithValidatorOperators(keys []sdktypes.AccAddress) ConfigOption
- type CustomGenesisState
- type GovCustomGenesisState
- type IntegrationNetwork
- func (n *IntegrationNetwork) BroadcastTxSync(txBytes []byte) (abcitypes.ExecTxResult, error)
- func (n *IntegrationNetwork) CheckTx(txBytes []byte) (*abcitypes.ResponseCheckTx, error)
- func (n *IntegrationNetwork) FundAccount(addr sdk.AccAddress, coins sdk.Coins) error
- func (n *IntegrationNetwork) FundAccountWithBaseDenom(addr sdk.AccAddress, amount sdkmath.Int) error
- func (n *IntegrationNetwork) GetAuthClient() authtypes.QueryClient
- func (n *IntegrationNetwork) GetAuthzClient() authz.QueryClient
- func (n *IntegrationNetwork) GetBankClient() banktypes.QueryClient
- func (n *IntegrationNetwork) GetChainID() string
- func (n *IntegrationNetwork) GetCoinomicsClient() coinomicstypes.QueryClient
- func (n *IntegrationNetwork) GetContext() sdktypes.Context
- func (n *IntegrationNetwork) GetDenom() string
- func (n *IntegrationNetwork) GetDistrClient() distrtypes.QueryClient
- func (n *IntegrationNetwork) GetEIP155ChainID() *big.Int
- func (n *IntegrationNetwork) GetERC20Client() erc20types.QueryClient
- func (n *IntegrationNetwork) GetEVMChainConfig() *gethparams.ChainConfig
- func (n *IntegrationNetwork) GetEncodingConfig() sdktestutil.TestEncodingConfig
- func (n *IntegrationNetwork) GetEpochsClient() epochstypes.QueryClient
- func (n *IntegrationNetwork) GetEthiqClient() ethiqtypes.QueryClient
- func (n *IntegrationNetwork) GetEvmClient() evmtypes.QueryClient
- func (n *IntegrationNetwork) GetFeeMarketClient() feemarkettypes.QueryClient
- func (n *IntegrationNetwork) GetGovClient() govtypes.QueryClient
- func (n *IntegrationNetwork) GetIBCChain(t *testing.T, coord *ibctesting.Coordinator) *ibctesting.TestChain
- func (n *IntegrationNetwork) GetLiquidVestingClient() liquidvestingtypes.QueryClient
- func (n *IntegrationNetwork) GetOtherDenoms() []string
- func (n *IntegrationNetwork) GetStakingClient() stakingtypes.QueryClient
- func (n *IntegrationNetwork) GetUCDAOClient() ucdaotypes.QueryClient
- func (n *IntegrationNetwork) GetValidators() []stakingtypes.Validator
- func (n *IntegrationNetwork) GetVestingClient() vestingtypes.QueryClient
- func (n *IntegrationNetwork) NextBlock() error
- func (n *IntegrationNetwork) NextBlockAfter(duration time.Duration) error
- func (n *IntegrationNetwork) NextBlockWithTxs(txBytes ...[]byte) (*abcitypes.ResponseFinalizeBlock, error)
- func (n *IntegrationNetwork) NextNBlocks(num int) error
- func (n *IntegrationNetwork) Simulate(txBytes []byte) (*txtypes.SimulateResponse, error)
- func (n *IntegrationNetwork) UpdateCoinomicsParams(params coinomicstypes.Params) error
- func (n *IntegrationNetwork) UpdateEvmParams(params evmtypes.Params) error
- func (n *IntegrationNetwork) UpdateFeeMarketParams(params feemarketypes.Params) error
- func (n *IntegrationNetwork) WithIsCheckTxCtx(isCheckTx bool) sdktypes.Context
- type Network
- type SlashingCustomGenesisState
- type StakingCustomGenesisState
- type UnitTestNetwork
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultBondedAmount is the amount of tokens that each validator will have initially bonded DefaultBondedAmount = sdktypes.TokensFromConsensusPower(1, types.PowerReduction) // PrefundedAccountInitialBalance is the amount of tokens that each prefunded account has at genesis PrefundedAccountInitialBalance, _ = sdkmath.NewIntFromString("100000000000000000000000") // 100k )
Functions ¶
This section is empty.
Types ¶
type BankCustomGenesisState ¶
type BankCustomGenesisState struct {
// contains filtered or unexported fields
}
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
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 WithChainID ¶
func WithChainID(chainID string) ConfigOption
WithChainID sets a custom chainID for the network. It panics if the chainID is invalid.
func WithCustomBaseAppOpts ¶ added in v1.9.0
func WithCustomBaseAppOpts(opts ...func(*baseapp.BaseApp)) ConfigOption
WithCustomBaseAppOpts sets custom base app options for the network.
func WithCustomGenesis ¶ added in v1.8.4
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 WithOtherDenoms ¶ added in v1.9.0
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 WithStartTime ¶ added in v1.9.0
func WithStartTime(startTime time.Time) ConfigOption
WithStartTime sets custom app start time.
func WithValidatorOperators ¶ added in v1.9.0
func WithValidatorOperators(keys []sdktypes.AccAddress) ConfigOption
WithValidatorOperators overwrites the used operator address for the network instantiation.
type CustomGenesisState ¶ added in v1.8.4
type CustomGenesisState map[string]interface{}
type GovCustomGenesisState ¶ added in v1.9.0
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 ¶
func New(opts ...ConfigOption) *IntegrationNetwork
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) 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 ¶ added in v1.9.0
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) FundAccount ¶
func (n *IntegrationNetwork) FundAccount(addr sdk.AccAddress, coins sdk.Coins) error
FundAccount funds the given account with the given amount of coins.
func (*IntegrationNetwork) FundAccountWithBaseDenom ¶
func (n *IntegrationNetwork) FundAccountWithBaseDenom(addr sdk.AccAddress, amount sdkmath.Int) error
FundAccountWithBaseDenom funds the given account with the given amount of the network's base denomination.
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) GetChainID ¶
func (n *IntegrationNetwork) GetChainID() string
GetChainID returns the network's chainID
func (*IntegrationNetwork) GetCoinomicsClient ¶
func (n *IntegrationNetwork) GetCoinomicsClient() coinomicstypes.QueryClient
func (*IntegrationNetwork) GetContext ¶
func (n *IntegrationNetwork) GetContext() sdktypes.Context
GetContext returns the network's context
func (*IntegrationNetwork) GetDenom ¶
func (n *IntegrationNetwork) GetDenom() string
GetDenom returns the network's denom
func (*IntegrationNetwork) GetDistrClient ¶ added in v1.9.0
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 ¶ added in v1.8.4
func (n *IntegrationNetwork) GetEVMChainConfig() *gethparams.ChainConfig
GetChainConfig returns the network's chain config
func (*IntegrationNetwork) GetEncodingConfig ¶ added in v1.9.0
func (n *IntegrationNetwork) GetEncodingConfig() sdktestutil.TestEncodingConfig
GetOtherDenoms returns network's other supported denoms
func (*IntegrationNetwork) GetEpochsClient ¶ added in v1.9.0
func (n *IntegrationNetwork) GetEpochsClient() epochstypes.QueryClient
func (*IntegrationNetwork) GetEthiqClient ¶ added in v1.9.3
func (n *IntegrationNetwork) GetEthiqClient() ethiqtypes.QueryClient
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 ¶
func (n *IntegrationNetwork) GetIBCChain(t *testing.T, coord *ibctesting.Coordinator) *ibctesting.TestChain
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) GetLiquidVestingClient ¶ added in v1.9.0
func (n *IntegrationNetwork) GetLiquidVestingClient() liquidvestingtypes.QueryClient
func (*IntegrationNetwork) GetOtherDenoms ¶ added in v1.9.0
func (n *IntegrationNetwork) GetOtherDenoms() []string
GetOtherDenoms returns network's other supported denoms
func (*IntegrationNetwork) GetStakingClient ¶
func (n *IntegrationNetwork) GetStakingClient() stakingtypes.QueryClient
func (*IntegrationNetwork) GetUCDAOClient ¶ added in v1.9.0
func (n *IntegrationNetwork) GetUCDAOClient() ucdaotypes.QueryClient
func (*IntegrationNetwork) GetValidators ¶
func (n *IntegrationNetwork) GetValidators() []stakingtypes.Validator
GetValidators returns the network's validators
func (*IntegrationNetwork) GetVestingClient ¶ added in v1.9.0
func (n *IntegrationNetwork) GetVestingClient() vestingtypes.QueryClient
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) NextBlockWithTxs ¶ added in v1.9.0
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) NextNBlocks ¶ added in v1.9.0
func (n *IntegrationNetwork) NextNBlocks(num int) error
NextNBlocks is a helper function that finalizes block and commits the changes, updates the header and runs the BeginBlocker for a give number of times.
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) UpdateCoinomicsParams ¶
func (n *IntegrationNetwork) UpdateCoinomicsParams(params coinomicstypes.Params) error
func (*IntegrationNetwork) UpdateEvmParams ¶
func (n *IntegrationNetwork) UpdateEvmParams(params evmtypes.Params) error
func (*IntegrationNetwork) UpdateFeeMarketParams ¶ added in v1.8.4
func (n *IntegrationNetwork) UpdateFeeMarketParams(params feemarketypes.Params) error
func (*IntegrationNetwork) WithIsCheckTxCtx ¶ added in v1.9.0
func (n *IntegrationNetwork) WithIsCheckTxCtx(isCheckTx bool) sdktypes.Context
WithIsCheckTxCtx switches the network's checkTx property
type Network ¶
type Network interface {
commonnetwork.Network
GetEIP155ChainID() *big.Int
GetEVMChainConfig() *gethparams.ChainConfig
// Clients
GetERC20Client() erc20types.QueryClient
GetEvmClient() evmtypes.QueryClient
GetGovClient() govtypes.QueryClient
GetCoinomicsClient() coinomicstypes.QueryClient
GetFeeMarketClient() feemarkettypes.QueryClient
GetEpochsClient() epochstypes.QueryClient
GetVestingClient() vestingtypes.QueryClient
GetLiquidVestingClient() liquidvestingtypes.QueryClient
GetUCDAOClient() ucdaotypes.QueryClient
}
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 ¶ added in v1.9.0
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 UnitTestNetwork ¶
type UnitTestNetwork struct {
IntegrationNetwork
App *app.Haqq
}
UnitTestNetwork 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 ...ConfigOption) *UnitTestNetwork
NewUnitTestNetwork configures and initializes a new Haqq 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 (*UnitTestNetwork) GetStateDB ¶
func (n *UnitTestNetwork) GetStateDB() *statedb.StateDB
GetStateDB returns the state database for the current block.