keeper

package
v1.8.0-rc02-3d-migrati... Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type Keeper

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

Keeper of the gasless store.

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	paramSpace paramstypes.Subspace,
	interfaceRegistry codectypes.InterfaceRegistry,
	bankKeeper types.BankKeeper,
	wasmKeeper *wasmkeeper.Keeper,
) Keeper

NewKeeper creates a new gasless Keeper instance.

func (Keeper) AddGasTankIdToUsageIdentifiers

func (k Keeper) AddGasTankIdToUsageIdentifiers(ctx sdk.Context, usageIdentifiers []string, gasTankID uint64) error

func (Keeper) BlockConsumer

func (k Keeper) BlockConsumer(ctx sdk.Context, msg *types.MsgBlockConsumer) (types.GasConsumer, error)

func (Keeper) CanGasTankBeUsedAsSource

func (k Keeper) CanGasTankBeUsedAsSource(ctx sdk.Context, gtid uint64, consumer types.GasConsumer, fee sdk.Coin) (gasTank types.GasTank, isValid bool, err error)

func (Keeper) CreateGasTank

func (k Keeper) CreateGasTank(ctx sdk.Context, msg *types.MsgCreateGasTank) (types.GasTank, error)

func (Keeper) DeleteUsageIdentifierToGasTankIds

func (k Keeper) DeleteUsageIdentifierToGasTankIds(ctx sdk.Context, usageIdentifierToGasTankIds types.UsageIdentifierToGasTankIds) error

DeleteUsageIdentifierToGasTankIds deletes an UsageIdentifierToGasTankIds.

func (Keeper) EmitFeeConsumptionEvent

func (k Keeper) EmitFeeConsumptionEvent(
	ctx sdk.Context,
	feeSource sdk.AccAddress,
	failedGasTankIDs []uint64,
	failedGasTankErrors []error,
	succeededGtid uint64,
)

func (Keeper) ExportGenesis

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

ExportGenesis returns the capability module's exported genesis.

func (Keeper) ExtractUsageIdentifierFromTx

func (k Keeper) ExtractUsageIdentifierFromTx(ctx sdk.Context, sdkTx sdk.Tx) string

func (Keeper) GasTankBaseValidation

func (k Keeper) GasTankBaseValidation(ctx sdk.Context, gasTankID uint64, provider string) (types.GasTank, error)

func (Keeper) GetAllAvailableContracts

func (k Keeper) GetAllAvailableContracts(ctx sdk.Context) (contractsDetails []*types.ContractDetails)

func (Keeper) GetAllContractInfos

func (k Keeper) GetAllContractInfos(ctx sdk.Context) (contractInfos []wasmtypes.ContractInfo)

func (Keeper) GetAllContractsByCode

func (k Keeper) GetAllContractsByCode(ctx sdk.Context, codeID uint64) (contracts []string)

func (Keeper) GetAllGasConsumers

func (k Keeper) GetAllGasConsumers(ctx sdk.Context) (gasConsumers []types.GasConsumer)

func (Keeper) GetAllGasTanks

func (k Keeper) GetAllGasTanks(ctx sdk.Context) (gasTanks []types.GasTank)

func (Keeper) GetAllUsageIdentifierToGasTankIds

func (k Keeper) GetAllUsageIdentifierToGasTankIds(ctx sdk.Context) (allUsageIdentifierToGasTankIds []types.UsageIdentifierToGasTankIds, err error)

func (Keeper) GetAvailableMessageTypes

func (k Keeper) GetAvailableMessageTypes(_ sdk.Context) []string

func (Keeper) GetAvailableUsageIdentifiers

func (k Keeper) GetAvailableUsageIdentifiers(ctx sdk.Context) types.UsageIdentifiers

func (Keeper) GetFeeSource

func (k Keeper) GetFeeSource(ctx sdk.Context, sdkTx sdk.Tx, originalFeePayer sdk.AccAddress, fees sdk.Coins) sdk.AccAddress

func (Keeper) GetGasConsumer

func (k Keeper) GetGasConsumer(ctx sdk.Context, consumer sdk.AccAddress) (gasConsumer types.GasConsumer, found bool)

func (Keeper) GetGasTank

func (k Keeper) GetGasTank(ctx sdk.Context, id uint64) (gasTank types.GasTank, found bool)

func (Keeper) GetGasTankReserveBalance

func (k Keeper) GetGasTankReserveBalance(ctx sdk.Context, gasTank types.GasTank) sdk.Coin

func (Keeper) GetLastGasTankID

func (k Keeper) GetLastGasTankID(ctx sdk.Context) (id uint64)

func (Keeper) GetNextGasTankIDWithUpdate

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

func (Keeper) GetOrCreateGasConsumer

func (k Keeper) GetOrCreateGasConsumer(ctx sdk.Context, consumer sdk.AccAddress, gasTank types.GasTank) (gasConsumer types.GasConsumer, consumptionIndex uint64)

func (Keeper) GetParams

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

