types

package
v12.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: LGPL-3.0 Imports: 65 Imported by: 0

Documentation

Index

Constants

View Source
const TendermintGovVotingPeriod = 5 * time.Second

Variables

This section is empty.

Functions

func NewChainApp

func NewChainApp(chainCfg ChainConfig, disableTendermint bool, testConfig TestConfig, encCfg params.EncodingConfig, db *MemDB, validatorAccounts TestAccounts, walletAccounts TestAccounts, genesisAccountBalance sdk.Coins, tempHolder *TemporaryHolder, logger log.Logger) (chainApp ChainApp, tendermintApp TendermintApp, validatorSet *tmtypes.ValidatorSet)

func NewIntegrationTestKeyring

func NewIntegrationTestKeyring(accounts TestAccounts) keyring.Keyring

func NewSigner

func NewSigner(sk cryptotypes.PrivKey) keyring.Signer

Types

type ChainApp

type ChainApp interface {
	App() abci.Application
	BaseApp() *baseapp.BaseApp
	IbcTestingApp() ibctesting.TestingApp
	InterfaceRegistry() codectypes.InterfaceRegistry

	AccountKeeper() *authkeeper.AccountKeeper
	BankKeeper() bankkeeper.Keeper
	DistributionKeeper() distkeeper.Keeper
	Erc20Keeper() *erc20keeper.Keeper
	EvmKeeper() *evmkeeper.Keeper
	FeeMarketKeeper() *feemarketkeeper.Keeper
	GovKeeper() *govkeeper.Keeper
	IbcTransferKeeper() *ibctransferkeeper.Keeper
	IbcKeeper() *ibckeeper.Keeper
	SlashingKeeper() *slashingkeeper.Keeper
	StakingKeeper() *stakingkeeper.Keeper

	FundAccount(ctx sdk.Context, account *TestAccount, amounts sdk.Coins) error
}

type ChainConfig

type ChainConfig struct {
	CosmosChainId    string
	BaseDenom        string
	Bech32Prefix     string
	EvmChainId       int64
	EvmChainIdBigInt *big.Int // dynamic: calculated from EvmChainId
}

type ChainConstantConfig

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

func NewChainConstantConfig

func NewChainConstantConfig(cosmosChainId, minDenom string, baseExponent int) ChainConstantConfig

func (ChainConstantConfig) GetBaseExponent

func (c ChainConstantConfig) GetBaseExponent() int

func (ChainConstantConfig) GetCosmosChainID

func (c ChainConstantConfig) GetCosmosChainID() string

func (ChainConstantConfig) GetMinDenom

func (c ChainConstantConfig) GetMinDenom() string

type MemDB

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

MemDB is a wrapper of Tendermint/CometBFT DB that is backward-compatible with CometBFT chains pre-rename package.

(eg: replace github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.29)

func WrapCometBftDB

func WrapCometBftDB(cDb cdb.DB) *MemDB

func (*MemDB) AsCometBFT

func (w *MemDB) AsCometBFT() cdb.DB

func (*MemDB) Close

func (w *MemDB) Close() error

func (*MemDB) Delete

func (w *MemDB) Delete(bytes []byte) error

func (*MemDB) DeleteSync

func (w *MemDB) DeleteSync(bytes []byte) error

func (*MemDB) Get

func (w *MemDB) Get(bytes []byte) ([]byte, error)

func (*MemDB) Has

func (w *MemDB) Has(key []byte) (bool, error)

func (*MemDB) Iterator

func (w *MemDB) Iterator(start, end []byte) (cdb.Iterator, error)

func (*MemDB) NewBatch

func (w *MemDB) NewBatch() cdb.Batch

func (*MemDB) Print

func (w *MemDB) Print() error

func (*MemDB) ReverseIterator

func (w *MemDB) ReverseIterator(start, end []byte) (cdb.Iterator, error)

func (*MemDB) Set

func (w *MemDB) Set(bytes []byte, bytes2 []byte) error

func (*MemDB) SetSync

func (w *MemDB) SetSync(bytes []byte, bytes2 []byte) error

func (*MemDB) Stats

func (w *MemDB) Stats() map[string]string

