keeper

package
v0.0.0-...-b3a6efc Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IKeeper

type IKeeper interface {
	GetProviderByAuditor(ctx sdk.Context, id types.ProviderID) (types.Provider, bool)
	GetProviderAttributes(ctx sdk.Context, id sdk.Address) (types.Providers, bool)
	CreateOrUpdateProviderAttributes(ctx sdk.Context, id types.ProviderID, attr akashtypes.Attributes) error
	DeleteProviderAttributes(ctx sdk.Context, id types.ProviderID, keys []string) error
	WithProviders(ctx sdk.Context, fn func(types.Provider) bool)
	WithProvider(ctx sdk.Context, id sdk.Address, fn func(types.Provider) bool)
}

TODO: use interfaces for keepers, queriers

type Keeper

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

Keeper of the provider store

func NewKeeper

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

NewKeeper creates and returns an instance for Market keeper

func (Keeper) Codec

func (k Keeper) Codec() codec.BinaryCodec

Codec returns keeper codec

func (Keeper) CreateOrUpdateProviderAttributes

func (k Keeper) CreateOrUpdateProviderAttributes(ctx sdk.Context, id types.ProviderID, attr akashtypes.Attributes) error

CreateOrUpdateProviderAttributes update signed provider attributes. creates new if key does not exist if key exists, existing values for matching pairs will be replaced

func (Keeper) DeleteProviderAttributes

func (k Keeper) DeleteProviderAttributes(ctx sdk.Context, id types.ProviderID, keys []string) error

func (Keeper) GetProviderAttributes

func (k Keeper) GetProviderAttributes(ctx sdk.Context, id sdk.Address) (types.Providers, bool)

GetProviderAttributes returns a provider with given auditor and owner id's

func (Keeper) GetProviderByAuditor

func (k Keeper) GetProviderByAuditor(ctx sdk.Context, id types.ProviderID) (types.Provider, bool)

GetProviderByAuditor returns a provider with given auditor and owner id

func (Keeper) WithProvider

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

WithProviders iterates all signed provider's attributes

func (Keeper) WithProviders

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

WithProviders iterates all signed provider's attributes

type Migrator

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

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

func NewMigrator

func NewMigrator(k Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2

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

Migrate1to2 migrates from version 1 to 2.

type Querier

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) ProviderAuditorAttributes

func (q Querier) ProviderAuditorAttributes(
	c context.Context,
	req *types.QueryProviderAuditorRequest,
) (*types.QueryProvidersResponse, error)

Jump to

Keyboard shortcuts

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