keeper

package
v0.17.2-rc4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IKeeper added in v0.10.0

type IKeeper interface {
	Codec() codec.BinaryCodec
	Get(ctx sdk.Context, id sdk.Address) (types.Provider, bool)
	Create(ctx sdk.Context, provider types.Provider) error
	WithProviders(ctx sdk.Context, fn func(types.Provider) bool)
	Update(ctx sdk.Context, provider types.Provider) error
	Delete(ctx sdk.Context, id sdk.Address)
	NewQuerier() Querier
}

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, skey sdk.StoreKey) IKeeper

NewKeeper creates and returns an instance for Provider keeper

type Keeper

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

Keeper of the provider store

func (Keeper) Codec

func (k Keeper) Codec() codec.BinaryCodec

Codec returns keeper codec

func (Keeper) Create

func (k Keeper) Create(ctx sdk.Context, provider types.Provider) error

Create creates a new provider or returns an error if the provider exists already

func (Keeper) Delete

func (k Keeper) Delete(ctx sdk.Context, id sdk.Address)

Delete delete a provider

func (Keeper) Get

func (k Keeper) Get(ctx sdk.Context, id sdk.Address) (types.Provider, bool)

Get returns a provider with given provider id

func (Keeper) NewQuerier added in v0.10.0

func (k Keeper) NewQuerier() Querier

func (Keeper) Update

func (k Keeper) Update(ctx sdk.Context, provider types.Provider) error

Update updates a provider details

func (Keeper) WithProviders

func (k Keeper) WithProviders(ctx sdk.Context, fn func(types.Provider) bool)

WithProviders iterates all providers

type Migrator added in v0.16.0

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

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

func NewMigrator added in v0.16.0

func NewMigrator(k IKeeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2 added in v0.16.0

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

Migrate1to2 migrates from version 1 to 2.

type Querier added in v0.9.1

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) Provider added in v0.9.1

Provider returns provider details based on owner address

func (Querier) Providers added in v0.9.1

Providers returns providers list

Jump to

Keyboard shortcuts

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