keeper

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func NewQuerier

func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

NewQuerier creates a querier for auth REST endpoints

Types

type Keeper

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

Keeper is the concrete state-based API for the metadata module.

func NewKeeper

func NewKeeper(
	cdc codec.BinaryMarshaler, key sdk.StoreKey, paramSpace paramtypes.Subspace,
	authKeeper authkeeper.AccountKeeper,
) Keeper

NewKeeper creates new instances of the metadata Keeper.

func (Keeper) AccountIsMarker

func (k Keeper) AccountIsMarker(ctx sdk.Context, address string) bool

func (Keeper) CreateAccountForKey

func (k Keeper) CreateAccountForKey(ctx sdk.Context, addr sdk.AccAddress, pubKey cryptotypes.PubKey) error

CreateAccountForKey creates a new account for the given address with a public key set if given.

func (Keeper) CreateRawSignature

func (k Keeper) CreateRawSignature(txf clienttx.Factory, name string, txBuilder client.TxBuilder, message []byte, appendSignature bool) error

CreateRawSignature creates a standard TX signature but uses the message bytes as provided instead of the typical approach of building a signing structure with sequence, chain-id, and account number. This approach is required for independent signatures like those used in the contract memorialize process which are independent of blockchain tx and their replay protection.

func (Keeper) DeleteScope

func (k Keeper) DeleteScope(ctx sdk.Context, id types.MetadataAddress)

DeleteScope removes a scope from the module kv store.

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) (data *types.GenesisState)

ExportGenesis exports the current keeper state of the metadata module.ExportGenesis

func (Keeper) GetAccount

func (k Keeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI

GetAccount looks up an account by address

func (Keeper) GetGroupSpecification

func (k Keeper) GetGroupSpecification(ctx sdk.Context, id types.MetadataAddress) (spec types.GroupSpecification, found bool)

GetGroupSpecification returns the record with the given id.

func (Keeper) GetParams

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

GetParams returns the total set of metadata parameters.

func (Keeper) GetRecord

func (k Keeper) GetRecord(ctx sdk.Context, id types.MetadataAddress) (group types.Record, found bool)

GetRecord returns the record with the given id.

func (Keeper) GetRecordGroup

func (k Keeper) GetRecordGroup(ctx sdk.Context, id types.MetadataAddress) (group types.RecordGroup, found bool)

GetRecordGroup returns the scope with the given id.

func (Keeper) GetScope

func (k Keeper) GetScope(ctx sdk.Context, id types.MetadataAddress) (scope types.Scope, found bool)

GetScope returns the scope with the given id.

func (Keeper) GetScopeSpecification

func (k Keeper) GetScopeSpecification(ctx sdk.Context, id types.MetadataAddress) (spec types.ScopeSpecification, found bool)

GetScopeSpecification returns the record with the given id.

func (Keeper) GroupContext

GroupContext returns a specific group context within a scope (or all groups)

func (Keeper) HasSignerWithMarkerValueAuthority

func (k Keeper) HasSignerWithMarkerValueAuthority(ctx sdk.Context, valueOwner string, signers []string, role markertypes.Access) bool

HasSignerWithMarkerValueAuthority checks the list of signers for any that have the requested role.

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)

InitGenesis creates the initial genesis state for the metadata module.

func (Keeper) IterateGroups

func (k Keeper) IterateGroups(ctx sdk.Context, scopeID types.MetadataAddress, handler func(types.RecordGroup) (stop bool)) error

IterateGroups processes all stored scopes with the given handler.

func (Keeper) IterateRecords

func (k Keeper) IterateRecords(ctx sdk.Context, scopeID types.MetadataAddress, handler func(types.Record) (stop bool)) error

IterateRecords processes all records in a scope with the given handler.

func (Keeper) IterateScopes

func (k Keeper) IterateScopes(ctx sdk.Context, handler func(types.Scope) (stop bool)) error

IterateScopes processes all stored scopes with the given handler.

func (Keeper) IterateScopesForAddress

func (k Keeper) IterateScopesForAddress(ctx sdk.Context, address sdk.AccAddress, handler func(scopeID types.MetadataAddress) (stop bool)) error

IterateScopesForAddress processes scopes associated with the provided address with the given handler.

func (Keeper) IterateScopesForScopeSpec

func (k Keeper) IterateScopesForScopeSpec(ctx sdk.Context, scopeSpecID types.MetadataAddress,
	handler func(scopeID types.MetadataAddress) (stop bool),
) error

IterateScopesForScopeSpec processes scopes associated with the provided scope specification id with the given handler.

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) Ownership

Ownership returns a list of scope identifiers that list the given address as a data or value owner

func (Keeper) Params

