keeper

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServer

func NewMsgServer(k *Keeper) types.MsgServer

NewMsgServer returns the MsgServer implementation.

func NewQueryServer

func NewQueryServer(keeper Keeper) types.QueryServer

NewQueryServer creates a new instance of the x/feemarket QueryServer type.

Types

type Keeper

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

Keeper is the x/feemarket keeper.

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	authKeeper types.AccountKeeper,
	resolver types.DenomResolver,
	authority string,
) *Keeper

NewKeeper constructs a new feemarket keeper.

func (*Keeper) EndBlock

func (k *Keeper) EndBlock(ctx sdk.Context) error

EndBlock returns an endblocker for the x/feemarket module. The endblocker is responsible for updating the state of the fee market based on the AIMD learning rate adjustment algorithm.

func (*Keeper) ExportGenesis

func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns a GenesisState for a given context.

func (*Keeper) GetAuthority

func (k *Keeper) GetAuthority() string

GetAuthority returns the address that is capable of executing a MsgUpdateParams message.

func (*Keeper) GetBaseGasPrice

func (k *Keeper) GetBaseGasPrice(ctx sdk.Context) (math.LegacyDec, error)

GetBaseGasPrice returns the base fee from the fee market state.

func (*Keeper) GetEnabledHeight added in v1.1.0

func (k *Keeper) GetEnabledHeight(ctx sdk.Context) (int64, error)

GetEnabledHeight returns the height at which the feemarket was enabled.

func (*Keeper) GetLearningRate

func (k *Keeper) GetLearningRate(ctx sdk.Context) (math.LegacyDec, error)

GetLearningRate returns the learning rate from the fee market state.

func (*Keeper) GetMinGasPrice

func (k *Keeper) GetMinGasPrice(ctx sdk.Context, denom string) (sdk.DecCoin, error)

GetMinGasPrice returns the mininum gas prices for given denom as sdk.DecCoins from the fee market state.

func (*Keeper) GetMinGasPrices

func (k *Keeper) GetMinGasPrices(ctx sdk.Context) (sdk.DecCoins, error)

GetMinGasPrices returns the mininum gas prices as sdk.DecCoins from the fee market state.

func (*Keeper) GetParams

func (k *Keeper) GetParams(ctx sdk.Context) (types.Params, error)

GetParams returns the feemarket module's parameters.

func (*Keeper) GetState

func (k *Keeper) GetState(ctx sdk.Context) (types.State, error)

GetState returns the feemarket module's state.

func (*Keeper) InitGenesis

func (k *Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState)

InitGenesis initializes the feemarket module's state from a given genesis state.

func (*Keeper) Logger

func (k *Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a feemarket module-specific logger.

func (*Keeper) ResolveToDenom

func (k *Keeper) ResolveToDenom(ctx sdk.Context, coin sdk.DecCoin, denom string) (sdk.DecCoin, error)

ResolveToDenom converts the given coin to the given denomination.

func (*Keeper) SetDenomResolver

func (k *Keeper) SetDenomResolver(resolver types.DenomResolver)

SetDenomResolver sets the keeper's denom resolver.

func (*Keeper) SetEnabledHeight added in v1.1.0

func (k *Keeper) SetEnabledHeight(ctx sdk.Context, height int64)

SetEnabledHeight sets the height at which the feemarket was enabled.

func (*Keeper) SetParams

func (k *Keeper) SetParams(ctx sdk.Context, params types.Params) error

SetParams sets the feemarket module's parameters.

func (*Keeper) SetState

func (k *Keeper) SetState(ctx sdk.Context, state types.State) error

SetState sets the feemarket module's state.

func (*Keeper) UpdateFeeMarket

func (k *Keeper) UpdateFeeMarket(ctx sdk.Context) error

UpdateFeeMarket updates the base fee and learning rate based on the AIMD learning rate adjustment algorithm. Note that if the fee market is disabled, this function will return without updating the fee market. This is executed in EndBlock which allows the next block's base fee to be readily available for wallets to estimate gas prices.

type MsgServer

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

MsgServer is the server API for x/feemarket Msg service.

func (MsgServer) Params

func (ms MsgServer) Params(goCtx context.Context, msg *types.MsgParams) (*types.MsgParamsResponse, error)

Params defines a method that updates the module's parameters. The signer of the message must be the module authority.

type QueryServer

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

QueryServer defines the gRPC server for the x/feemarket module.

func (QueryServer) GasPrice

GasPrice defines a method that returns the current feemarket base gas price.

func (QueryServer) GasPrices

GasPrices defines a method that returns the current feemarket list of gas prices.

func (QueryServer) Params

Params defines a method that returns the current feemarket parameters.

func (QueryServer) State

State defines a method that returns the current feemarket state.

Jump to

Keyboard shortcuts

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