Documentation ¶
Index ¶
- Constants
- Variables
- func CreateTestTx(clientCtx client.Context, txBuilder client.TxBuilder, ...) (xauthsigning.Tx, error)
- func SetupApp(t *testing.T) *app.App
- func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, ...) *app.App
- type KeeperTestHelper
- func (s *KeeperTestHelper) Ed25519PubAddr() (cryptotypes.PrivKey, cryptotypes.PubKey, sdk.AccAddress)
- func (s *KeeperTestHelper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins)
- func (s *KeeperTestHelper) RandomAccountAddresses(n int) []sdk.AccAddress
- func (s *KeeperTestHelper) Setup(_ *testing.T, chainID string)
- type PV
Constants ¶
View Source
const ( SimAppChainID = "cudos-app" AccountAddressPrefix = "cudos" DefaultEthAddress = "0x4838B106FCe9647Bdf1E7877BF73cE8B0BAD5f97" CudosMainnetEthAddr = "0x817bbDbC3e8A1204f3691d14bB44992841e3dB35" )
SimAppChainID hardcoded chainID for simulation
Variables ¶
View Source
var (
DefaultPowerReduction, _ = sdk.NewIntFromString("1000000000000000000")
MinSelfDelegation, _ = sdk.NewIntFromString("50000000000000000000000")
)
View Source
var ( AccountPubKeyPrefix = AccountAddressPrefix + "pub" ValidatorAddressPrefix = AccountAddressPrefix + "valoper" ValidatorPubKeyPrefix = AccountAddressPrefix + "valoperpub" ConsNodeAddressPrefix = AccountAddressPrefix + "valcons" ConsNodePubKeyPrefix = AccountAddressPrefix + "valconspub" )
View Source
var DefaultConsensusParams = &abci.ConsensusParams{ Block: &abci.BlockParams{ MaxBytes: 200000, MaxGas: 2000000, }, Evidence: &tmproto.EvidenceParams{ MaxAgeNumBlocks: 302400, MaxAgeDuration: 504 * time.Hour, MaxBytes: 10000, }, Validator: &tmproto.ValidatorParams{ PubKeyTypes: []string{ tmtypes.ABCIPubKeyTypeEd25519, }, }, }
DefaultConsensusParams defines the default Tendermint consensus params used in app testing.
Functions ¶
func CreateTestTx ¶
func CreateTestTx(clientCtx client.Context, txBuilder client.TxBuilder, privs []cryptotypes.PrivKey, accNums []uint64, accSeqs []uint64, chainID string) (xauthsigning.Tx, error)
CreateTestTx is a helper function to create a tx given multiple inputs.
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 in the default token of the app from first genesis account. A Nop logger is set in app.
Types ¶
type KeeperTestHelper ¶
type KeeperTestHelper struct { suite.Suite App *app.App Ctx sdk.Context CheckCtx sdk.Context QueryHelper *baseapp.QueryServiceTestHelper TestAccs []sdk.AccAddress CudoMintKeeper cudoMintKeeper.Keeper AdminKeeper adminkeeper.Keeper }
func (*KeeperTestHelper) Ed25519PubAddr ¶
func (s *KeeperTestHelper) Ed25519PubAddr() (cryptotypes.PrivKey, cryptotypes.PubKey, sdk.AccAddress)
func (*KeeperTestHelper) FundAcc ¶
func (s *KeeperTestHelper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins)
FundAcc funds target address with specified amount.
func (*KeeperTestHelper) RandomAccountAddresses ¶
func (s *KeeperTestHelper) RandomAccountAddresses(n int) []sdk.AccAddress
type PV ¶
type PV struct {
PrivKey cryptotypes.PrivKey
}
PV implements PrivValidator without any safety or persistence. Only use it for testing.
func (PV) SignProposal ¶
SignProposal implements PrivValidator interface
Click to show internal directories.
Click to hide internal directories.