v3

package
v0.45.16-ics-lsm-rc0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 9

Documentation

Overview

This file contains utility testing functions from SDK 47 that are required for the UBD migration unit test

Index

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

func MigrateDelegations(ctx sdk.Context, k keeper)

Set each delegation's ValidatorBond field to false

func MigrateParamsStore

func MigrateParamsStore(ctx sdk.Context, paramstore subspace)

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

func MigrateValidators(ctx sdk.Context, k keeper)

Set each validator's ValidatorBondShares and LiquidShares to 0

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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