lockup

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

The lockup AnteHandler defines a configurable Tx validation system to control which Txs submitted to the chain will be allowed into the Mempool and eventually included in a block. In particular, this file defines a LockupAnteHandler, which performs the funds transfer locking feature and a WrappedAnteHanlder which makes it simpler to chain multiple AnteHandlers from disparate sources in the chain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLockupAnteHandler

func NewLockupAnteHandler(lockupKeeper keeper.Keeper, cdc codec.Codec) sdk.AnteHandler

NewLockupAnteHandler returns an AnteHandler that ensures any transaction under a locked chain originates from a LockExempt address

func NewWrappedLockupAnteHandler

func NewWrappedLockupAnteHandler(
	anteHandler sdk.AnteHandler,
	lockupKeeper keeper.Keeper,
	cdc codec.Codec,
) sdk.AnteHandler

WrappedLockupAnteHandler wraps a LockupAnteHandler around the input AnteHandler

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

AppModule object for module implementation

func NewAppModule

func NewAppModule(k keeper.Keeper, bankKeeper bankkeeper.Keeper) AppModule

NewAppModule creates a new AppModule Object

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock)

BeginBlock implements app module

func (AppModule) ConsensusVersion

func (am AppModule) ConsensusVersion() uint64

func (AppModule) EndBlock

EndBlock implements app module

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage

ExportGenesis exports the current genesis state to a json.RawMessage

func (AppModule) GenerateGenesisState

func (AppModule) GenerateGenesisState(simState *module.SimulationState)

GenerateGenesisState creates a randomized GenState of the distribution module.

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate

InitGenesis initializes the genesis state for this module and implements app module.

func (AppModule) LegacyQuerierHandler

func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

LegacyQuerierHandler returns the distribution module sdk.Querier.

func (AppModule) Name

func (AppModule) Name() string

Name implements app module

func (AppModule) ProposalContents

func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent

ProposalContents returns all the distribution content functions used to simulate governance proposals.

func (AppModule) QuerierRoute

func (am AppModule) QuerierRoute() string

QuerierRoute implements app module

func (AppModule) RandomizedParams

func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange

RandomizedParams creates randomized distribution param changes for the simulator.

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)

RegisterInvariants implements app module

func (AppModule) RegisterServices

func (am AppModule) RegisterServices(cfg module.Configurator)

RegisterServices registers module services.

func (AppModule) RegisterStoreDecoder

func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)

RegisterStoreDecoder registers a decoder for distribution module's types

func (AppModule) Route

func (am AppModule) Route() sdk.Route

Route implements app module

func (AppModule) WeightedOperations

func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation

WeightedOperations returns the all the gov module operations with their respective weights.

type AppModuleBasic

type AppModuleBasic struct{}

AppModuleBasic object for module implementation

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage

DefaultGenesis implements app module basic

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd() *cobra.Command

GetQueryCmd implements app module basic

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd() *cobra.Command

GetTxCmd implements app module basic

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name implements app module basic

func (AppModuleBasic) RegisterGRPCGatewayRoutes

func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)

RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the distribution module. also implements app modeul basic

func (AppModuleBasic) RegisterInterfaces

func (b AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces implements app bmodule basic

func (AppModuleBasic) RegisterLegacyAminoCodec

func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec implements app module basic

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(ctx client.Context, rtr *mux.Router)

RegisterRESTRoutes implements app module basic

func (AppModuleBasic) ValidateGenesis

ValidateGenesis implements app module basic

type LockAnteDecorator

type LockAnteDecorator struct {
	// contains filtered or unexported fields
}

LockAnteDecorator Ensures that any transaction under a locked chain originates from a LockExempt address

func NewLockupAnteDecorator

func NewLockupAnteDecorator(lockupKeeper keeper.Keeper, cdc codec.Codec) LockAnteDecorator

NewLockupAnteDecorator initializes a LockupAnteDecorator for locking messages based on the settings stored in lockupKeeper

func (LockAnteDecorator) AnteHandle

func (lad LockAnteDecorator) AnteHandle(
	ctx sdk.Context,
	tx sdk.Tx,
	simulate bool,
	next sdk.AnteHandler,
) (newCtx sdk.Context, err error)

AnteHandle Ensures that any transaction transferring a locked token via a locked message type from a nonexempt address is blocked when the chain is locked

type WrappedAnteHandler

type WrappedAnteHandler struct {
	// contains filtered or unexported fields
}

WrappedAnteHandler An AnteDecorator used to wrap any AnteHandler for decorator chaining This is necessary to use the Cosmos SDK's NewAnteHandler() output with a LockupAnteHandler, as the sdk does not expose a stable list of AnteDecorators before chaining, and every upgrade poses a risk of missing updates

func (WrappedAnteHandler) AnteHandle

func (wad WrappedAnteHandler) AnteHandle(
	ctx sdk.Context,
	tx sdk.Tx, simulate bool,
	next sdk.AnteHandler,
) (sdk.Context, error)

AnteHandle calls wad.anteHandler and then the next one in the chain

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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