keeper

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 28 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RecordIDKey     = recordIDCodec{}
	SettlementIDKey = settlementIDCodec{}
)
View Source
var (
	ParamsKey         = collections.NewPrefix([]byte{0x01, 0x00})
	TransfersKey      = collections.NewPrefix([]byte{0x02, 0x00})
	SettlementsKey    = collections.NewPrefix([]byte{0x03, 0x01})
	TotalsKey         = collections.NewPrefix([]byte{0x04, 0x00})
	AccountsKey       = collections.NewPrefix([]byte{0x04, 0x01})
	SendUsageKey      = collections.NewPrefix([]byte{0x04, 0x02})
	RefundUsageKey    = collections.NewPrefix([]byte{0x04, 0x03})
	RefundQueueKey    = collections.NewPrefix([]byte{0x05, 0x00})
	SequenceKey       = collections.NewPrefix([]byte{0x06, 0x00})
	PoliciesKey       = collections.NewPrefix([]byte{0x07, 0x00})
	PolicySequenceKey = collections.NewPrefix([]byte{0x07, 0x01})
	HistoryKey        = collections.NewPrefix([]byte{0x08, 0x00})
	DisputesKey       = collections.NewPrefix([]byte{0x08, 0x01})
)

Functions

func Address

func Address() sdk.AccAddress

func SettlementKey

func SettlementKey(id types.SettlementID) ([]byte, error)

func TransferKey

func TransferKey(id types.ID) ([]byte, error)

func ValidateGenesis

func ValidateGenesis(g *types.GenesisState) error

ValidateGenesis checks genesis state without store access. Beyond the SDK shape checks it requires the reporter policy that params describe: without a policy sequence the reporter set is empty, otherwise the policy at the sequence exists and matches params. SetParams and every reporter command load that policy, so a genesis without it could only be repaired by a chain upgrade.

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(context.Context, sdk.AccAddress) sdk.AccountI
	GetModuleAccount(context.Context, string) sdk.ModuleAccountI
	SetAccount(context.Context, sdk.AccountI)
}

type BankKeeper

type BankKeeper interface {
	SendCoinsFromAccountToModule(context.Context, sdk.AccAddress, string, sdk.Coins) error
	SendCoinsFromModuleToAccount(context.Context, string, sdk.AccAddress, sdk.Coins) error
	GetAllBalances(context.Context, sdk.AccAddress) sdk.Coins
}

type DepositDecorator

type DepositDecorator struct{}

DepositDecorator records transaction shape, never ledger state or bank access. A nested MsgSink receives no capability, even if it authenticates the sender.

func NewDepositDecorator

func NewDepositDecorator() DepositDecorator

func (DepositDecorator) AnteHandle

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

type Distribution

type Distribution interface {
	FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error
	IterateDelegatorWithdrawAddrs(ctx context.Context, handler func(del, addr sdk.AccAddress) (stop bool))
	DeleteDelegatorWithdrawAddr(ctx context.Context, delAddr, withdrawAddr sdk.AccAddress) error
}

Distribution receives coins found at the sink address before installation and holds the withdraw addresses that may point at it.

type EpochKeeper

type EpochKeeper interface {
	GetEpoch(sdk.Context, string) (epochstypes.EpochInfo, error)
}

type Keeper

type Keeper interface {
	Schema() collections.Schema
	NewQuerier() Querier
	BeginBlocker(context.Context) error

	GetAuthority() string
	GetCurrentPolicy(context.Context) (types.ReporterPolicy, error)
	SetParams(sdk.Context, types.Params) error
	GetParams(context.Context) (types.Params, error)
	GetTotals(context.Context) (types.Totals, error)
	GetAccountUsage(context.Context, sdk.AccAddress) (types.AccountUsage, error)
	GetTransfer(context.Context, types.ID) (types.TransferState, error)

	Deposit(sdk.Context, *types.MsgSink) (types.ID, error)

	GuardianPause(sdk.Context, *types.MsgGuardianPause) error
	RequestVoid(sdk.Context, *types.MsgRequestVoid) error
	ReportOutcome(sdk.Context, *types.MsgReportOutcome) error
	VetoVoid(sdk.Context, *types.MsgVetoVoid) error
	Resolve(sdk.Context, types.Resolution) error
	FinalizeRefund(sdk.Context, *types.MsgFinalizeRefund) error

	CheckBalance(sdk.Context) error
	PrepareInstall(sdk.Context, Distribution) (sdk.Coins, error)
	InitGenesis(sdk.Context, *types.GenesisState) error
	ExportGenesis(sdk.Context) (*types.GenesisState, error)
	ValidateExportHeight(sdk.Context, int64) error
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	key *storetypes.KVStoreKey,
	tkey *storetypes.TransientStoreKey,
	accounts AccountKeeper,
	bank BankKeeper,
	epochs EpochKeeper,
	authority string,
) Keeper

type Querier

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

func (Querier) Account

Account returns the owner's usage normalized to the current native epoch.

func (Querier) BeginBlocker

