Documentation ¶
Index ¶
- func FindMissing(required []string, entries []string) []string
- func FindMissingMdAddr(required, entries []types.MetadataAddress) []types.MetadataAddress
- func IsBase64(s string) bool
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- func ParseContractSpecID(contractSpecID string) (types.MetadataAddress, error)
- func ParseRecordAddr(recordAddr string) (types.MetadataAddress, error)
- func ParseRecordSpecID(specID string, name string) (types.MetadataAddress, error)
- func ParseScopeID(scopeID string) (types.MetadataAddress, error)
- func ParseScopeSpecID(scopeSpecID string) (types.MetadataAddress, error)
- func ParseSessionAddr(sessionAddr string) (types.MetadataAddress, error)
- func ParseSessionID(scopeID string, sessionID string) (types.MetadataAddress, error)
- type Keeper
- func (k Keeper) ContractSpecification(c context.Context, req *types.ContractSpecificationRequest) (*types.ContractSpecificationResponse, error)
- func (k Keeper) ContractSpecificationsAll(c context.Context, req *types.ContractSpecificationsAllRequest) (*types.ContractSpecificationsAllResponse, error)
- func (k Keeper) CreateAccountForKey(ctx sdk.Context, addr sdk.AccAddress, pubKey cryptotypes.PubKey) error
- func (k Keeper) CreateRawSignature(txf clienttx.Factory, name string, txBuilder client.TxBuilder, message []byte, ...) error
- func (k Keeper) EmitEvent(ctx sdk.Context, event proto.Message)
- func (k Keeper) ExportGenesis(ctx sdk.Context) (data *types.GenesisState)
- func (k Keeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
- func (k Keeper) GetContractSpecification(ctx sdk.Context, contractSpecID types.MetadataAddress) (spec types.ContractSpecification, found bool)
- func (k Keeper) GetMaxURILength(ctx sdk.Context) (max uint32)
- func (k Keeper) GetMessageTypeURLs(msgTypeURL string) []string
- func (k Keeper) GetOSLocatorByScope(ctx sdk.Context, scopeID string) ([]types.ObjectStoreLocator, error)
- func (k Keeper) GetOSLocatorParams(ctx sdk.Context) (osLocatorParams types.OSLocatorParams)
- func (k Keeper) GetOsLocatorRecord(ctx sdk.Context, ownerAddr sdk.AccAddress) (osLocator types.ObjectStoreLocator, found bool)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetRecord(ctx sdk.Context, id types.MetadataAddress) (record types.Record, found bool)
- func (k Keeper) GetRecordSpecification(ctx sdk.Context, recordSpecID types.MetadataAddress) (spec types.RecordSpecification, found bool)
- func (k Keeper) GetRecordSpecificationsForContractSpecificationID(ctx sdk.Context, contractSpecID types.MetadataAddress) ([]*types.RecordSpecification, error)
- func (k Keeper) GetRecords(ctx sdk.Context, scopeAddress types.MetadataAddress, name string) ([]*types.Record, error)
- func (k Keeper) GetScope(ctx sdk.Context, id types.MetadataAddress) (scope types.Scope, found bool)
- func (k Keeper) GetScopeSpecification(ctx sdk.Context, scopeSpecID types.MetadataAddress) (spec types.ScopeSpecification, found bool)
- func (k Keeper) GetSession(ctx sdk.Context, id types.MetadataAddress) (session types.Session, found bool)
- func (k Keeper) ImportOSLocatorRecord(ctx sdk.Context, ownerAddr, encryptionKey sdk.AccAddress, uri string) error
- func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)
- func (k Keeper) IsMarkerAndHasAuthority(ctx sdk.Context, address string, signers []string, role markertypes.Access) (isMarker bool, hasAuth bool)
- func (k Keeper) IterateContractSpecs(ctx sdk.Context, ...) error
- func (k Keeper) IterateContractSpecsForOwner(ctx sdk.Context, ownerAddress sdk.AccAddress, ...) error
- func (k Keeper) IterateOSLocators(ctx sdk.Context, cb func(account types.ObjectStoreLocator) (stop bool)) error
- func (k Keeper) IterateRecordSpecs(ctx sdk.Context, ...) error
- func (k Keeper) IterateRecordSpecsForContractSpec(ctx sdk.Context, contractSpecID types.MetadataAddress, ...) error
- func (k Keeper) IterateRecordSpecsForOwner(ctx sdk.Context, ownerAddress sdk.AccAddress, ...) error
- func (k Keeper) IterateRecords(ctx sdk.Context, scopeID types.MetadataAddress, ...) error
- func (k Keeper) IterateScopeSpecs(ctx sdk.Context, ...) error
- func (k Keeper) IterateScopeSpecsForContractSpec(ctx sdk.Context, contractSpecID types.MetadataAddress, ...) error
- func (k Keeper) IterateScopeSpecsForOwner(ctx sdk.Context, ownerAddress sdk.AccAddress, ...) error
- func (k Keeper) IterateScopes(ctx sdk.Context, handler func(types.Scope) (stop bool)) error
- func (k Keeper) IterateScopesForAddress(ctx sdk.Context, address sdk.AccAddress, ...) error
- func (k Keeper) IterateScopesForScopeSpec(ctx sdk.Context, scopeSpecID types.MetadataAddress, ...) error
- func (k Keeper) IterateSessions(ctx sdk.Context, scopeID types.MetadataAddress, ...) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) ModifyOSLocator(ctx sdk.Context, ownerAddr, encryptionKey sdk.AccAddress, uri string) error
- func (k Keeper) OSAllLocators(ctx context.Context, request *types.OSAllLocatorsRequest) (*types.OSAllLocatorsResponse, error)
- func (k Keeper) OSLocator(c context.Context, request *types.OSLocatorRequest) (*types.OSLocatorResponse, error)
- func (k Keeper) OSLocatorExists(ctx sdk.Context, ownerAddr sdk.AccAddress) bool
- func (k Keeper) OSLocatorParams(c context.Context, request *types.OSLocatorParamsRequest) (*types.OSLocatorParamsResponse, error)
- func (k Keeper) OSLocatorsByScope(ctx context.Context, request *types.OSLocatorsByScopeRequest) (*types.OSLocatorsByScopeResponse, error)
- func (k Keeper) OSLocatorsByURI(ctx context.Context, request *types.OSLocatorsByURIRequest) (*types.OSLocatorsByURIResponse, error)
- func (k Keeper) Ownership(c context.Context, req *types.OwnershipRequest) (*types.OwnershipResponse, error)
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RecordSpecification(c context.Context, req *types.RecordSpecificationRequest) (*types.RecordSpecificationResponse, error)
- func (k Keeper) RecordSpecificationsAll(c context.Context, req *types.RecordSpecificationsAllRequest) (*types.RecordSpecificationsAllResponse, error)
- func (k Keeper) RecordSpecificationsForContractSpecification(c context.Context, ...) (*types.RecordSpecificationsForContractSpecificationResponse, error)
- func (k Keeper) Records(c context.Context, req *types.RecordsRequest) (*types.RecordsResponse, error)
- func (k Keeper) RecordsAll(c context.Context, req *types.RecordsAllRequest) (*types.RecordsAllResponse, error)
- func (k Keeper) RemoveContractSpecification(ctx sdk.Context, contractSpecID types.MetadataAddress) error
- func (k Keeper) RemoveOSLocator(ctx sdk.Context, ownerAddr sdk.AccAddress) error
- func (k Keeper) RemoveRecord(ctx sdk.Context, id types.MetadataAddress)
- func (k Keeper) RemoveRecordSpecification(ctx sdk.Context, recordSpecID types.MetadataAddress) error
- func (k Keeper) RemoveScope(ctx sdk.Context, id types.MetadataAddress)
- func (k Keeper) RemoveScopeSpecification(ctx sdk.Context, scopeSpecID types.MetadataAddress) error
- func (k Keeper) RemoveSession(ctx sdk.Context, id types.MetadataAddress)
- func (k Keeper) Scope(c context.Context, req *types.ScopeRequest) (*types.ScopeResponse, error)
- func (k Keeper) ScopeSpecification(c context.Context, req *types.ScopeSpecificationRequest) (*types.ScopeSpecificationResponse, error)
- func (k Keeper) ScopeSpecificationsAll(c context.Context, req *types.ScopeSpecificationsAllRequest) (*types.ScopeSpecificationsAllResponse, error)
- func (k Keeper) ScopesAll(c context.Context, req *types.ScopesAllRequest) (*types.ScopesAllResponse, error)
- func (k Keeper) Sessions(c context.Context, req *types.SessionsRequest) (*types.SessionsResponse, error)
- func (k Keeper) SessionsAll(c context.Context, req *types.SessionsAllRequest) (*types.SessionsAllResponse, error)
- func (k Keeper) SetContractSpecification(ctx sdk.Context, spec types.ContractSpecification)
- func (k Keeper) SetOSLocator(ctx sdk.Context, ownerAddr, encryptionKey sdk.AccAddress, uri string) error
- func (k Keeper) SetOSLocatorParams(ctx sdk.Context, params types.OSLocatorParams)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetRecord(ctx sdk.Context, record types.Record)
- func (k Keeper) SetRecordSpecification(ctx sdk.Context, spec types.RecordSpecification)
- func (k Keeper) SetScope(ctx sdk.Context, scope types.Scope)
- func (k Keeper) SetScopeSpecification(ctx sdk.Context, spec types.ScopeSpecification)
- func (k Keeper) SetSession(ctx sdk.Context, session types.Session)
- func (k Keeper) UnionDistinct(sets ...[]string) []string
- func (k Keeper) ValidateAllOwnersAreSignersWithAuthz(ctx sdk.Context, existingOwners []string, signers []string, msgTypeURL string) error
- func (k Keeper) ValidateAllPartiesAreSignersWithAuthz(ctx sdk.Context, parties []types.Party, signers []string, msgTypeURL string) error
- func (k Keeper) ValidateAuditUpdate(ctx sdk.Context, existing, proposed *types.AuditFields) error
- func (k Keeper) ValidateContractSpecUpdate(ctx sdk.Context, existing *types.ContractSpecification, ...) error
- func (k Keeper) ValidatePartiesInvolved(parties []types.Party, requiredParties []types.PartyType) error
- func (k Keeper) ValidateRawSignature(signature signing.SignatureDescriptor, message []byte) (addr sdk.AccAddress, err error)
- func (k Keeper) ValidateRecordRemove(ctx sdk.Context, existing types.Record, proposedID types.MetadataAddress, ...) error
- func (k Keeper) ValidateRecordSpecUpdate(ctx sdk.Context, existing *types.RecordSpecification, ...) error
- func (k Keeper) ValidateRecordUpdate(ctx sdk.Context, existing, proposed *types.Record, signers []string, ...) error
- func (k Keeper) ValidateScopeAddDataAccess(ctx sdk.Context, dataAccessAddrs []string, existing types.Scope, ...) error
- func (k Keeper) ValidateScopeDeleteDataAccess(ctx sdk.Context, dataAccessAddrs []string, existing types.Scope, ...) error
- func (k Keeper) ValidateScopeOwners(owners []types.Party, spec types.ScopeSpecification) error
- func (k Keeper) ValidateScopeRemove(ctx sdk.Context, scope types.Scope, signers []string, msgTypeURL string) error
- func (k Keeper) ValidateScopeSpecUpdate(ctx sdk.Context, existing *types.ScopeSpecification, ...) error
- func (k Keeper) ValidateScopeUpdate(ctx sdk.Context, existing, proposed types.Scope, signers []string, ...) error
- func (k Keeper) ValidateScopeUpdateOwners(ctx sdk.Context, existing, proposed types.Scope, signers []string, ...) error
- func (k Keeper) ValidateSessionUpdate(ctx sdk.Context, existing, proposed *types.Session, signers []string, ...) error
- func (k Keeper) ValueOwnership(c context.Context, req *types.ValueOwnershipRequest) (*types.ValueOwnershipResponse, error)
- func (k Keeper) VerifyCorrectOwner(ctx sdk.Context, ownerAddr sdk.AccAddress) bool
- type MetadataKeeperI
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindMissing ¶ added in v0.3.0
FindMissing returns all elements of the required list that are not found in the entries list It is exported only so that it can be unit tested.
func FindMissingMdAddr ¶ added in v1.8.0
func FindMissingMdAddr(required, entries []types.MetadataAddress) []types.MetadataAddress
FindMissingMdAddr returns all elements of the required list that are not found in the entries list It is exported only so that it can be unit tested.
func NewMsgServerImpl ¶
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
func ParseContractSpecID ¶ added in v1.0.0
func ParseContractSpecID(contractSpecID string) (types.MetadataAddress, error)
ParseContractSpecID parses the provided input into a contract spec MetadataAddress. The input can either be a uuid string, a contract spec address bech32 string, or a record spec address bech32 string.
func ParseRecordAddr ¶ added in v1.0.0
func ParseRecordAddr(recordAddr string) (types.MetadataAddress, error)
ParseRecordAddr parses the provided input into a record MetadataAddress. The input must be a record address bech32 string.
func ParseRecordSpecID ¶ added in v1.0.0
func ParseRecordSpecID(specID string, name string) (types.MetadataAddress, error)
ParseRecordSpecID parses the provided input into a record spec MetadataAddress. The recordSpecID can either be a uuid string, a record spec address bech32 string, or a contract spec address bech32 string. If it's a contract spec address or a uuid, then a name is required.
func ParseScopeID ¶ added in v1.0.0
func ParseScopeID(scopeID string) (types.MetadataAddress, error)
ParseScopeID parses the provided input into a scope MetadataAddress. The input can either be a uuid string or scope address bech32 string.
func ParseScopeSpecID ¶ added in v1.0.0
func ParseScopeSpecID(scopeSpecID string) (types.MetadataAddress, error)
ParseScopeSpecID parses the provided input into a scope spec MetadataAddress. The input can either be a uuid string or scope spec address bech32 string.
func ParseSessionAddr ¶ added in v1.0.0
func ParseSessionAddr(sessionAddr string) (types.MetadataAddress, error)
ParseSessionAddr parses the provided input into a session MetadataAddress. The input must be a session address bech32 string.
func ParseSessionID ¶ added in v1.0.0
func ParseSessionID(scopeID string, sessionID string) (types.MetadataAddress, error)
ParseSessionID parses the provided input into a session MetadataAddress. The scopeID field can be either a uuid or scope address bech32 string. The sessionID field can be either a uuid or session address bech32 string. If the sessionID field is a bech32 address, the scopeID field is ignored. Otherwise, the scope id field is parsed using ParseScopeID and converted to a session MetadataAddress using the uuid in the sessionID field.
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.BinaryCodec, key sdk.StoreKey, paramSpace paramtypes.Subspace, authKeeper authkeeper.AccountKeeper, authzKeeper authzKeeper.Keeper, ) Keeper
NewKeeper creates new instances of the metadata Keeper.
func (Keeper) ContractSpecification ¶ added in v0.1.5
func (k Keeper) ContractSpecification(c context.Context, req *types.ContractSpecificationRequest) (*types.ContractSpecificationResponse, error)
ContractSpecification returns a specific contract specification by id.
func (Keeper) ContractSpecificationsAll ¶ added in v1.0.0
func (k Keeper) ContractSpecificationsAll(c context.Context, req *types.ContractSpecificationsAllRequest) (*types.ContractSpecificationsAllResponse, error)
ContractSpecificationsAll returns all contract specifications (limited by pagination).
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) 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 ¶
GetAccount looks up an account by address
func (Keeper) GetContractSpecification ¶ added in v0.1.5
func (k Keeper) GetContractSpecification(ctx sdk.Context, contractSpecID types.MetadataAddress) (spec types.ContractSpecification, found bool)
GetContractSpecification returns the contract specification with the given id.
func (Keeper) GetMaxURILength ¶ added in v1.0.0
GetMaxURILength gets the configured parameter for max uri length on a locator record (or the default if unset)
func (Keeper) GetMessageTypeURLs ¶ added in v1.8.0
GetMessageTypeURLs return a hierarchical list of message type urls. For example passing in `/provenance.metadata.v1.MsgAddScopeDataAccessRequest` would return a list containing ("/provenance.metadata.v1.MsgAddScopeDataAccessRequest", "/provenance.metadata.v1.MsgWriteScopeRequest")
func (Keeper) GetOSLocatorByScope ¶ added in v1.0.0
func (k Keeper) GetOSLocatorByScope(ctx sdk.Context, scopeID string) ([]types.ObjectStoreLocator, error)
GetOSLocatorByScope gets all Object Store Locators associated with a scope.
func (Keeper) GetOSLocatorParams ¶ added in v0.3.0
func (k Keeper) GetOSLocatorParams(ctx sdk.Context) (osLocatorParams types.OSLocatorParams)
GetParams returns the total set of metadata parameters.
func (Keeper) GetOsLocatorRecord ¶ added in v0.3.0
func (k Keeper) GetOsLocatorRecord(ctx sdk.Context, ownerAddr sdk.AccAddress) (osLocator types.ObjectStoreLocator, found bool)
GetOsLocatorRecord Gets the object store locator entry from the kvstore for the given owner address.
func (Keeper) GetRecord ¶
func (k Keeper) GetRecord(ctx sdk.Context, id types.MetadataAddress) (record types.Record, found bool)
GetRecord returns the record with the given id.
func (Keeper) GetRecordSpecification ¶ added in v0.2.0
func (k Keeper) GetRecordSpecification(ctx sdk.Context, recordSpecID types.MetadataAddress) (spec types.RecordSpecification, found bool)
GetRecordSpecification returns the record specification with the given id.
func (Keeper) GetRecordSpecificationsForContractSpecificationID ¶ added in v0.2.0
func (k Keeper) GetRecordSpecificationsForContractSpecificationID(ctx sdk.Context, contractSpecID types.MetadataAddress) ([]*types.RecordSpecification, error)
GetRecordSpecificationsForContractSpecificationID returns all the record specifications associated with given contractSpecID
func (Keeper) GetRecords ¶ added in v0.1.5
func (k Keeper) GetRecords(ctx sdk.Context, scopeAddress types.MetadataAddress, name string) ([]*types.Record, error)
GetRecords returns records for a scope optionally limited to a name.
func (Keeper) GetScopeSpecification ¶
func (k Keeper) GetScopeSpecification(ctx sdk.Context, scopeSpecID types.MetadataAddress) (spec types.ScopeSpecification, found bool)
GetScopeSpecification returns the scope specification with the given id.
func (Keeper) GetSession ¶ added in v0.2.0
func (k Keeper) GetSession(ctx sdk.Context, id types.MetadataAddress) (session types.Session, found bool)
GetSession returns the session with the given id.
func (Keeper) ImportOSLocatorRecord ¶ added in v1.3.0
func (k Keeper) ImportOSLocatorRecord(ctx sdk.Context, ownerAddr, encryptionKey sdk.AccAddress, uri string) error
ImportOSLocatorRecord binds a name to an address in the kvstore. Different from SetOSLocator in that there is less validation here. The uri format is not checked, and the owner address account is not looked up. This also does not emit any events.
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) IsMarkerAndHasAuthority ¶ added in v1.8.0
func (k Keeper) IsMarkerAndHasAuthority(ctx sdk.Context, address string, signers []string, role markertypes.Access) (isMarker bool, hasAuth bool)
IsMarkerAndHasAuthority checks that the address is a marker addr and that one of the signers has the given role. First return boolean is whether or not address a marker address. Second return boolean is whether or not one of the signers has the given role on that marker. If the first return boolean is false, they'll both be false.
func (Keeper) IterateContractSpecs ¶ added in v0.1.5
func (k Keeper) IterateContractSpecs(ctx sdk.Context, handler func(specification types.ContractSpecification) (stop bool)) error
IterateContractSpecs processes all contract specs using a given handler.
func (Keeper) IterateContractSpecsForOwner ¶ added in v0.1.5
func (k Keeper) IterateContractSpecsForOwner(ctx sdk.Context, ownerAddress sdk.AccAddress, handler func(contractSpecID types.MetadataAddress) (stop bool)) error
IterateContractSpecsForOwner processes all contract specs owned by an address using a given handler.
func (Keeper) IterateOSLocators ¶ added in v1.3.0
func (k Keeper) IterateOSLocators(ctx sdk.Context, cb func(account types.ObjectStoreLocator) (stop bool)) error
IterateOSLocators runs a function for every ObjectStoreLocator entry in the kvstore.
func (Keeper) IterateRecordSpecs ¶ added in v0.2.0
func (k Keeper) IterateRecordSpecs(ctx sdk.Context, handler func(specification types.RecordSpecification) (stop bool)) error
IterateRecordSpecs processes all record specs using a given handler.
func (Keeper) IterateRecordSpecsForContractSpec ¶ added in v0.2.0
func (k Keeper) IterateRecordSpecsForContractSpec(ctx sdk.Context, contractSpecID types.MetadataAddress, handler func(recordSpecID types.MetadataAddress) (stop bool)) error
IterateRecordSpecsForContractSpec processes all record specs for a contract spec using a given handler.
func (Keeper) IterateRecordSpecsForOwner ¶ added in v0.2.0
func (k Keeper) IterateRecordSpecsForOwner(ctx sdk.Context, ownerAddress sdk.AccAddress, handler func(recordSpecID types.MetadataAddress) (stop bool)) error
IterateRecordSpecsForOwner processes all record specs owned by an address using a given handler.
func (Keeper) IterateRecords ¶
func (k Keeper) IterateRecords(ctx sdk.Context, scopeID types.MetadataAddress, handler func(types.Record) (stop bool)) error
IterateRecords processes stored records with the given handler. If the scopeID is an empty MetadataAddress, all records will be processed. Otherwise, just the records for the given scopeID will be processed.
func (Keeper) IterateScopeSpecs ¶ added in v0.1.5
func (k Keeper) IterateScopeSpecs(ctx sdk.Context, handler func(specification types.ScopeSpecification) (stop bool)) error
IterateScopeSpecs processes all scope specs using a given handler.
func (Keeper) IterateScopeSpecsForContractSpec ¶ added in v0.1.5
func (k Keeper) IterateScopeSpecsForContractSpec(ctx sdk.Context, contractSpecID types.MetadataAddress, handler func(scopeSpecID types.MetadataAddress) (stop bool)) error
IterateScopeSpecsForContractSpec processes all scope specs associated with a contract spec id using a given handler.
func (Keeper) IterateScopeSpecsForOwner ¶ added in v0.1.5
func (k Keeper) IterateScopeSpecsForOwner(ctx sdk.Context, ownerAddress sdk.AccAddress, handler func(scopeSpecID types.MetadataAddress) (stop bool)) error
IterateScopeSpecsForOwner processes all scope specs owned by an address using a given handler.
func (Keeper) IterateScopes ¶
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) IterateSessions ¶ added in v0.2.0
func (k Keeper) IterateSessions(ctx sdk.Context, scopeID types.MetadataAddress, handler func(types.Session) (stop bool)) error
IterateSessions processes stored sessions with the given handler. If the scopeID is an empty MetadataAddress, all sessions will be processed. Otherwise, just the sessions for the given scopeID will be processed.
func (Keeper) ModifyOSLocator ¶ added in v1.3.0
func (k Keeper) ModifyOSLocator(ctx sdk.Context, ownerAddr, encryptionKey sdk.AccAddress, uri string) error
ModifyOSLocator updates an existing os locator entry in the kvstore, returns an error if it doesn't exist.
func (Keeper) OSAllLocators ¶ added in v0.3.0
func (k Keeper) OSAllLocators(ctx context.Context, request *types.OSAllLocatorsRequest) (*types.OSAllLocatorsResponse, error)
func (Keeper) OSLocator ¶ added in v0.3.0
func (k Keeper) OSLocator(c context.Context, request *types.OSLocatorRequest) (*types.OSLocatorResponse, error)
func (Keeper) OSLocatorExists ¶ added in v0.3.0
OSLocatorExists checks if the provided bech32 owner address has a OSL entry in the kvstore.
func (Keeper) OSLocatorParams ¶ added in v0.3.0
func (k Keeper) OSLocatorParams(c context.Context, request *types.OSLocatorParamsRequest) (*types.OSLocatorParamsResponse, error)
func (Keeper) OSLocatorsByScope ¶ added in v1.0.0
func (k Keeper) OSLocatorsByScope(ctx context.Context, request *types.OSLocatorsByScopeRequest) (*types.OSLocatorsByScopeResponse, error)
func (Keeper) OSLocatorsByURI ¶ added in v1.0.0
func (k Keeper) OSLocatorsByURI(ctx context.Context, request *types.OSLocatorsByURIRequest) (*types.OSLocatorsByURIResponse, error)
func (Keeper) Ownership ¶
func (k Keeper) Ownership(c context.Context, req *types.OwnershipRequest) (*types.OwnershipResponse, error)
Ownership returns a list of scope identifiers that list the given address as a data or value owner.
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries params of metadata module.
func (Keeper) RecordSpecification ¶ added in v0.2.0
func (k Keeper) RecordSpecification(c context.Context, req *types.RecordSpecificationRequest) (*types.RecordSpecificationResponse, error)
RecordSpecification returns a specific record specification.
func (Keeper) RecordSpecificationsAll ¶ added in v1.0.0
func (k Keeper) RecordSpecificationsAll(c context.Context, req *types.RecordSpecificationsAllRequest) (*types.RecordSpecificationsAllResponse, error)
RecordSpecificationsAll returns all record specifications (limited by pagination).
func (Keeper) RecordSpecificationsForContractSpecification ¶ added in v0.2.0
func (k Keeper) RecordSpecificationsForContractSpecification( c context.Context, req *types.RecordSpecificationsForContractSpecificationRequest, ) (*types.RecordSpecificationsForContractSpecificationResponse, error)
RecordSpecificationsForContractSpecification returns the record specifications associated with a contract specification.
func (Keeper) Records ¶ added in v1.0.0
func (k Keeper) Records(c context.Context, req *types.RecordsRequest) (*types.RecordsResponse, error)
Records returns records based on the provided request.
func (Keeper) RecordsAll ¶ added in v1.0.0
func (k Keeper) RecordsAll(c context.Context, req *types.RecordsAllRequest) (*types.RecordsAllResponse, error)
RecordsAll returns all records (limited by pagination).
func (Keeper) RemoveContractSpecification ¶ added in v0.1.5
func (k Keeper) RemoveContractSpecification(ctx sdk.Context, contractSpecID types.MetadataAddress) error
RemoveContractSpecification removes a contract specification from the module kv store.
func (Keeper) RemoveOSLocator ¶ added in v1.3.0
RemoveOSLocator removes an os locator record from the kvstore.
func (Keeper) RemoveRecord ¶
func (k Keeper) RemoveRecord(ctx sdk.Context, id types.MetadataAddress)
RemoveRecord removes a record from the module kv store.
func (Keeper) RemoveRecordSpecification ¶ added in v0.2.0
func (k Keeper) RemoveRecordSpecification(ctx sdk.Context, recordSpecID types.MetadataAddress) error
RemoveRecordSpecification removes a record specification from the module kv store.
func (Keeper) RemoveScope ¶ added in v0.1.5
func (k Keeper) RemoveScope(ctx sdk.Context, id types.MetadataAddress)
RemoveScope removes a scope from the module kv store along with all its records and sessions.
func (Keeper) RemoveScopeSpecification ¶ added in v0.1.5
RemoveScopeSpecification removes a scope specification from the module kv store.
func (Keeper) RemoveSession ¶ added in v0.2.0
func (k Keeper) RemoveSession(ctx sdk.Context, id types.MetadataAddress)
RemoveSession removes a session from the module kv store if there are no records associated with it.
func (Keeper) Scope ¶
func (k Keeper) Scope(c context.Context, req *types.ScopeRequest) (*types.ScopeResponse, error)
Scope returns a specific scope by id.
func (Keeper) ScopeSpecification ¶ added in v0.1.5
func (k Keeper) ScopeSpecification(c context.Context, req *types.ScopeSpecificationRequest) (*types.ScopeSpecificationResponse, error)
ScopeSpecification returns a specific scope specification by id.
func (Keeper) ScopeSpecificationsAll ¶ added in v1.0.0
func (k Keeper) ScopeSpecificationsAll(c context.Context, req *types.ScopeSpecificationsAllRequest) (*types.ScopeSpecificationsAllResponse, error)
ScopeSpecificationsAll returns all scope specifications (limited by pagination).
func (Keeper) ScopesAll ¶ added in v1.0.0
func (k Keeper) ScopesAll(c context.Context, req *types.ScopesAllRequest) (*types.ScopesAllResponse, error)
ScopesAll returns all scopes (limited by pagination).
func (Keeper) Sessions ¶ added in v1.0.0
func (k Keeper) Sessions(c context.Context, req *types.SessionsRequest) (*types.SessionsResponse, error)
Sessions returns sessions based on the provided request.
func (Keeper) SessionsAll ¶ added in v1.0.0
func (k Keeper) SessionsAll(c context.Context, req *types.SessionsAllRequest) (*types.SessionsAllResponse, error)
SessionsAll returns all sessions (limited by pagination).
func (Keeper) SetContractSpecification ¶ added in v0.1.5
func (k Keeper) SetContractSpecification(ctx sdk.Context, spec types.ContractSpecification)
SetContractSpecification stores a contract specification in the module kv store.
func (Keeper) SetOSLocator ¶ added in v1.3.0
func (k Keeper) SetOSLocator(ctx sdk.Context, ownerAddr, encryptionKey sdk.AccAddress, uri string) error
SetOSLocator binds an OS Locator to an address in the kvstore. An error is returned if no account exists for the address. An error is returned if an OS Locator already exists for the address.
func (Keeper) SetOSLocatorParams ¶ added in v0.3.0
func (k Keeper) SetOSLocatorParams(ctx sdk.Context, params types.OSLocatorParams)
SetParams sets the distribution parameters to the param space.
func (Keeper) SetRecordSpecification ¶ added in v0.2.0
func (k Keeper) SetRecordSpecification(ctx sdk.Context, spec types.RecordSpecification)
SetRecordSpecification stores a record specification in the module kv store.
func (Keeper) SetScopeSpecification ¶
func (k Keeper) SetScopeSpecification(ctx sdk.Context, spec types.ScopeSpecification)
SetScopeSpecification stores a scope specification in the module kv store.
func (Keeper) SetSession ¶ added in v0.2.0
SetSession stores a session in the module kv store.
func (Keeper) UnionDistinct ¶ added in v1.4.0
unionUnique gets a union of the provided sets of strings without any duplicates.
func (Keeper) ValidateAllOwnersAreSignersWithAuthz ¶ added in v1.8.0
func (k Keeper) ValidateAllOwnersAreSignersWithAuthz( ctx sdk.Context, existingOwners []string, signers []string, msgTypeURL string, ) error
ValidateAllOwnersAreSignersWithAuthz makes sure that all entries in the existingOwners list are contained in the signers list and checks to see if any missing entries have an assigned grantee
func (Keeper) ValidateAllPartiesAreSignersWithAuthz ¶ added in v1.8.0
func (k Keeper) ValidateAllPartiesAreSignersWithAuthz(ctx sdk.Context, parties []types.Party, signers []string, msgTypeURL string) error
ValidateAllPartiesAreSignersWithAuthz validate all parties are signers with authz module
func (Keeper) ValidateAuditUpdate ¶ added in v0.2.1
ValidateAuditUpdate ensure that a given reference to audit fields represents no changes to existing audit field data. NOTE: A nil proposed is considered "no update" and not an attempt to unset.
func (Keeper) ValidateContractSpecUpdate ¶ added in v0.1.5
func (k Keeper) ValidateContractSpecUpdate(ctx sdk.Context, existing *types.ContractSpecification, proposed types.ContractSpecification) error
ValidateContractSpecUpdate full validation of a proposed contract spec possibly against an existing one.
func (Keeper) ValidatePartiesInvolved ¶ added in v0.2.0
func (k Keeper) ValidatePartiesInvolved(parties []types.Party, requiredParties []types.PartyType) error
ValidatePartiesInvolved validate that all required parties are involved
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) ValidateRecordRemove ¶ added in v0.2.0
func (k Keeper) ValidateRecordRemove( ctx sdk.Context, existing types.Record, proposedID types.MetadataAddress, signers []string, msgTypeURL string, ) error
ValidateRecordRemove checks the current record and the proposed removal scope to determine if the the proposed remove is valid based on the existing state
func (Keeper) ValidateRecordSpecUpdate ¶ added in v0.2.0
func (k Keeper) ValidateRecordSpecUpdate(ctx sdk.Context, existing *types.RecordSpecification, proposed types.RecordSpecification) error
ValidateRecordSpecUpdate full validation of a proposed record spec possibly against an existing one.
func (Keeper) ValidateRecordUpdate ¶ added in v0.1.5
func (k Keeper) ValidateRecordUpdate( ctx sdk.Context, existing, proposed *types.Record, signers []string, partiesInvolved []types.Party, msgTypeURL string, ) error
ValidateRecordUpdate checks the current record and the proposed record to determine if the the proposed changes are valid based on the existing state Note: The proposed parameter is a reference here so that the SpecificationId can be set in cases when it's not provided.
func (Keeper) ValidateScopeAddDataAccess ¶ added in v1.3.0
func (k Keeper) ValidateScopeAddDataAccess( ctx sdk.Context, dataAccessAddrs []string, existing types.Scope, signers []string, msgTypeURL string, ) error
ValidateScopeAddDataAccess checks the current scope and the proposed
func (Keeper) ValidateScopeDeleteDataAccess ¶ added in v1.3.0
func (k Keeper) ValidateScopeDeleteDataAccess( ctx sdk.Context, dataAccessAddrs []string, existing types.Scope, signers []string, msgTypeURL string, ) error
ValidateScopeDeleteDataAccess checks the current scope data access and the proposed removed items
func (Keeper) ValidateScopeOwners ¶ added in v1.3.0
ValidateScopeOwners is stateful validation for scope owners against a scope specification. This does NOT involve the Scope.ValidateOwnersBasic() function.
func (Keeper) ValidateScopeRemove ¶
func (k Keeper) ValidateScopeRemove(ctx sdk.Context, scope types.Scope, signers []string, msgTypeURL 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) ValidateScopeSpecUpdate ¶ added in v0.1.5
func (k Keeper) ValidateScopeSpecUpdate(ctx sdk.Context, existing *types.ScopeSpecification, proposed types.ScopeSpecification) error
ValidateScopeSpecUpdate - full validation of a scope specification.
func (Keeper) ValidateScopeUpdate ¶
func (k Keeper) ValidateScopeUpdate( ctx sdk.Context, existing, proposed types.Scope, signers []string, msgTypeURL 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) ValidateScopeUpdateOwners ¶ added in v1.3.0
func (k Keeper) ValidateScopeUpdateOwners( ctx sdk.Context, existing, proposed types.Scope, signers []string, msgTypeURL string, ) error
ValidateScopeUpdateOwners checks the current scopes owners and the proposed update
func (Keeper) ValidateSessionUpdate ¶ added in v0.2.0
func (k Keeper) ValidateSessionUpdate(ctx sdk.Context, existing, proposed *types.Session, signers []string, msgTypeURL string) error
ValidateSessionUpdate checks the current session and the proposed session to determine if the the proposed changes are valid based on the existing state
func (Keeper) ValueOwnership ¶
func (k Keeper) ValueOwnership(c context.Context, req *types.ValueOwnershipRequest) (*types.ValueOwnershipResponse, error)
ValueOwnership returns a list of scope identifiers that list the given address as a value owner.
func (Keeper) VerifyCorrectOwner ¶ added in v0.3.0
VerifyCorrectOwner to determines whether the signer resolves to the owner of the OSLocator record.
type MetadataKeeperI ¶
type MetadataKeeperI interface { // GetScope returns the scope with the given id. GetScope(sdk.Context, types.MetadataAddress) (types.Scope, bool) // SetScope stores a scope in the module kv store. SetScope(sdk.Context, types.Scope) // RemoveScope removes a scope from the module kv store along with all its records and sessions. RemoveScope(sdk.Context, types.MetadataAddress) // IterateScopes processes all stored scopes with the given handler. IterateScopes(sdk.Context, func(types.Scope) bool) error // IterateScopesForAddress processes scopes associated with the provided address with the given handler. IterateScopesForAddress(sdk.Context, sdk.AccAddress, func(types.MetadataAddress) bool) error // IterateScopesForScopeSpec processes scopes associated with the provided scope specification id with the given handler. IterateScopesForScopeSpec(sdk.Context, types.MetadataAddress, func(types.MetadataAddress) bool) error // GetSession returns the session with the given id. GetSession(sdk.Context, types.MetadataAddress) (types.Session, bool) // SetSession stores a session in the module kv store. SetSession(sdk.Context, types.Session) // RemoveSession removes a session from the module kv store if there are no records associated with it. RemoveSession(sdk.Context, types.MetadataAddress) // IterateSessions processes stored sessions with the given handler. IterateSessions(sdk.Context, types.MetadataAddress, func(types.Session) bool) error // GetRecord returns the record with the given id. GetRecord(sdk.Context, types.MetadataAddress) (types.Record, bool) // GetRecords returns records for a scope optionally limited to a name. GetRecords(sdk.Context, types.MetadataAddress, string) ([]*types.Record, error) // SetRecord stores a record in the module kv store. SetRecord(sdk.Context, types.Record) // RemoveRecord removes a record from the module kv store. RemoveRecord(sdk.Context, types.MetadataAddress) // IterateRecords processes stored records with the given handler. IterateRecords(sdk.Context, types.MetadataAddress, func(types.Record) bool) error // GetScopeSpecification returns the scope specification with the given id. GetScopeSpecification(sdk.Context, types.MetadataAddress) (types.ScopeSpecification, bool) // SetScopeSpecification stores a scope specification in the module kv store. SetScopeSpecification(sdk.Context, types.ScopeSpecification) // RemoveScopeSpecification removes a scope specification from the module kv store. RemoveScopeSpecification(sdk.Context, types.MetadataAddress) error // IterateScopeSpecs processes all scope specs using a given handler. IterateScopeSpecs(ctx sdk.Context, handler func(specification types.ScopeSpecification) (stop bool)) error // IterateScopeSpecsForOwner processes all scope specs owned by an address using a given handler. IterateScopeSpecsForOwner(ctx sdk.Context, ownerAddress sdk.AccAddress, handler func(scopeSpecID types.MetadataAddress) (stop bool)) error // IterateScopeSpecsForContractSpec processes all scope specs associated with a contract spec id using a given handler. IterateScopeSpecsForContractSpec(ctx sdk.Context, contractSpecID types.MetadataAddress, handler func(scopeSpecID types.MetadataAddress) (stop bool)) error // GetContractSpecification returns the contract specification with the given id. GetContractSpecification(sdk.Context, types.MetadataAddress) (types.ContractSpecification, bool) // SetContractSpecification stores a contract specification in the module kv store. SetContractSpecification(sdk.Context, types.ContractSpecification) // RemoveContractSpecification removes a contract specification from the module kv store. RemoveContractSpecification(sdk.Context, types.MetadataAddress) error // IterateContractSpecs processes all contract specs using a given handler. IterateContractSpecs(ctx sdk.Context, handler func(specification types.ContractSpecification) (stop bool)) error // IterateContractSpecsForOwner processes all contract specs owned by an address using a given handler. IterateContractSpecsForOwner(ctx sdk.Context, ownerAddress sdk.AccAddress, handler func(contractSpecID types.MetadataAddress) (stop bool)) error // GetRecordSpecification returns the record specification with the given id. GetRecordSpecification(sdk.Context, types.MetadataAddress) (types.RecordSpecification, bool) // SetRecordSpecification stores a record specification in the module kv store. SetRecordSpecification(sdk.Context, types.RecordSpecification) // RemoveRecordSpecification removes a record specification from the module kv store. RemoveRecordSpecification(sdk.Context, types.MetadataAddress) error // IterateRecordSpecs processes all record specs using a given handler. IterateRecordSpecs(ctx sdk.Context, handler func(specification types.RecordSpecification) (stop bool)) error // IterateRecordSpecsForOwner processes all record specs owned by an address using a given handler. IterateRecordSpecsForOwner(ctx sdk.Context, ownerAddress sdk.AccAddress, handler func(recordSpecID types.MetadataAddress) (stop bool)) error // IterateRecordSpecsForContractSpec processes all record specs for a contract spec using a given handler. IterateRecordSpecsForContractSpec(ctx sdk.Context, contractSpecID types.MetadataAddress, handler func(recordSpecID types.MetadataAddress) (stop bool)) error // GetRecordSpecificationsForContractSpecificationID returns all the record specifications associated with given contractSpecID GetRecordSpecificationsForContractSpecificationID(ctx sdk.Context, contractSpecID types.MetadataAddress) ([]*types.RecordSpecification, error) // GetOsLocatorRecord returns the OS locator records for a given name record. GetOsLocatorRecord(ctx sdk.Context, ownerAddr sdk.AccAddress) (types.ObjectStoreLocator, bool) // return if OSLocator exists for a given owner addr OSLocatorExists(ctx sdk.Context, ownerAddr sdk.AccAddress) bool // add OSLocator instance SetOSLocator(ctx sdk.Context, ownerAddr, encryptionKey sdk.AccAddress, uri string) error // get OS locator by scope UUID. GetOSLocatorByScope(ctx sdk.Context, scopeID string) ([]types.ObjectStoreLocator, error) }
MetadataKeeperI is the internal state api for the metadata module.
type Migrator ¶ added in v1.7.0
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func NewMigrator ¶ added in v1.7.0
NewMigrator returns a new Migrator.
func (*Migrator) Migrate1to2 ¶ added in v1.7.0
Migrate1to2 migrates from version 1 to 2 to convert attribute keys from 20 to 32 length