type QueryClients

type QueryClients struct {
	GrpcConnection          grpc1.ClientConn
	ClientQueryCtx          cosmosclient.Context
	TendermintRpcHttpClient *httpclient.HTTP
	Auth                    authtypes.QueryClient
	Bank                    banktypes.QueryClient
	Distribution            disttypes.QueryClient
	Erc20                   erc20types.QueryClient
	EVM                     evmtypes.QueryClient
	GovV1                   govtypesv1.QueryClient
	GovLegacy               govtypeslegacy.QueryClient
	IbcTransfer             ibctransfertypes.QueryClient
	Slashing                slashingtypes.QueryClient
	Staking                 stakingtypes.QueryClient
	ServiceClient           cosmostxtypes.ServiceClient
	Rpc                     *rpctypes.QueryClient
}

type ResponseDeliverEthTx

type ResponseDeliverEthTx struct {
	CosmosTxHash         string
	EthTxHash            string
	EvmError             string
	ResponseDeliverEthTx *abci.ResponseDeliverTx
}

func NewResponseDeliverEthTx

func NewResponseDeliverEthTx(responseDeliverTx *abci.ResponseDeliverTx) *ResponseDeliverEthTx

type TemporaryHolder

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

func NewTemporaryHolder

func NewTemporaryHolder() *TemporaryHolder

func (*TemporaryHolder) AddTempFile

func (h *TemporaryHolder) AddTempFile(file string)

func (*TemporaryHolder) CacheGenesisDoc

func (h *TemporaryHolder) CacheGenesisDoc(doc *tmtypes.GenesisDoc)

func (*TemporaryHolder) GetCachedGenesisDoc

func (h *TemporaryHolder) GetCachedGenesisDoc() (*tmtypes.GenesisDoc, bool)

func (*TemporaryHolder) GetTempFiles

func (h *TemporaryHolder) GetTempFiles() ([]string, bool)

type TendermintApp

type TendermintApp interface {
	TendermintNode() *nm.Node
	GetRpcAddr() (addr string, supported bool)
	Shutdown()
}

func NewTendermintApp

func NewTendermintApp(tendermintNode *nm.Node, rpcPort int) TendermintApp

type TestAccount

type TestAccount struct {
	PrivateKey *ethsecp256k1.PrivKey
	Signer     keyring.Signer
	Type       TestAccountType
}

func (TestAccount) ComputeContractAddress

func (a TestAccount) ComputeContractAddress(nonce uint64) common.Address

func (TestAccount) GetConsensusAddress

func (a TestAccount) GetConsensusAddress() sdk.ConsAddress

func (TestAccount) GetCosmosAddress

func (a TestAccount) GetCosmosAddress() sdk.AccAddress

func (TestAccount) GetEthAddress

func (a TestAccount) GetEthAddress() common.Address

func (TestAccount) GetPubKey

func (a TestAccount) GetPubKey() cryptotypes.PubKey

func (TestAccount) GetSdkPubKey

func (a TestAccount) GetSdkPubKey() cryptotypes.PubKey

func (TestAccount) GetTmPrivKey

func (a TestAccount) GetTmPrivKey() tmcrypto.PrivKey

func (TestAccount) GetTmPubKey

func (a TestAccount) GetTmPubKey() tmcrypto.PubKey

func (TestAccount) GetValidatorAddress

func (a TestAccount) GetValidatorAddress() sdk.ValAddress

GetValidatorAddress returns validator address of the account, deliver from sdk pubkey. Should use suite.GetValidatorAddress() instead for correcting with Tendermint node mode.

type TestAccountType

type TestAccountType int8
const (
	TestAccountTypeValidator TestAccountType = iota
	TestAccountTypeWallet
)

type TestAccounts

type TestAccounts []*TestAccount

func (TestAccounts) Number

func (a TestAccounts) Number(num int) *TestAccount

type TestConfig

type TestConfig struct {
	SecondaryDenomUnits []banktypes.DenomUnit
	InitBalanceAmount   sdkmath.Int
	DefaultFeeAmount    sdkmath.Int
	DisableTendermint   bool
}

Jump to

Keyboard shortcuts

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