func (k Querier) BeginBlocker(ctx context.Context) error

BeginBlocker is called at the beginning of each block

func (Querier) CheckBalance

func (k Querier) CheckBalance(ctx sdk.Context) error

func (Querier) Deposit

func (k Querier) Deposit(ctx sdk.Context, msg *types.MsgSink) (types.ID, error)

Deposit validates and escrows one deposit, writes its immutable proof record and returns that record's ID.

func (Querier) Disputes

Disputes pages through held transfers in chronological order with native pagination keys.

func (Querier) EndBlocker

func (k Querier) EndBlocker(_ context.Context) error

func (Querier) ExportGenesis

func (k Querier) ExportGenesis(ctx sdk.Context) (*types.GenesisState, error)

func (Querier) FinalizeRefund

func (k Querier) FinalizeRefund(ctx sdk.Context, msg *types.MsgFinalizeRefund) error

FinalizeRefund pays exactly one original sender and never releases minted escrow.

func (Querier) GetAccountUsage

func (k Querier) GetAccountUsage(ctx context.Context, owner sdk.AccAddress) (types.AccountUsage, error)

func (Querier) GetAuthority

func (k Querier) GetAuthority() string

func (Querier) GetCurrentPolicy

func (k Querier) GetCurrentPolicy(ctx context.Context) (types.ReporterPolicy, error)

func (Querier) GetParams

func (k Querier) GetParams(ctx context.Context) (types.Params, error)

func (Querier) GetTotals

func (k Querier) GetTotals(ctx context.Context) (types.Totals, error)

func (Querier) GetTransfer

func (k Querier) GetTransfer(ctx context.Context, id types.ID) (types.TransferState, error)

func (Querier) GuardianPause

func (k Querier) GuardianPause(ctx sdk.Context, msg *types.MsgGuardianPause) error

GuardianPause lets params.pause_guardian turn off deposits, refunds or both. It can only clear params.enabled and params.refunds_enabled; enabling either again, or changing the guardian, takes governance. Params are stored without revalidation. Clearing these switches only relaxes the rules, and a pause must not fail because a stored value predates a newer rule.

func (Querier) InitGenesis

func (k Querier) InitGenesis(ctx sdk.Context, g *types.GenesisState) error

InitGenesis imports a validated snapshot into an empty store. Totals are recomputed and compared by GenesisState.Validate, so records are written without replaying settlement accounting. All writes share one cache, so a rejected import leaves no state behind.

func (Querier) NewQuerier

func (k Querier) NewQuerier() Querier

func (Querier) Params

func (Querier) PrepareInstall

func (k Querier) PrepareInstall(ctx sdk.Context, pool Distribution) (sdk.Coins, error)

PrepareInstall readies the deterministic sink address for an upgrade that adds this module, before migrations run sink InitGenesis. Anyone can send coins to the address or create an account there before the upgrade height, so neither may fail the upgrade. A non-module account becomes the sink module account with the same account number. Its whole balance then moves to the community pool. Withdraw addresses set to the sink address, which only becomes a blocked address with this module, are cleared so rewards go to the delegators themselves. It returns the moved coins.

func (Querier) ReportOutcome

func (k Querier) ReportOutcome(ctx sdk.Context, msg *types.MsgReportOutcome) error

func (Querier) Reporters

Reporters returns the current policy for version 0, every retained policy for math.MaxUint64 and otherwise the requested version.

func (Querier) RequestVoid

func (k Querier) RequestVoid(ctx sdk.Context, msg *types.MsgRequestVoid) error

RequestVoid commits a permanent governance order for proof on Solana. The order cannot release escrow without a separate final void authorization.

func (Querier) Resolve

func (k Querier) Resolve(ctx sdk.Context, msg types.Resolution) error

func (Querier) Schema

func (k Querier) Schema() collections.Schema

func (Querier) SetParams

func (k Querier) SetParams(ctx sdk.Context, p types.Params) error

func (Querier) State

State returns totals, usage normalized to the current native epoch and the oldest unheld refund candidate under governance or the current policy. Store read failures are Internal; epoch and usage clock errors keep their module errors.

func (Querier) Transfer

func (Querier) Transfers

Transfers lists transfers as the deployment and market queries do. An owner filter walks that owner's transfers in (height, sequence) order, a status filter alone walks its settlement bucket, and no filter walks the chronological history. The cursor carries the walk, so request filters are ignored on resume. Offset requires a status filter.

func (Querier) ValidateExportHeight

func (k Querier) ValidateExportHeight(ctx sdk.Context, initialHeight int64) error

ValidateExportHeight applies InitGenesis's height rule to the stored transfers: a snapshot for a chain whose genesis has initialHeight may hold only transfers and void requests from earlier blocks. Transfer IDs keep their deposit height, so a zero-height export of any transfer fails.

func (Querier) VetoVoid

func (k Querier) VetoVoid(ctx sdk.Context, msg *types.MsgVetoVoid) error

Jump to

Keyboard shortcuts

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