Documentation ¶
Index ¶
- func AccAddressFromBech32(address string) (addr sdk.AccAddress, err error)
- func AddHelperModuleAccountAddr(moduleAccAddrs map[string]bool) map[string]bool
- func AddHelperModuleAccountPermissions(maccPerms map[string][]string) map[string][]string
- func CheckInvariant(t require.TestingT, ctx sdk.Context, invariant sdk.Invariant, failed bool, ...)
- func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress
- func CreateAccounts(accNum int, valAccNum int) (acountsAddresses []sdk.AccAddress, validatorsAddresses []sdk.ValAddress)
- func CreateIncrementalAccounts(accNum int, genInitNumber int) []sdk.AccAddress
- func CreateRandomAccAddress() string
- func CreateRandomAccAddressNoBalance(i int64) string
- func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey
- func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey)
- func TestAddr(addr string, bech string) (sdk.AccAddress, error)
- func ValidateManyInvariants(t require.TestingT, ctx sdk.Context, invariants []sdk.Invariant)
- type AuthUtils
- func (au *AuthUtils) CreateBaseAccount(ctx sdk.Context, address string, coin sdk.Coins) error
- func (au *AuthUtils) CreateDefaultDenomBaseAccount(ctx sdk.Context, address string, amount math.Int) error
- func (au *AuthUtils) CreateDefaultDenomVestingAccount(ctx sdk.Context, address string, amount math.Int, start time.Time, ...) error
- func (au *AuthUtils) CreateVestingAccount(ctx sdk.Context, address string, coins sdk.Coins, start time.Time, ...) error
- func (au *AuthUtils) ModifyVestingAccountOriginalVesting(ctx sdk.Context, address string, newOrignalVestings sdk.Coins) error
- func (au *AuthUtils) VerifyAccountDoesNotExist(ctx sdk.Context, address sdk.AccAddress)
- func (au *AuthUtils) VerifyDefaultDenomVestingAccount(ctx sdk.Context, address sdk.AccAddress, lockedAmount math.Int, ...)
- func (au *AuthUtils) VerifyIsContinuousVestingAccount(ctx sdk.Context, address sdk.AccAddress)
- func (au *AuthUtils) VerifyVestingAccount(ctx sdk.Context, address sdk.AccAddress, lockedAmount sdk.Coins, ...)
- type BankUtils
- func (bu *BankUtils) AddCoinsToAccount(ctx sdk.Context, coinsToMint sdk.Coins, toAddr sdk.AccAddress)
- func (bu *BankUtils) AddCoinsToModule(ctx sdk.Context, coinsToMint sdk.Coin, moduleName string)
- func (bu *BankUtils) AddDefaultDenomCoinsToAccount(ctx sdk.Context, amount math.Int, toAddr sdk.AccAddress) (denom string)
- func (bu *BankUtils) AddDefaultDenomCoinsToModule(ctx sdk.Context, amount math.Int, moduleName string) (denom string)
- func (bu *BankUtils) DisableSend(ctx sdk.Context)
- func (bu *BankUtils) GetAccountAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
- func (bu *BankUtils) GetAccountBalanceByDenom(ctx sdk.Context, addr sdk.AccAddress, denom string) math.Int
- func (bu *BankUtils) GetAccountDefultDenomBalance(ctx sdk.Context, addr sdk.AccAddress) math.Int
- func (bu *BankUtils) GetAccountLockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
- func (bu *BankUtils) GetModuleAccountBalanceByDenom(ctx sdk.Context, accName string, denom string) math.Int
- func (bu *BankUtils) GetModuleAccountDefultDenomBalance(ctx sdk.Context, accName string) math.Int
- func (bu *BankUtils) VerifyAccountBalanceByDenom(ctx sdk.Context, addr sdk.AccAddress, denom string, expectedAmount math.Int)
- func (bu *BankUtils) VerifyAccountBalances(ctx sdk.Context, addr sdk.AccAddress, expectedBalances sdk.Coins, ...)
- func (bu *BankUtils) VerifyAccountDefultDenomBalance(ctx sdk.Context, addr sdk.AccAddress, expectedAmount math.Int)
- func (bu *BankUtils) VerifyDefultDenomTotalSupply(ctx sdk.Context, expectedAmount math.Int)
- func (bu *BankUtils) VerifyLockedCoins(ctx sdk.Context, addr sdk.AccAddress, expectedLockedCoins sdk.Coins, ...)
- func (bu *BankUtils) VerifyModuleAccountBalanceByDenom(ctx sdk.Context, accName string, denom string, expectedAmount math.Int)
- func (bu *BankUtils) VerifyModuleAccountDefultDenomBalance(ctx sdk.Context, accName string, expectedAmount math.Int)
- func (bu *BankUtils) VerifyTotalSupplyByDenom(ctx sdk.Context, denom string, expectedAmount math.Int)
- type ContextAuthUtils
- func (au *ContextAuthUtils) CreateDefaultDenomBaseAccount(address string, amount sdk.Int) error
- func (au *ContextAuthUtils) CreateDefaultDenomVestingAccount(address string, amount math.Int, start time.Time, end time.Time) error
- func (au *ContextAuthUtils) CreateVestingAccount(address string, coins sdk.Coins, start time.Time, end time.Time) error
- func (au *ContextAuthUtils) ModifyVestingAccountOriginalVesting(address string, newOrignalVestings sdk.Coins) error
- func (au *ContextAuthUtils) VerifyAccountDoesNotExist(address sdk.AccAddress)
- func (au *ContextAuthUtils) VerifyDefaultDenomVestingAccount(address sdk.AccAddress, lockedAmount math.Int, startTime time.Time, ...)
- func (au *ContextAuthUtils) VerifyIsContinuousVestingAccount(address sdk.AccAddress)
- func (au *ContextAuthUtils) VerifyVestingAccount(address sdk.AccAddress, lockedAmount sdk.Coins, startTime time.Time, ...)
- type ContextBankUtils
- func (bu *ContextBankUtils) AddCoinsToAccount(coinsToMint sdk.Coins, toAddr sdk.AccAddress)
- func (bu *ContextBankUtils) AddCoinsToModule(coinsToMint sdk.Coin, moduleName string)
- func (bu *ContextBankUtils) AddDefaultDenomCoinsToAccount(amount math.Int, toAddr sdk.AccAddress) (denom string)
- func (bu *ContextBankUtils) AddDefaultDenomCoinsToModule(amount math.Int, moduleName string) (denom string)
- func (bu *ContextBankUtils) DisableSend()
- func (bu *ContextBankUtils) GetAccountAllBalances(addr sdk.AccAddress) sdk.Coins
- func (bu *ContextBankUtils) GetAccountDefultDenomBalance(addr sdk.AccAddress) math.Int
- func (bu *ContextBankUtils) GetAccountLockedCoins(addr sdk.AccAddress) sdk.Coins
- func (bu *ContextBankUtils) GetModuleAccountDefultDenomBalance(accName string) math.Int
- func (bu *ContextBankUtils) VerifyAccountBalanceByDenom(addr sdk.AccAddress, denom string, expectedAmount math.Int)
- func (bu *ContextBankUtils) VerifyAccountBalances(addr sdk.AccAddress, expectedBalances sdk.Coins, isAllBalances bool)
- func (bu *ContextBankUtils) VerifyAccountDefultDenomBalance(addr sdk.AccAddress, expectedAmount math.Int)
- func (bu *ContextBankUtils) VerifyDefultDenomTotalSupply(expectedAmount math.Int)
- func (bu *ContextBankUtils) VerifyLockedCoins(addr sdk.AccAddress, expectedLockedCoins sdk.Coins, isAllLocked bool)
- func (bu *ContextBankUtils) VerifyModuleAccountBalanceByDenom(accName string, denom string, expectedAmount math.Int)
- func (bu *ContextBankUtils) VerifyModuleAccountDefultDenomBalance(accName string, expectedAmount math.Int)
- func (bu *ContextBankUtils) VerifyTotalSupplyByDenom(denom string, expectedAmount math.Int)
- type ContextStakingUtils
- func (su *ContextStakingUtils) CreateValidator(addr sdk.ValAddress, pk cryptotypes.PubKey, coin sdk.Coin, ...)
- func (su *ContextStakingUtils) GetValidator(addr sdk.ValAddress) (validator stakingtypes.Validator, found bool)
- func (su *ContextStakingUtils) MessageDelegate(expectedCurrentAmountOfDelegations int, ...)
- func (su *ContextStakingUtils) MessageUndelegate(expectedCurrentAmountOfDelegations int, ...)
- func (su *ContextStakingUtils) SetupValidators(validators []sdk.ValAddress, delegatePerValidator math.Int)
- func (su *ContextStakingUtils) VerifyNumberOfUnbondingDelegations(expectedNumberOfUnbondingDelegations int, delegatorAddress sdk.AccAddress)
- type StakingUtils
- func (su *StakingUtils) CreateValidator(ctx sdk.Context, addr sdk.ValAddress, pk cryptotypes.PubKey, coin sdk.Coin, ...)
- func (su *StakingUtils) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool)
- func (su *StakingUtils) MessageDelegate(ctx sdk.Context, expectedCurrentAmountOfDelegations int, ...)
- func (su *StakingUtils) MessageUndelegate(ctx sdk.Context, expectedCurrentAmountOfDelegations int, ...)
- func (su *StakingUtils) SetupValidators(ctx sdk.Context, validators []sdk.ValAddress, delegatePerValidator math.Int)
- func (su *StakingUtils) VerifyNumberOfUnbondingDelegations(ctx sdk.Context, expectedNumberOfUnbondingDelegations int, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccAddressFromBech32 ¶ added in v1.2.0
func AccAddressFromBech32(address string) (addr sdk.AccAddress, err error)
AccAddressFromBech32 creates an AccAddress from a Bech32 string.
func CheckInvariant ¶
func ConvertAddrsToValAddrs ¶
func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress
func CreateAccounts ¶
func CreateAccounts(accNum int, valAccNum int) (acountsAddresses []sdk.AccAddress, validatorsAddresses []sdk.ValAddress)
func CreateIncrementalAccounts ¶
func CreateIncrementalAccounts(accNum int, genInitNumber int) []sdk.AccAddress
func CreateRandomAccAddress ¶
func CreateRandomAccAddress() string
func CreateTestPubKeys ¶
func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey
CreateTestPubKeys returns a total of numPubKeys public keys in ascending order.
func NewPubKeyFromHex ¶
func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey)
NewPubKeyFromHex returns a PubKey from a hex string.
Types ¶
type AuthUtils ¶
type AuthUtils struct {
// contains filtered or unexported fields
}
func NewAuthUtils ¶
func NewAuthUtils(t require.TestingT, helperAccountKeeper *authkeeper.AccountKeeper, bankUtils *BankUtils) AuthUtils
func (*AuthUtils) CreateBaseAccount ¶ added in v1.2.0
func (*AuthUtils) CreateDefaultDenomBaseAccount ¶ added in v1.2.0
func (*AuthUtils) CreateDefaultDenomVestingAccount ¶
func (*AuthUtils) CreateVestingAccount ¶
func (*AuthUtils) ModifyVestingAccountOriginalVesting ¶ added in v1.2.0
func (*AuthUtils) VerifyAccountDoesNotExist ¶ added in v1.2.0
func (au *AuthUtils) VerifyAccountDoesNotExist(ctx sdk.Context, address sdk.AccAddress)
func (*AuthUtils) VerifyDefaultDenomVestingAccount ¶
func (*AuthUtils) VerifyIsContinuousVestingAccount ¶ added in v1.2.0
func (au *AuthUtils) VerifyIsContinuousVestingAccount(ctx sdk.Context, address sdk.AccAddress)
type BankUtils ¶
type BankUtils struct {
// contains filtered or unexported fields
}
func NewBankUtils ¶
func NewBankUtils(t require.TestingT, ctx sdk.Context, helperAccountKeeper *authkeeper.AccountKeeper, helperBankKeeper bankkeeper.Keeper) BankUtils
func (*BankUtils) AddCoinsToAccount ¶
func (*BankUtils) AddCoinsToModule ¶
func (*BankUtils) AddDefaultDenomCoinsToAccount ¶
func (*BankUtils) AddDefaultDenomCoinsToModule ¶
func (*BankUtils) DisableSend ¶ added in v1.2.0
func (*BankUtils) GetAccountAllBalances ¶ added in v1.2.0
func (*BankUtils) GetAccountBalanceByDenom ¶
func (*BankUtils) GetAccountDefultDenomBalance ¶
func (*BankUtils) GetAccountLockedCoins ¶ added in v1.2.0
func (*BankUtils) GetModuleAccountBalanceByDenom ¶
func (*BankUtils) GetModuleAccountDefultDenomBalance ¶
func (*BankUtils) VerifyAccountBalanceByDenom ¶
func (*BankUtils) VerifyAccountBalances ¶ added in v1.2.0
func (*BankUtils) VerifyAccountDefultDenomBalance ¶
func (*BankUtils) VerifyDefultDenomTotalSupply ¶
func (*BankUtils) VerifyLockedCoins ¶ added in v1.2.0
func (*BankUtils) VerifyModuleAccountBalanceByDenom ¶
func (*BankUtils) VerifyModuleAccountDefultDenomBalance ¶
type ContextAuthUtils ¶
type ContextAuthUtils struct { AuthUtils // contains filtered or unexported fields }
func NewContextAuthUtils ¶
func NewContextAuthUtils(t require.TestingT, testContext testenv.TestContext, helperAccountKeeper *authkeeper.AccountKeeper, bankUtils *BankUtils) *ContextAuthUtils
func (*ContextAuthUtils) CreateDefaultDenomBaseAccount ¶ added in v1.2.0
func (au *ContextAuthUtils) CreateDefaultDenomBaseAccount(address string, amount sdk.Int) error
func (*ContextAuthUtils) CreateDefaultDenomVestingAccount ¶
func (*ContextAuthUtils) CreateVestingAccount ¶
func (*ContextAuthUtils) ModifyVestingAccountOriginalVesting ¶ added in v1.2.0
func (au *ContextAuthUtils) ModifyVestingAccountOriginalVesting(address string, newOrignalVestings sdk.Coins) error
func (*ContextAuthUtils) VerifyAccountDoesNotExist ¶ added in v1.2.0
func (au *ContextAuthUtils) VerifyAccountDoesNotExist(address sdk.AccAddress)
func (*ContextAuthUtils) VerifyDefaultDenomVestingAccount ¶
func (au *ContextAuthUtils) VerifyDefaultDenomVestingAccount(address sdk.AccAddress, lockedAmount math.Int, startTime time.Time, endTime time.Time)
func (*ContextAuthUtils) VerifyIsContinuousVestingAccount ¶ added in v1.2.0
func (au *ContextAuthUtils) VerifyIsContinuousVestingAccount(address sdk.AccAddress)
func (*ContextAuthUtils) VerifyVestingAccount ¶
func (au *ContextAuthUtils) VerifyVestingAccount(address sdk.AccAddress, lockedAmount sdk.Coins, startTime time.Time, endTime time.Time)
type ContextBankUtils ¶
type ContextBankUtils struct { BankUtils // contains filtered or unexported fields }
func NewContextBankUtils ¶
func NewContextBankUtils(t require.TestingT, testContext testenv.TestContext, helperAccountKeeper *authkeeper.AccountKeeper, helperBankKeeper bankkeeper.Keeper) *ContextBankUtils
func (*ContextBankUtils) AddCoinsToAccount ¶
func (bu *ContextBankUtils) AddCoinsToAccount(coinsToMint sdk.Coins, toAddr sdk.AccAddress)
func (*ContextBankUtils) AddCoinsToModule ¶
func (bu *ContextBankUtils) AddCoinsToModule(coinsToMint sdk.Coin, moduleName string)
func (*ContextBankUtils) AddDefaultDenomCoinsToAccount ¶
func (bu *ContextBankUtils) AddDefaultDenomCoinsToAccount(amount math.Int, toAddr sdk.AccAddress) (denom string)
func (*ContextBankUtils) AddDefaultDenomCoinsToModule ¶
func (bu *ContextBankUtils) AddDefaultDenomCoinsToModule(amount math.Int, moduleName string) (denom string)
func (*ContextBankUtils) DisableSend ¶ added in v1.2.0
func (bu *ContextBankUtils) DisableSend()
func (*ContextBankUtils) GetAccountAllBalances ¶ added in v1.2.0
func (bu *ContextBankUtils) GetAccountAllBalances(addr sdk.AccAddress) sdk.Coins
func (*ContextBankUtils) GetAccountDefultDenomBalance ¶
func (bu *ContextBankUtils) GetAccountDefultDenomBalance(addr sdk.AccAddress) math.Int
func (*ContextBankUtils) GetAccountLockedCoins ¶ added in v1.2.0
func (bu *ContextBankUtils) GetAccountLockedCoins(addr sdk.AccAddress) sdk.Coins
func (*ContextBankUtils) GetModuleAccountDefultDenomBalance ¶
func (bu *ContextBankUtils) GetModuleAccountDefultDenomBalance(accName string) math.Int
func (*ContextBankUtils) VerifyAccountBalanceByDenom ¶
func (bu *ContextBankUtils) VerifyAccountBalanceByDenom(addr sdk.AccAddress, denom string, expectedAmount math.Int)
func (*ContextBankUtils) VerifyAccountBalances ¶ added in v1.2.0
func (bu *ContextBankUtils) VerifyAccountBalances(addr sdk.AccAddress, expectedBalances sdk.Coins, isAllBalances bool)
func (*ContextBankUtils) VerifyAccountDefultDenomBalance ¶
func (bu *ContextBankUtils) VerifyAccountDefultDenomBalance(addr sdk.AccAddress, expectedAmount math.Int)
func (*ContextBankUtils) VerifyDefultDenomTotalSupply ¶
func (bu *ContextBankUtils) VerifyDefultDenomTotalSupply(expectedAmount math.Int)
func (*ContextBankUtils) VerifyLockedCoins ¶ added in v1.2.0
func (bu *ContextBankUtils) VerifyLockedCoins(addr sdk.AccAddress, expectedLockedCoins sdk.Coins, isAllLocked bool)
func (*ContextBankUtils) VerifyModuleAccountBalanceByDenom ¶
func (bu *ContextBankUtils) VerifyModuleAccountBalanceByDenom(accName string, denom string, expectedAmount math.Int)
func (*ContextBankUtils) VerifyModuleAccountDefultDenomBalance ¶
func (bu *ContextBankUtils) VerifyModuleAccountDefultDenomBalance(accName string, expectedAmount math.Int)
func (*ContextBankUtils) VerifyTotalSupplyByDenom ¶
func (bu *ContextBankUtils) VerifyTotalSupplyByDenom(denom string, expectedAmount math.Int)
type ContextStakingUtils ¶
type ContextStakingUtils struct { StakingUtils // contains filtered or unexported fields }
func NewContextStakingUtils ¶
func NewContextStakingUtils(t require.TestingT, testContext testenv.TestContext, helperStakingkeeper stakingkeeper.Keeper, bankUtils *BankUtils) *ContextStakingUtils
func (*ContextStakingUtils) CreateValidator ¶
func (su *ContextStakingUtils) CreateValidator(addr sdk.ValAddress, pk cryptotypes.PubKey, coin sdk.Coin, commisions stakingtypes.CommissionRates)
func (*ContextStakingUtils) GetValidator ¶
func (su *ContextStakingUtils) GetValidator(addr sdk.ValAddress) (validator stakingtypes.Validator, found bool)
func (*ContextStakingUtils) MessageDelegate ¶
func (su *ContextStakingUtils) MessageDelegate(expectedCurrentAmountOfDelegations int, expectedCurrentAmountOfUnbondingDelegations int, validatorAddress sdk.ValAddress, delegatorAddress sdk.AccAddress, bondAmount math.Int)
func (*ContextStakingUtils) MessageUndelegate ¶
func (su *ContextStakingUtils) MessageUndelegate(expectedCurrentAmountOfDelegations int, expectedCurrentAmountOfUnbondingDelegations int, validatorAddress sdk.ValAddress, delegatorAddress sdk.AccAddress, unbondAmount math.Int)
func (*ContextStakingUtils) SetupValidators ¶
func (su *ContextStakingUtils) SetupValidators(validators []sdk.ValAddress, delegatePerValidator math.Int)
func (*ContextStakingUtils) VerifyNumberOfUnbondingDelegations ¶
func (su *ContextStakingUtils) VerifyNumberOfUnbondingDelegations(expectedNumberOfUnbondingDelegations int, delegatorAddress sdk.AccAddress)
type StakingUtils ¶
type StakingUtils struct {
// contains filtered or unexported fields
}
func NewStakingUtils ¶
func NewStakingUtils(t require.TestingT, helperStakingkeeper stakingkeeper.Keeper, bankUtils *BankUtils) StakingUtils
func (*StakingUtils) CreateValidator ¶
func (su *StakingUtils) CreateValidator(ctx sdk.Context, addr sdk.ValAddress, pk cryptotypes.PubKey, coin sdk.Coin, commisions stakingtypes.CommissionRates)
func (*StakingUtils) GetValidator ¶
func (su *StakingUtils) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool)
func (*StakingUtils) MessageDelegate ¶
func (su *StakingUtils) MessageDelegate(ctx sdk.Context, expectedCurrentAmountOfDelegations int, expectedCurrentAmountOfUnbondingDelegations int, validatorAddress sdk.ValAddress, delegatorAddress sdk.AccAddress, bondAmount math.Int)
func (*StakingUtils) MessageUndelegate ¶
func (su *StakingUtils) MessageUndelegate(ctx sdk.Context, expectedCurrentAmountOfDelegations int, expectedCurrentAmountOfUnbondingDelegations int, validatorAddress sdk.ValAddress, delegatorAddress sdk.AccAddress, unbondAmount math.Int)
func (*StakingUtils) SetupValidators ¶
func (su *StakingUtils) SetupValidators(ctx sdk.Context, validators []sdk.ValAddress, delegatePerValidator math.Int)
func (*StakingUtils) VerifyNumberOfUnbondingDelegations ¶
func (su *StakingUtils) VerifyNumberOfUnbondingDelegations(ctx sdk.Context, expectedNumberOfUnbondingDelegations int, delegatorAddress sdk.AccAddress)
Click to show internal directories.
Click to hide internal directories.