keeper

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryParameters        = "params"
	QueryWrkChain          = "wrkchain"
	QueryWrkChainsFiltered = "wrkchains-filtered"
	QueryWrkChainBlock     = "block"
)

query endpoints supported by the wrkchain Querier

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

Types

type Keeper

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

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, authority string) Keeper

NewKeeper creates new instances of the wrkchain Keeper

func (Keeper) Cdc

func (k Keeper) Cdc() codec.BinaryCodec

func (Keeper) GetAllWrkChainBlockHashes

func (k Keeper) GetAllWrkChainBlockHashes(ctx sdk.Context, wrkchainID uint64) (wrkChainBlocks []types.WrkChainBlock)

GetAllWrkChainBlockHashes returns all the wrkchain's hashes from store

func (Keeper) GetAllWrkChainBlockHashesForGenesisExport

func (k Keeper) GetAllWrkChainBlockHashesForGenesisExport(ctx sdk.Context, wrkchainID uint64) (wrkChainBlocks types.WrkChainBlockGenesisExports)

GetAllWrkChainBlockHashesForGenesisExport returns all the wrkchain's hashes from store for export in an optimised format ready for genesis

func (Keeper) GetAllWrkChains

func (k Keeper) GetAllWrkChains(ctx sdk.Context) (wrkChains []types.WrkChain)

GetAllWrkChains returns all the registered wrkchain metadata from store

func (Keeper) GetAuthority added in v1.10.0

func (k Keeper) GetAuthority() string

GetAuthority returns the x/mint module's authority.

func (Keeper) GetHighestWrkChainID

func (k Keeper) GetHighestWrkChainID(ctx sdk.Context) (wrkChainID uint64, err error)

GetHighestWrkChainID gets the highest WRKChain ID

func (Keeper) GetLastWrkChainHeightInState added in v1.6.1

func (k Keeper) GetLastWrkChainHeightInState(ctx sdk.Context, wrkchainID uint64) (height uint64)

func (Keeper) GetMaxPurchasableSlots added in v1.6.1

func (k Keeper) GetMaxPurchasableSlots(ctx sdk.Context, wrkchainId uint64) uint64

func (Keeper) GetParamDefaultStorageLimit added in v1.6.1

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

func (Keeper) GetParamDenom

func (k Keeper) GetParamDenom(ctx sdk.Context) string

func (Keeper) GetParamMaxStorageLimit added in v1.6.1

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

func (Keeper) GetParamPurchaseStorageFee added in v1.6.1

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

func (Keeper) GetParamRecordFee

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

func (Keeper) GetParamRegistrationFee

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

func (Keeper) GetParams

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

GetParams returns the total set of Beacon parameters.

func (Keeper) GetPurchaseStorageFeeAsCoin added in v1.6.1

func (k Keeper) GetPurchaseStorageFeeAsCoin(ctx sdk.Context) sdk.Coin

func (Keeper) GetPurchaseStorageFeeAsCoins added in v1.6.1

func (k Keeper) GetPurchaseStorageFeeAsCoins(ctx sdk.Context) sdk.Coins

func (Keeper) GetRecordFeeAsCoin

func (k Keeper) GetRecordFeeAsCoin(ctx sdk.Context) sdk.Coin

func (Keeper) GetRecordFeeAsCoins

func (k Keeper) GetRecordFeeAsCoins(ctx sdk.Context) sdk.Coins

func (Keeper) GetRegistrationFeeAsCoin

func (k Keeper) GetRegistrationFeeAsCoin(ctx sdk.Context) sdk.Coin

func (Keeper) GetRegistrationFeeAsCoins

func (k Keeper) GetRegistrationFeeAsCoins(ctx sdk.Context) sdk.Coins

func (Keeper) GetWrkChain

func (k Keeper) GetWrkChain(ctx sdk.Context, wrkchainId uint64) (types.WrkChain, bool)

GetWrkChain Gets the entire WRKChain metadata struct for a wrkchainId

func (Keeper) GetWrkChainBlock

func (k Keeper) GetWrkChainBlock(ctx sdk.Context, wrkchainId uint64, height uint64) (types.WrkChainBlock, bool)

GetWrkChainBlock Gets the entire WRKChain metadata struct for a wrkchainId

func (Keeper) GetWrkChainBlockHashesIterator

func (k Keeper) GetWrkChainBlockHashesIterator(ctx sdk.Context, wrkchainID uint64) sdk.Iterator

GetWrkChainBlockHashesIterator Gets an iterator over all WrkChain hashess in which the keys are the WrkChain Ids and the values are the WrkChainBlocks

func (Keeper) GetWrkChainOwner

func (k Keeper) GetWrkChainOwner(ctx sdk.Context, wrkchainId uint64) sdk.AccAddress

GetWrkChainOwner - get the current owner of a WRKChain

func (Keeper) GetWrkChainStorageLimit added in v1.6.1

func (k Keeper) GetWrkChainStorageLimit(ctx sdk.Context, wrkchainId uint64) (types.WrkChainStorageLimit, bool)

func (Keeper) GetWrkChainsFiltered

func (k Keeper) GetWrkChainsFiltered(ctx sdk.Context, params types.QueryWrkChainsFilteredRequest) []types.WrkChain

GetWrkChainsFiltered retrieves wrkchains filtered by a given set of params which include pagination parameters along a moniker and owner address.

NOTE: If no filters are provided, all proposals will be returned in paginated form.

func (Keeper) GetWrkChainsIterator

func (k Keeper) GetWrkChainsIterator(ctx sdk.Context) sdk.Iterator

