Documentation ¶
Index ¶
- func AddTestAddr(myApp *app.App, ctx sdk.Context, addr sdk.AccAddress, coins sdk.Coins)
- func AddTestAddrs(myApp *app.App, ctx sdk.Context, accNum int, coins sdk.Coins) []sdk.AccAddress
- func AddTestAddrsIncremental(myApp *app.App, ctx sdk.Context, accNum int, coins sdk.Coins) []sdk.AccAddress
- func AssertJsonFile(t *testing.T, filePath string, result interface{})
- func CreateMultiECDSA(count int) []*ecdsa.PrivateKey
- func CreateRandomAccounts(accNum int) []sdk.AccAddress
- func DefGenesisState(cdc codec.Codec) app.GenesisState
- func GenAccAddress() sdk.AccAddress
- func GenExternalAddr(module string) string
- func GenHexAddress() common.Address
- func GenTx(gen client.TxConfig, msgs []sdk.Msg, gasPrice sdk.Coin, gas uint64, ...) (sdk.Tx, error)
- func GenZeroExternalAddr(module string) string
- func GenerateGenesisValidator(validatorNum int, initCoins sdk.Coins) (valSet *tmtypes.ValidatorSet, genAccs authtypes.GenesisAccounts, ...)
- func HexAddrToTronAddr(str string) string
- func IsLocalTest() bool
- func MintBlock(myApp *app.App, ctx sdk.Context, block ...int64) sdk.Context
- func NewEthPrivKey() cryptotypes.PrivKey
- func NewMnemonic() string
- func NewPriKey() cryptotypes.PrivKey
- func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey)
- func NewRandAmount() sdkmath.Int
- func NewRandDenom() string
- func NewRandSymbol() string
- func NewStakingCoin(amount int64, power int64) sdk.Coin
- func NewStakingCoins(amount int64, power int64) sdk.Coins
- func PrivKeyFromMnemonic(mnemonic string, algo hd.PubKeyType, account, index uint32) (cryptotypes.PrivKey, error)
- func Setup(isCheckTx bool, isShowLog bool) *app.App
- func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage)
- func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, ...) *app.App
- func SignCheckDeliver(t *testing.T, txCfg client.TxConfig, app *baseapp.BaseApp, ...) (sdk.GasInfo, *sdk.Result, error)
- func SkipTest(t *testing.T, msg ...any)
- func TestAddr(addr string, bech string) (sdk.AccAddress, error)
- type BankSuite
- func (s *BankSuite) GetAllBalances(addr sdk.AccAddress) sdk.Coins
- func (s *BankSuite) GetSupply(denom string) sdk.Coin
- func (s *BankSuite) GetTotalSupply() sdk.Coins
- func (s *BankSuite) Init(ass *require.Assertions, ctx sdk.Context, bankKeeper bankkeeper.Keeper) *BankSuite
- func (s *BankSuite) NewSigner(ctx sdk.Context) *Signer
- func (s *BankSuite) SendCoins(fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins)
- type BaseSuite
- type Signer
- func (s Signer) AccAddress() sdk.AccAddress
- func (s Signer) Address() common.Address
- func (s Signer) PrivKey() cryptotypes.PrivKey
- func (s Signer) Sign(_ string, msg []byte) ([]byte, cryptotypes.PubKey, error)
- func (s Signer) SignByAddress(address sdk.Address, msg []byte) ([]byte, cryptotypes.PubKey, error)
- type TestingApp
- func (app *TestingApp) GetBaseApp() *baseapp.BaseApp
- func (app *TestingApp) GetIBCKeeper() *ibckeeper.Keeper
- func (app *TestingApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
- func (app *TestingApp) GetStakingKeeper() ibctestingtypes.StakingKeeper
- func (app *TestingApp) GetTxConfig() client.TxConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTestAddr ¶
func AddTestAddrs ¶
AddTestAddrs constructs and returns accNum amount of accounts with an initial balance of accAmt in random order
func AddTestAddrsIncremental ¶
func AssertJsonFile ¶
func CreateMultiECDSA ¶
func CreateMultiECDSA(count int) []*ecdsa.PrivateKey
func CreateRandomAccounts ¶
func CreateRandomAccounts(accNum int) []sdk.AccAddress
CreateRandomAccounts generated addresses in random order
func DefGenesisState ¶
func DefGenesisState(cdc codec.Codec) app.GenesisState
func GenAccAddress ¶
func GenAccAddress() sdk.AccAddress
GenAccAddress generates an cosmos-sdk accAddress
func GenExternalAddr ¶
GenExternalAddr generates an Ethereum or Tron address.
func GenHexAddress ¶
GenHexAddress generates an Ethereum address.
func GenTx ¶
func GenTx(gen client.TxConfig, msgs []sdk.Msg, gasPrice sdk.Coin, gas uint64, chainID string, accNums, accSeqs []uint64, priv ...cryptotypes.PrivKey) (sdk.Tx, error)
GenTx generates a signed mock transaction.
func GenZeroExternalAddr ¶
GenZeroExternalAddr generates an Ethereum or Tron zero address.
func GenerateGenesisValidator ¶
func GenerateGenesisValidator(validatorNum int, initCoins sdk.Coins) (valSet *tmtypes.ValidatorSet, genAccs authtypes.GenesisAccounts, balances []banktypes.Balance)
func HexAddrToTronAddr ¶
HexAddrToTronAddr returns a Tron address from an hex string.
func IsLocalTest ¶
func IsLocalTest() bool
func NewEthPrivKey ¶
func NewEthPrivKey() cryptotypes.PrivKey
NewEthPrivKey generates an Ethereum address and its corresponding private key.
func NewMnemonic ¶
func NewMnemonic() string
func NewPriKey ¶
func NewPriKey() cryptotypes.PrivKey
NewPriKey generates cosmos-sdk accAddress private key.
func NewPubKeyFromHex ¶
func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey)
NewPubKeyFromHex returns a PubKey from a hex string.
func NewRandAmount ¶
func NewRandDenom ¶
func NewRandDenom() string
func NewRandSymbol ¶
func NewRandSymbol() string
func PrivKeyFromMnemonic ¶
func PrivKeyFromMnemonic(mnemonic string, algo hd.PubKeyType, account, index uint32) (cryptotypes.PrivKey, error)
func SetupTestingApp ¶
func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage)
SetupTestingApp initializes the IBC-go testing application
func SetupWithGenesisValSet ¶
func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *app.App
SetupWithGenesisValSet initializes a new App with a validator set and genesis accounts that also act as delegators. For simplicity, each validator is bonded with a delegation of one consensus engine unit (10^6) in the default token of the app from first genesis account. A Nop logger is set in App.
func SignCheckDeliver ¶
func SignCheckDeliver(t *testing.T, txCfg client.TxConfig, app *baseapp.BaseApp, header tmproto.Header, msgs []sdk.Msg, expSimPass, expPass bool, priv ...cryptotypes.PrivKey, ) (sdk.GasInfo, *sdk.Result, error)
SignCheckDeliver checks a generated signed transaction and simulates a block commitment with the given transaction. A test assertion is made using the parameter 'expPass' against the result. A corresponding result is returned.
Types ¶
type BankSuite ¶
type BankSuite struct { *require.Assertions // contains filtered or unexported fields }
func (*BankSuite) GetAllBalances ¶
func (s *BankSuite) GetAllBalances(addr sdk.AccAddress) sdk.Coins
func (*BankSuite) GetTotalSupply ¶
func (*BankSuite) Init ¶
func (s *BankSuite) Init(ass *require.Assertions, ctx sdk.Context, bankKeeper bankkeeper.Keeper) *BankSuite
func (*BankSuite) SendCoins ¶
func (s *BankSuite) SendCoins(fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins)
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer defines a type that is used on testing for signing MsgEthereumTx
func NewSigner ¶
func NewSigner(sk cryptotypes.PrivKey) *Signer
func (Signer) AccAddress ¶
func (s Signer) AccAddress() sdk.AccAddress
func (Signer) PrivKey ¶
func (s Signer) PrivKey() cryptotypes.PrivKey
func (Signer) SignByAddress ¶
SignByAddress sign byte messages with a user key providing the address.
type TestingApp ¶
func (*TestingApp) GetBaseApp ¶
func (app *TestingApp) GetBaseApp() *baseapp.BaseApp
func (*TestingApp) GetIBCKeeper ¶
func (app *TestingApp) GetIBCKeeper() *ibckeeper.Keeper
func (*TestingApp) GetScopedIBCKeeper ¶
func (app *TestingApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
func (*TestingApp) GetStakingKeeper ¶
func (app *TestingApp) GetStakingKeeper() ibctestingtypes.StakingKeeper
func (*TestingApp) GetTxConfig ¶
func (app *TestingApp) GetTxConfig() client.TxConfig