Params queries params of metadata module

func (Keeper) Record

Record returns a collection of the records in a scope or a specific one by name

func (Keeper) RemoveRecord

func (k Keeper) RemoveRecord(ctx sdk.Context, id types.MetadataAddress)

RemoveRecord removes a scope from the module kv store.

func (Keeper) RemoveRecordGroup

func (k Keeper) RemoveRecordGroup(ctx sdk.Context, id types.MetadataAddress)

RemoveRecordGroup removes a scope from the module kv store.

func (Keeper) Scope

Scope returns a specific scope by id

func (Keeper) SetGroupSpecification

func (k Keeper) SetGroupSpecification(ctx sdk.Context, spec types.GroupSpecification)

SetGroupSpecification stores a group specification in the module kv store.

func (Keeper) SetParams

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

SetParams sets the metadata parameters to the param space.

func (Keeper) SetRecord

func (k Keeper) SetRecord(ctx sdk.Context, record types.Record)

SetRecord stores a group in the module kv store.

func (Keeper) SetRecordGroup

func (k Keeper) SetRecordGroup(ctx sdk.Context, group types.RecordGroup)

SetRecordGroup stores a group in the module kv store.

func (Keeper) SetScope

func (k Keeper) SetScope(ctx sdk.Context, scope types.Scope)

SetScope stores a scope in the module kv store.

func (Keeper) SetScopeSpecification

func (k Keeper) SetScopeSpecification(ctx sdk.Context, spec types.ScopeSpecification)

SetScopeSpecification stores a group specification in the module kv store.

func (Keeper) ValidateRawSignature

func (k Keeper) ValidateRawSignature(signature signing.SignatureDescriptor, message []byte) (addr sdk.AccAddress, err error)

ValidateRawSignature takes a given message and verifies the signature instance is valid for it directly without calculating a signing structure to wrap it. ValidateRawSignature returns the address of the user who created the signature and any encountered errors.

func (Keeper) ValidateScopeRemove

func (k Keeper) ValidateScopeRemove(ctx sdk.Context, existing, proposed types.Scope, signers []string) error

ValidateScopeRemove checks the current scope and the proposed removal scope to determine if the the proposed remove is valid based on the existing state

func (Keeper) ValidateScopeUpdate

func (k Keeper) ValidateScopeUpdate(ctx sdk.Context, existing, proposed types.Scope, signers []string) error

ValidateScopeUpdate checks the current scope and the proposed scope to determine if the the proposed changes are valid based on the existing state

func (Keeper) ValueOwnership

ValueOwnership returns a list of scope identifiers that list the given address as a value owner

type MetadataKeeperI

type MetadataKeeperI interface {
	// GetScope returns the scope with the given address.
	GetScope(sdk.Context, types.MetadataAddress) (types.Scope, bool)
	// SetScope persists the provided scope
	SetScope(sdk.Context, types.Scope)
	// RemoveScope persists the provided scope
	DeleteScope(sdk.Context, types.MetadataAddress)

	// IterateScopes processes all stored scopes with the given handler.
	IterateScopes(sdk.Context, func(types.Scope) bool) error

	// GetRecordGroup returns the scope with the given address.
	GetRecordGroup(sdk.Context, types.MetadataAddress) (types.RecordGroup, bool)
	// SetRecordGroup persists the provided scope
	SetRecordGroup(sdk.Context, types.RecordGroup)
	// RemoveRecordGroup persists the provided scope
	RemoveRecordGroup(sdk.Context, types.MetadataAddress)

	// GetRecord returns the record with the given address.
	GetRecord(sdk.Context, types.MetadataAddress) (types.Record, bool)
	// SetRecord persists the provided record
	SetRecord(sdk.Context, types.Record)
	// RemoveRecord persists the provided scope
	RemoveRecord(sdk.Context, types.MetadataAddress)

	// IterateRecords processes all stored record for a scope with the given handler.
	IterateRecords(sdk.Context, types.MetadataAddress, func(types.Record) bool) error

	// GetGroupSpecification returns the record with the given address.
	GetGroupSpecification(sdk.Context, types.MetadataAddress) (types.GroupSpecification, bool)
	// SetGroupSpecification persists the provided group specification
	SetGroupSpecification(sdk.Context, types.GroupSpecification)

	// GetScopeSpecification returns the record with the given address.
	GetScopeSpecification(sdk.Context, types.MetadataAddress) (types.ScopeSpecification, bool)
	// SetScopeSpecification persists the provided scope specification
	SetScopeSpecification(sdk.Context, types.ScopeSpecification)
}

MetadataKeeperI is the internal state api for the metadata module.

Jump to

Keyboard shortcuts

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