Help us shape the future of Go! Take the 2026 Go Developer Survey

keeper

package
v0.0.5-test Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hooks

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

Hooks wrapper struct for feemarket keeper

func (Hooks) AfterOracleEnd

func (h Hooks) AfterOracleEnd(ctx sdk.Context, dataSet oracletypes.DataSet)

func (Hooks) BeforeOracleStart

func (h Hooks) BeforeOracleStart(ctx sdk.Context, dataSet oracletypes.DataSet)

oracle hooks

type Keeper

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

Keeper grants access to the Fee Market module state.

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec, authority sdk.AccAddress, storeKey, transientKey storetypes.StoreKey,
) Keeper

NewKeeper generates new fee market module keeper

func (Keeper) AddTransientGasWanted

func (k Keeper) AddTransientGasWanted(ctx sdk.Context, gasWanted uint64) (uint64, error)

AddTransientGasWanted adds the cumulative gas wanted in the transient store

func (Keeper) AfterOracleEnd

func (k Keeper) AfterOracleEnd(ctx sdk.Context, dataSet oracletypes.DataSet)

AfterOracleEnd updates the min gas price at the end of each oracle end

func (Keeper) BaseFee

BaseFee implements the Query/BaseFee gRPC method

func (Keeper) BeforeOracleStart

func (k Keeper) BeforeOracleStart(_ sdk.Context, _ oracletypes.DataSet)

func (Keeper) BlockGas

BlockGas implements the Query/BlockGas gRPC method

func (Keeper) CalculateBaseFee

func (k Keeper) CalculateBaseFee(ctx sdk.Context) sdkmath.LegacyDec

CalculateBaseFee calculates the base fee for the current block. This is only calculated once per block during BeginBlock. If the NoBaseFee parameter is enabled or below activation height, this function returns nil. NOTE: This code is inspired from the go-ethereum EIP1559 implementation and adapted to Cosmos SDK-based chains. For the canonical code refer to: https://github.com/ethereum/go-ethereum/blob/master/consensus/misc/eip1559.go

func (*Keeper) EndBlock

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

EndBlock handles both gas tracking and base fee calculation for the next block

func (Keeper) GetBaseFee

func (k Keeper) GetBaseFee(ctx sdk.Context) math.LegacyDec

GetBaseFee gets the base fee from the store

func (Keeper) GetBaseFeeEnabled

func (k Keeper) GetBaseFeeEnabled(ctx sdk.Context) bool

GetBaseFeeEnabled returns true if base fee is enabled

func (Keeper) GetBlockGasWanted

func (k Keeper) GetBlockGasWanted(ctx sdk.Context) uint64

GetBlockGasWanted returns the last block gas wanted value from the store.

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the total set of fee market parameters.

func (Keeper) GetTransientGasWanted

func (k Keeper) GetTransientGasWanted(ctx sdk.Context) uint64

GetTransientGasWanted returns the gas wanted in the current block from transient store.

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Return the wrapper struct

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) Params

Params implements the Query/Params gRPC method

func (Keeper) SetBaseFee

func (k Keeper) SetBaseFee(ctx sdk.Context, baseFee math.LegacyDec)

SetBaseFee set's the base fee in the store

func (Keeper) SetBlockGasWanted

func (k Keeper) SetBlockGasWanted(ctx sdk.Context, gas uint64)

SetBlockGasWanted sets the block gas wanted to the store. CONTRACT: this should be only called during EndBlock.

func (Keeper) SetParams

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

SetParams sets the fee market params in a single key

func (Keeper) SetTransientBlockGasWanted

func (k Keeper) SetTransientBlockGasWanted(ctx sdk.Context, gasWanted uint64)

SetTransientBlockGasWanted sets the block gas wanted to the transient store.

func (*Keeper) UpdateParams

func (k *Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error)

UpdateParams implements the gRPC MsgServer interface. When an UpdateParams proposal passes, it updates the module parameters. The update can only be performed if the requested authority is the Cosmos SDK governance module account.

Jump to

Keyboard shortcuts

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