Documentation ¶
Overview ¶
This file contains utility testing functions from SDK 47 that are required for the UBD migration unit test
Index ¶
- func AccAddressFromHexUnsafe(address string) (addr sdk.AccAddress, err error)
- func CheckHexConversion(addr string, bech string) (sdk.AccAddress, error)
- func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress
- func CreateIncrementalAccounts(accNum int) []sdk.AccAddress
- func MigrateDelegations(ctx sdk.Context, k keeper)
- func MigrateParamsStore(ctx sdk.Context, paramstore subspace)
- func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, k keeper, ...) error
- func MigrateUBDEntries(ctx sdk.Context, store storetypes.KVStore, cdc codec.BinaryCodec) error
- func MigrateValidators(ctx sdk.Context, k keeper)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccAddressFromHexUnsafe ¶
func AccAddressFromHexUnsafe(address string) (addr sdk.AccAddress, err error)
AccAddressFromHexUnsafe creates an AccAddress from a HEX-encoded string.
Note, this function is considered unsafe as it may produce an AccAddress from otherwise invalid input, such as a transaction hash. Please use AccAddressFromBech32.
func CheckHexConversion ¶
func CheckHexConversion(addr string, bech string) (sdk.AccAddress, error)
func ConvertAddrsToValAddrs ¶
func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress
ConvertAddrsToValAddrs converts the provided addresses to ValAddress.
func CreateIncrementalAccounts ¶
func CreateIncrementalAccounts(accNum int) []sdk.AccAddress
CreateIncrementalAccounts is a strategy used by addTestAddrs() in order to generated addresses in ascending order.
func MigrateDelegations ¶
Set each delegation's ValidatorBond field to false
func MigrateParamsStore ¶
Adds the following LSM params: - ValidatorBondFactor - GlobalLiquidStakingCap - ValidatorLiquidStakingCap
func MigrateStore ¶
func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, k keeper, paramstore subspace) error
Peforms the in-place store migration for adding LSM support to v0.45.16-ics, including:
- Adding params ValidatorBondFactor, GlobalLiquidStakingCap, ValidatorLiquidStakingCap
- Setting each validator's ValidatorBondShares and LiquidShares to 0
- Setting each delegation's ValidatorBond field to false
- Calculating the total liquid staked by summing the delegations from ICA accounts
func MigrateUBDEntries ¶
func MigrateUBDEntries(ctx sdk.Context, store storetypes.KVStore, cdc codec.BinaryCodec) error
migrateUBDEntries will remove the ubdEntries with same creation_height and create a new ubdEntry with updated balance and initial_balance
func MigrateValidators ¶
Set each validator's ValidatorBondShares and LiquidShares to 0
Types ¶
This section is empty.