GetWrkChainsIterator Get an iterator over all WrkChains in which the keys are the WrkChain Ids and the values are the WrkChains

func (Keeper) GetZeroFeeAsCoin

func (k Keeper) GetZeroFeeAsCoin(ctx sdk.Context) sdk.Coin

func (Keeper) GetZeroFeeAsCoins

func (k Keeper) GetZeroFeeAsCoins(ctx sdk.Context) sdk.Coins

func (Keeper) HasWrkChainStorageLimit added in v1.6.1

func (k Keeper) HasWrkChainStorageLimit(ctx sdk.Context, wrkchainId uint64) bool

func (Keeper) IncreaseInStateStorage added in v1.6.1

func (k Keeper) IncreaseInStateStorage(ctx sdk.Context, wrkchainId, amount uint64) error

func (Keeper) IsAuthorisedToRecord

func (k Keeper) IsAuthorisedToRecord(ctx sdk.Context, wrkchainId uint64, recorder sdk.AccAddress) bool

IsAuthorisedToRecord ensures only the WRKChain owner is recording hashes

func (Keeper) IsWrkChainBlockRecorded

func (k Keeper) IsWrkChainBlockRecorded(ctx sdk.Context, wrkchainId uint64, height uint64) bool

IsWrkChainBlockRecorded Check if the WrkChainBlock is present in the store or not

func (Keeper) IsWrkChainRegistered

func (k Keeper) IsWrkChainRegistered(ctx sdk.Context, wrkchainId uint64) bool

IsWrkChainRegistered Checks if the WrkChain is present in the store or not

func (Keeper) IterateWrkChainBlockHashes

func (k Keeper) IterateWrkChainBlockHashes(ctx sdk.Context, wrkchainID uint64, cb func(wrkChain types.WrkChainBlock) (stop bool))

IterateWrkChainBlockHashes iterates over the all the hashes for a wrkchain and performs a callback function

func (Keeper) IterateWrkChainBlockHashesPaginated added in v1.6.1

func (k Keeper) IterateWrkChainBlockHashesPaginated(ctx sdk.Context, wrkchainID uint64, page, limit uint, cb func(wrkChain types.WrkChainBlock) (stop bool))

func (Keeper) IterateWrkChainBlockHashesReverse

func (k Keeper) IterateWrkChainBlockHashesReverse(ctx sdk.Context, wrkchainID uint64, cb func(wrkChain types.WrkChainBlock) (stop bool))

IterateWrkChainBlockHashesReverse iterates over the all the hashes for a wrkchain in reverse order and performs a callback function

func (Keeper) IterateWrkChains

func (k Keeper) IterateWrkChains(ctx sdk.Context, cb func(wrkChain types.WrkChain) (stop bool))

IterateWrkChains iterates over the all the wrkchain metadata and performs a callback function

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) Params

func (Keeper) QuickCheckHeightIsNew added in v1.6.1

func (k Keeper) QuickCheckHeightIsNew(ctx sdk.Context, wrkchainId uint64, height uint64) bool

QuickCheckHeightIsNew Checks if the given height can be recorded

func (Keeper) QuickCheckHeightIsRecorded

func (k Keeper) QuickCheckHeightIsRecorded(ctx sdk.Context, wrkchainId uint64, height uint64) bool

QuickCheckHeightIsRecorded Checks if the given height can be recorded

func (Keeper) RecordNewWrkchainHashes

func (k Keeper) RecordNewWrkchainHashes(
	ctx sdk.Context,
	wrkchainId uint64,
	height uint64,
	blockHash string,
	parentHash string,
	hash1 string,
	hash2 string,
	hash3 string) (uint64, error)

RecordNewWrkchainHashes records a WRKChain block has for a registered WRKChain

func (Keeper) RegisterNewWrkChain

func (k Keeper) RegisterNewWrkChain(ctx sdk.Context, moniker string, wrkchainName string, genesisHash string, baseType string, owner sdk.AccAddress) (uint64, error)

RegisterNewWrkChain registers a WRKChain in the store

func (Keeper) SetHighestWrkChainID

func (k Keeper) SetHighestWrkChainID(ctx sdk.Context, wrkChainID uint64)

SetHighestWrkChainID sets the new highest WRKChain ID to the store

func (Keeper) SetParams

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

SetParams sets the total set of Beacon parameters.

func (Keeper) SetWrkChain

func (k Keeper) SetWrkChain(ctx sdk.Context, wrkchain types.WrkChain) error

SetWrkChain Sets the WrkChain metadata struct for a wrkchainId

func (Keeper) SetWrkChainBlock

func (k Keeper) SetWrkChainBlock(ctx sdk.Context, wrkchainId uint64, wrkchainBlock types.WrkChainBlock) error

SetWrkChainBlock Sets the WrkChain Block struct for a wrkchainId & height

func (Keeper) SetWrkChainStorageLimit added in v1.6.1

func (k Keeper) SetWrkChainStorageLimit(ctx sdk.Context, wrkchainId, limit uint64) error

func (Keeper) WrkChainStorage added in v1.6.1

type Migrator added in v1.6.1

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator added in v1.6.1

func NewMigrator(k Keeper, ss exported.Subspace) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate2to3 added in v1.10.0

func (m Migrator) Migrate2to3(ctx sdk.Context) error

Migrate2to3 migrates the x/wrkchain module state from the consensus version 2 to version 3. Specifically, it takes the parameters that are currently stored and managed by the x/params modules and stores them directly into the x/mint module state.

Jump to

Keyboard shortcuts

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