Documentation
¶
Index ¶
- Variables
- func Address() sdk.AccAddress
- func SettlementKey(id types.SettlementID) ([]byte, error)
- func TransferKey(id types.ID) ([]byte, error)
- func ValidateGenesis(g *types.GenesisState) error
- type AccountKeeper
- type BankKeeper
- type DepositDecorator
- type Distribution
- type EpochKeeper
- type Keeper
- type Querier
- func (q Querier) Account(ctx context.Context, req *types.QueryAccountRequest) (*types.QueryAccountResponse, error)
- func (k Querier) BeginBlocker(ctx context.Context) error
- func (k Querier) CheckBalance(ctx sdk.Context) error
- func (k Querier) Deposit(ctx sdk.Context, msg *types.MsgSink) (types.ID, error)
- func (q Querier) Disputes(ctx context.Context, req *types.QueryDisputesRequest) (*types.QueryDisputesResponse, error)
- func (k Querier) EndBlocker(_ context.Context) error
- func (k Querier) ExportGenesis(ctx sdk.Context) (*types.GenesisState, error)
- func (k Querier) FinalizeRefund(ctx sdk.Context, msg *types.MsgFinalizeRefund) error
- func (k Querier) GetAccountUsage(ctx context.Context, owner sdk.AccAddress) (types.AccountUsage, error)
- func (k Querier) GetAuthority() string
- func (k Querier) GetCurrentPolicy(ctx context.Context) (types.ReporterPolicy, error)
- func (k Querier) GetParams(ctx context.Context) (types.Params, error)
- func (k Querier) GetTotals(ctx context.Context) (types.Totals, error)
- func (k Querier) GetTransfer(ctx context.Context, id types.ID) (types.TransferState, error)
- func (k Querier) GuardianPause(ctx sdk.Context, msg *types.MsgGuardianPause) error
- func (k Querier) InitGenesis(ctx sdk.Context, g *types.GenesisState) error
- func (k Querier) NewQuerier() Querier
- func (q Querier) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Querier) PrepareInstall(ctx sdk.Context, pool Distribution) (sdk.Coins, error)
- func (k Querier) ReportOutcome(ctx sdk.Context, msg *types.MsgReportOutcome) error
- func (q Querier) Reporters(ctx context.Context, req *types.QueryReportersRequest) (*types.QueryReportersResponse, error)
- func (k Querier) RequestVoid(ctx sdk.Context, msg *types.MsgRequestVoid) error
- func (k Querier) Resolve(ctx sdk.Context, msg types.Resolution) error
- func (k Querier) Schema() collections.Schema
- func (k Querier) SetParams(ctx sdk.Context, p types.Params) error
- func (q Querier) State(ctx context.Context, _ *types.QueryStateRequest) (*types.QueryStateResponse, error)
- func (q Querier) Transfer(ctx context.Context, req *types.QueryTransferRequest) (*types.QueryTransferResponse, error)
- func (q Querier) Transfers(ctx context.Context, req *types.QueryTransfersRequest) (*types.QueryTransfersResponse, error)
- func (k Querier) ValidateExportHeight(ctx sdk.Context, initialHeight int64) error
- func (k Querier) VetoVoid(ctx sdk.Context, msg *types.MsgVetoVoid) error
Constants ¶
This section is empty.
Variables ¶
var ( RecordIDKey = recordIDCodec{} SettlementIDKey = settlementIDCodec{} )
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 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 BankKeeper ¶
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 ¶
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 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 ¶
func (q Querier) Account(ctx context.Context, req *types.QueryAccountRequest) (*types.QueryAccountResponse, error)
Account returns the owner's usage normalized to the current native epoch.
func (Querier) BeginBlocker ¶
BeginBlocker is called at the beginning of each block
func (Querier) CheckBalance ¶
func (Querier) Deposit ¶
Deposit validates and escrows one deposit, writes its immutable proof record and returns that record's ID.
func (Querier) Disputes ¶
func (q Querier) Disputes(ctx context.Context, req *types.QueryDisputesRequest) (*types.QueryDisputesResponse, error)
Disputes pages through held transfers in chronological order with native pagination keys.
func (Querier) EndBlocker ¶
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) GetTransfer ¶
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 (q Querier) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Querier) PrepareInstall ¶
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 ¶
func (q Querier) Reporters(ctx context.Context, req *types.QueryReportersRequest) (*types.QueryReportersResponse, error)
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) Schema ¶
func (k Querier) Schema() collections.Schema
func (Querier) State ¶
func (q Querier) State(ctx context.Context, _ *types.QueryStateRequest) (*types.QueryStateResponse, error)
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 (q Querier) Transfer(ctx context.Context, req *types.QueryTransferRequest) (*types.QueryTransferResponse, error)
func (Querier) Transfers ¶
func (q Querier) Transfers(ctx context.Context, req *types.QueryTransfersRequest) (*types.QueryTransfersResponse, error)
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 ¶
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.