Documentation ¶
Index ¶
- Variables
- func ExportGenesis(ctx sdk.Context, k Keeper) types.GenesisState
- func InitGenesis(ctx sdk.Context, k Keeper, data types.GenesisState)
- func MakeTestCodec() *codec.LegacyAmino
- func MakeTestMarshaler() *codec.ProtoCodec
- type Keeper
- func (k Keeper) GetChainLocked(ctx sdk.Context) bool
- func (k Keeper) GetLockExemptAddresses(ctx sdk.Context) []string
- func (k Keeper) GetLockExemptAddressesSet(ctx sdk.Context) map[string]struct{}
- func (k Keeper) GetLockedMessageTypes(ctx sdk.Context) []string
- func (k Keeper) GetLockedMessageTypesSet(ctx sdk.Context) map[string]struct{}
- func (k Keeper) GetLockedTokenDenoms(ctx sdk.Context) []string
- func (k Keeper) GetLockedTokenDenomsSet(ctx sdk.Context) map[string]struct{}
- func (k Keeper) GetParamsIfSet(ctx sdk.Context) (params types.Params, err error)
- func (k Keeper) SetChainLocked(ctx sdk.Context, locked bool)
- func (k Keeper) SetLockExemptAddresses(ctx sdk.Context, lockExempt []string)
- func (k Keeper) SetLockedMessageTypes(ctx sdk.Context, lockedMessageTypes []string)
- func (k Keeper) SetLockedTokenDenoms(ctx sdk.Context, lockedTokenDenoms []string)
- type TestInput
Constants ¶
This section is empty.
Variables ¶
var ( // ModuleBasics is a mock module basic manager for testing ModuleBasics = module.NewBasicManager( auth.AppModuleBasic{}, genutil.AppModuleBasic{}, bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distribution.AppModuleBasic{}, gov.NewAppModuleBasic([]govclient.ProposalHandler{paramsclient.ProposalHandler}), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, vesting.AppModuleBasic{}, ) // TestingStakeParams is a set of staking params for testing TestingStakeParams = stakingtypes.Params{ UnbondingTime: 100, MaxValidators: 10, MaxEntries: 10, HistoricalEntries: 10000, BondDenom: "stake", MinCommissionRate: sdk.NewDecFromInt(sdk.NewInt(0)), } )
Functions ¶
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, k Keeper) types.GenesisState
ExportGenesis exports all the state needed to restart the chain from the current state of the chain
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k Keeper, data types.GenesisState)
InitGenesis starts a chain from a genesis state
func MakeTestCodec ¶
func MakeTestCodec() *codec.LegacyAmino
TODO: Remove this from althea-chain and cosmos-gravity-bridge as well MakeTestCodec creates a legacy amino codec for testing
func MakeTestMarshaler ¶
func MakeTestMarshaler() *codec.ProtoCodec
MakeTestMarshaler creates a proto codec for use in testing
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey, paramSpace paramstypes.Subspace) Keeper
func (Keeper) GetChainLocked ¶
TODO: Doc all these methods
func (Keeper) GetLockExemptAddresses ¶
func (Keeper) GetLockExemptAddressesSet ¶
func (Keeper) GetLockedMessageTypes ¶
func (Keeper) GetLockedMessageTypesSet ¶
func (Keeper) GetLockedTokenDenomsSet ¶
func (Keeper) GetParamsIfSet ¶
GetParamsIfSet will return the current params, but will return an error if the chain is still initializing. By error checking this function is safe to use in handling genesis transactions.
func (Keeper) SetLockExemptAddresses ¶
TODO: It would be nice to just store the pseudo-set instead of the string array so that we get better efficiency on each read (happens each transaction in antehandler) however we would need to make a custom param change proposal handler to construct the set upon governance proposal before storage in keeper
func (Keeper) SetLockedMessageTypes ¶
type TestInput ¶
type TestInput struct { ParamsKeeper paramskeeper.Keeper LockupKeeper Keeper Context sdk.Context Codec codec.Codec LegacyAmino *codec.LegacyAmino }
TestInput stores the various keepers required to test lockup
func CreateTestEnv ¶
CreateTestEnv creates the keeper testing environment for lockup