keeper

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryParameters      = "params"
	QueryBeacon          = "beacon"
	QueryBeacons         = "beacons"
	QueryBeaconTimestamp = "timestamp"
)

query endpoints supported by the beacon Querier

Variables

This section is empty.

Functions

func NewLegacyQuerier

func NewLegacyQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

NewQuerier is the module level router for state queries

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, paramSpace paramtypes.Subspace, cdc codec.BinaryCodec) Keeper

NewKeeper creates new instances of the beacon Keeper

func (Keeper) Beacon

func (Keeper) BeaconStorage added in v1.6.1

func (Keeper) Cdc

func (k Keeper) Cdc() codec.BinaryCodec

func (Keeper) GetAllBeaconTimestamps

func (k Keeper) GetAllBeaconTimestamps(ctx sdk.Context, beaconID uint64) (timestamps []types.BeaconTimestamp)

GetAllBeaconTimestamps Get an iterator over all a Beacon's timestamps in which the keys are the beaconID and the values are the BeaconTimestamps

func (Keeper) GetAllBeaconTimestampsForExport

func (k Keeper) GetAllBeaconTimestampsForExport(ctx sdk.Context, beaconID uint64) (timestamps types.BeaconTimestampGenesisExports)

GetAllBeaconTimestampsForExport Get an iterator over all a Beacon's timestamps in which an optimised version of the timestamp data is returned for genesis export

func (Keeper) GetAllBeacons

func (k Keeper) GetAllBeacons(ctx sdk.Context) (beacons []types.Beacon)

GetAllBeacons returns all the registered BEACON metadata from store

func (Keeper) GetBeacon

func (k Keeper) GetBeacon(ctx sdk.Context, beaconID uint64) (types.Beacon, bool)

GetBeacon Gets the entire BEACON metadata struct for a beaconID

func (Keeper) GetBeaconOwner

func (k Keeper) GetBeaconOwner(ctx sdk.Context, beaconID uint64) sdk.AccAddress

GetBeaconOwner - get the current owner of a BEACON

func (Keeper) GetBeaconStorageLimit added in v1.6.1

func (k Keeper) GetBeaconStorageLimit(ctx sdk.Context, beaconID uint64) (types.BeaconStorageLimit, bool)

func (Keeper) GetBeaconTimestampByID

func (k Keeper) GetBeaconTimestampByID(ctx sdk.Context, beaconID uint64, timestampID uint64) (types.BeaconTimestamp, bool)

GetBeaconTimestampByID Gets the beacon timestamp data for a beaconID and timestampID

func (Keeper) GetBeaconsFiltered

func (k Keeper) GetBeaconsFiltered(ctx sdk.Context, params types.QueryBeaconsFilteredRequest) []types.Beacon

GetBeaconsFiltered retrieves BEACONs 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) GetBeaconsIterator

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

GetBeaconsIterator Get an iterator over all BEACONs in which the keys are the BEACON Ids and the values are the BEACONs

func (Keeper) GetHighestBeaconID

func (k Keeper) GetHighestBeaconID(ctx sdk.Context) (beaconID uint64, err error)

GetHighestBeaconID gets the highest BEACON ID

func (Keeper) GetMaxPurchasableSlots added in v1.6.1

func (k Keeper) GetMaxPurchasableSlots(ctx sdk.Context, beaconId 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) GetZeroFeeAsCoin

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

func (Keeper) GetZeroFeeAsCoins

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

func (Keeper) HasBeaconStorageLimit added in v1.6.1

func (k Keeper) HasBeaconStorageLimit(ctx sdk.Context, beaconID uint64) bool

func (Keeper) IncreaseInStateStorage added in v1.6.1

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

func (Keeper) IsAuthorisedToRecord

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

IsAuthorisedToRecord ensures only the BEACON owner is recording hashes

func (Keeper) IsBeaconRegistered

func (k Keeper) IsBeaconRegistered(ctx sdk.Context, beaconID uint64) bool

IsBeaconRegistered Checks if the BEACON is present in the store or not

func (Keeper) IsBeaconTimestampRecordedByID

func (k Keeper) IsBeaconTimestampRecordedByID(ctx sdk.Context, beaconID uint64, timestampID uint64) bool

IsBeaconTimestampRecordedByID Deep Check if the BEACON timestamp is present in the store or not, given the beaconID and timestampID

func (Keeper) IterateBeaconTimestamps

func (k Keeper) IterateBeaconTimestamps(ctx sdk.Context, beaconID uint64, cb func(beaconTimestamp types.BeaconTimestamp) (stop bool))

IterateBeacons iterates over the all the BEACON's timestamps and performs a callback function

func (Keeper) IterateBeaconTimestampsReverse

func (k Keeper) IterateBeaconTimestampsReverse(ctx sdk.Context, beaconID uint64, cb func(beaconTimestamp types.BeaconTimestamp) (stop bool))

IterateBeaconTimestampsReverse iterates over the all the BEACON's timestamps in reverse order and performs a callback function

func (Keeper) IterateBeacons

func (k Keeper) IterateBeacons(ctx sdk.Context, cb func(beacon types.Beacon) (stop bool))

IterateBeacons iterates over the all the BEACON 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) RecordNewBeaconTimestamp

func (k Keeper) RecordNewBeaconTimestamp(
	ctx sdk.Context,
	beaconId uint64,
	hash string,
	submitTime uint64) (uint64, uint64, error)

RecordBeaconTimestamp records a BEACON timestamp hash for a registered BEACON

func (Keeper) RegisterNewBeacon

func (k Keeper) RegisterNewBeacon(ctx sdk.Context, beacon types.Beacon) (uint64, error)

RegisterBeacon registers a BEACON in the store

func (Keeper) SetBeacon

func (k Keeper) SetBeacon(ctx sdk.Context, beacon types.Beacon) error

SetBeacon Sets the BEACON metadata struct for a beaconID

func (Keeper) SetBeaconStorageLimit added in v1.6.1

func (k Keeper) SetBeaconStorageLimit(ctx sdk.Context, beaconId, limit uint64) error

func (Keeper) SetBeaconTimestamp

func (k Keeper) SetBeaconTimestamp(ctx sdk.Context, beaconId uint64, beaconTimestamp types.BeaconTimestamp) error

SetBeaconTimestamp Sets the Beacon timestamp struct for a beaconID + timestampID

func (Keeper) SetHighestBeaconID

func (k Keeper) SetHighestBeaconID(ctx sdk.Context, beaconID uint64)

SetHighestBeaconID sets the new highest BEACON ID to the store

func (Keeper) SetParams

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

SetParams sets the total set of Beacon parameters.

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(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

Jump to

Keyboard shortcuts

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