GetParams returns the parameters for the gasless module.

func (Keeper) GetUpdatedGasConsumerAndConsumptionIndex

func (k Keeper) GetUpdatedGasConsumerAndConsumptionIndex(ctx sdk.Context, consumerAddress sdk.AccAddress, gasTank types.GasTank, feeAmount sdkmath.Int) (types.GasConsumer, uint64)

func (Keeper) GetUsageIdentifierToGasTankIds

func (k Keeper) GetUsageIdentifierToGasTankIds(ctx sdk.Context, usageIdentifier string) (types.UsageIdentifierToGasTankIds, bool)

func (Keeper) InitGenesis

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

InitGenesis initializes the capability module's state from a provided genesis state.

func (Keeper) IsValidUsageIdentifier

func (k Keeper) IsValidUsageIdentifier(ctx sdk.Context, usageIdentifier string) bool

func (Keeper) IterateAllGasConsumers

func (k Keeper) IterateAllGasConsumers(ctx sdk.Context, cb func(gasConsumer types.GasConsumer) (stop bool, err error)) error

func (Keeper) IterateAllGasTanks

func (k Keeper) IterateAllGasTanks(ctx sdk.Context, cb func(gasTank types.GasTank) (stop bool, err error)) error

func (Keeper) LastUsedGasTankID

func (k Keeper) LastUsedGasTankID(ctx sdk.Context, usageIdentifier string) (uint64, error)

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) RemoveAllGasTankIdsForUsageIdentifier

func (k Keeper) RemoveAllGasTankIdsForUsageIdentifier(ctx sdk.Context, usageIdentifier string) error

func (Keeper) RemoveGasTankIdFromUsageIdentifiers

func (k Keeper) RemoveGasTankIdFromUsageIdentifiers(ctx sdk.Context, usageIdentifiers []string, gasTankID uint64) error

func (Keeper) SetGasConsumer

func (k Keeper) SetGasConsumer(ctx sdk.Context, gasConsumer types.GasConsumer)

func (Keeper) SetGasTank

func (k Keeper) SetGasTank(ctx sdk.Context, gasTank types.GasTank)

func (Keeper) SetLastGasTankID

func (k Keeper) SetLastGasTankID(ctx sdk.Context, id uint64)

func (Keeper) SetParams

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

SetParams sets the parameters for the gasless module.

func (Keeper) SetUsageIdentifierToGasTankIds

func (k Keeper) SetUsageIdentifierToGasTankIds(ctx sdk.Context, usageIdentifierToGasTankIds types.UsageIdentifierToGasTankIds) error

func (Keeper) UnblockConsumer

func (k Keeper) UnblockConsumer(ctx sdk.Context, msg *types.MsgUnblockConsumer) (types.GasConsumer, error)

func (Keeper) UpdateConsumerAllowance

func (k Keeper) UpdateConsumerAllowance(ctx sdk.Context, gasTank types.GasTank)

func (Keeper) UpdateGasConsumerLimit

func (k Keeper) UpdateGasConsumerLimit(ctx sdk.Context, msg *types.MsgUpdateGasConsumerLimit) (types.GasConsumer, error)

func (Keeper) UpdateGasTankConfig

func (k Keeper) UpdateGasTankConfig(ctx sdk.Context, msg *types.MsgUpdateGasTankConfig) (types.GasTank, error)

func (Keeper) UpdateGasTankStatus

func (k Keeper) UpdateGasTankStatus(ctx sdk.Context, msg *types.MsgUpdateGasTankStatus) (types.GasTank, error)

func (Keeper) ValidatMsgUpdateGasTankStatus

func (k Keeper) ValidatMsgUpdateGasTankStatus(ctx sdk.Context, msg *types.MsgUpdateGasTankStatus) error

func (Keeper) ValidateMsgBlockConsumer

func (k Keeper) ValidateMsgBlockConsumer(ctx sdk.Context, msg *types.MsgBlockConsumer) error

func (Keeper) ValidateMsgCreateGasTank

func (k Keeper) ValidateMsgCreateGasTank(ctx sdk.Context, msg *types.MsgCreateGasTank) error

func (Keeper) ValidateMsgUnblockConsumer

func (k Keeper) ValidateMsgUnblockConsumer(ctx sdk.Context, msg *types.MsgUnblockConsumer) error

func (Keeper) ValidateMsgUpdateGasConsumerLimit

func (k Keeper) ValidateMsgUpdateGasConsumerLimit(ctx sdk.Context, msg *types.MsgUpdateGasConsumerLimit) error

func (Keeper) ValidateMsgUpdateGasTankConfig

func (k Keeper) ValidateMsgUpdateGasTankConfig(ctx sdk.Context, msg *types.MsgUpdateGasTankConfig) error

type Querier

type Querier struct {
	Keeper
}

Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper.

func (Querier) GasConsumer

func (Querier) GasTank

func (Querier) GasTanks

func (Querier) Params

Params queries the parameters of the gasless module.

Jump to

Keyboard shortcuts

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