Documentation
¶
Index ¶
- func AvailableQueries() []iovns.QueryHandler
- func NewQuerier(k Keeper) sdk.Querier
- func NewTestCodec() *codec.Codec
- type ConfigurationKeeper
- type Keeper
- func (k Keeper) AddAccountCertificate(ctx sdk.Context, account types.Account, newCert []byte)
- func (k Keeper) CreateAccount(ctx sdk.Context, account types.Account)
- func (k Keeper) CreateDomain(ctx sdk.Context, domain types.Domain)
- func (k Keeper) DeleteAccount(ctx sdk.Context, domainName, accountName string)
- func (k Keeper) DeleteAccountCertificate(ctx sdk.Context, account types.Account, certificateIndex int)
- func (k Keeper) DeleteDomain(ctx sdk.Context, domainName string) (exists bool)
- func (k Keeper) FlushDomain(ctx sdk.Context, domainName string) (exists bool)
- func (k Keeper) GetAccount(ctx sdk.Context, domainName, accountName string) (account types.Account, exists bool)
- func (k Keeper) GetAccountsInDomain(ctx sdk.Context, domainName string, do func(key []byte) bool)
- func (k Keeper) GetDomain(ctx sdk.Context, domainName string) (domain types.Domain, ok bool)
- func (k Keeper) IterateAllDomains(ctx sdk.Context) sdk.Iterator
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) ReplaceAccountTargets(ctx sdk.Context, account types.Account, targets []iovns.BlockchainAddress)
- func (k Keeper) SetAccount(ctx sdk.Context, account types.Account)
- func (k Keeper) SetDomain(ctx sdk.Context, domain types.Domain)
- func (k Keeper) TransferAccount(ctx sdk.Context, account types.Account, newOwner sdk.AccAddress)
- func (k Keeper) TransferDomain(ctx sdk.Context, newOwner sdk.AccAddress, domain types.Domain)
- func (k Keeper) UpdateAccountValidity(ctx sdk.Context, account types.Account, accountRenew time.Duration)
- type ParamSubspace
- type QueryAccountsFromOwner
- type QueryAccountsFromOwnerResponse
- type QueryAccountsInDomain
- type QueryAccountsInDomainResponse
- type QueryDomainsFromOwner
- type QueryDomainsFromOwnerResponse
- type QueryHandlerFunc
- type QueryResolveAccount
- type QueryResolveAccountResponse
- type QueryResolveDomain
- type QueryResolveDomainResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AvailableQueries ¶
func AvailableQueries() []iovns.QueryHandler
AvailableQueries returns the list of available queries in the module
func NewQuerier ¶
func NewTestCodec ¶
NewTestCodec generates aliceAddr mock codec for keeper module
Types ¶
type ConfigurationKeeper ¶
type ConfigurationKeeper interface { // GetConfiguration returns the configuration GetConfiguration(ctx sdk.Context) configuration.Config // GetOwner returns the owner GetOwner(ctx sdk.Context) sdk.AccAddress // GetValidDomainRegexp returns the regular expression that aliceAddr domain name must match // in order to be valid GetValidDomainRegexp(ctx sdk.Context) string // GetDomainRenewDuration returns the default duration of aliceAddr domain renewal GetDomainRenewDuration(ctx sdk.Context) time.Duration // GetDomainGracePeriod returns the grace period duration GetDomainGracePeriod(ctx sdk.Context) time.Duration }
ConfigurationKeeper defines the behaviour of the configuration state checks
type Keeper ¶
type Keeper struct { // external keepers ConfigurationKeeper ConfigurationKeeper // contains filtered or unexported fields }
Keeper of the domain store TODO split this keeper in sub-struct in order to avoid possible mistakes with keys and not clutter the exposed methods
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, domainKey sdk.StoreKey, accountKey sdk.StoreKey, indexStoreKey sdk.StoreKey, configKeeper ConfigurationKeeper, paramspace ParamSubspace) Keeper
NewKeeper creates aliceAddr domain keeper
func NewTestKeeper ¶
NewTestKeeper generates aliceAddr keeper and aliceAddr context from it
func (Keeper) AddAccountCertificate ¶
AddAccountCertificate adds aliceAddr new certificate to the account
func (Keeper) CreateAccount ¶
CreateAccount creates an account
func (Keeper) CreateDomain ¶
CreateDomain creates the domain inside the KVStore with its name as key
func (Keeper) DeleteAccount ¶
DeleteAccount deletes an account based on it full account name -> domain + iovns.Separator + account
func (Keeper) DeleteAccountCertificate ¶
func (k Keeper) DeleteAccountCertificate(ctx sdk.Context, account types.Account, certificateIndex int)
DeleteAccountCertificate deletes aliceAddr certificate at given index, it will panic if the index is wrong
func (Keeper) DeleteDomain ¶
DeleteDomain deletes the domain and the accounts in it this operation can only fail in case the domain does not exist
func (Keeper) FlushDomain ¶
FlushDomain removes all accounts, except the empty one, from the domain. returns true in case the domain exists and the operation has been done. returns false only in case the domain does not exist.
func (Keeper) GetAccount ¶
func (k Keeper) GetAccount(ctx sdk.Context, domainName, accountName string) (account types.Account, exists bool)
GetAccount finds an account based on its key name, if not found it will return aliceAddr zeroed account and false.
func (Keeper) GetAccountsInDomain ¶
GetAccountsInDomain provides all the account keys related to the given domain name
func (Keeper) GetDomain ¶
GetDomain returns the domain based on its name, if domain is not found ok will be false
func (Keeper) IterateAllDomains ¶
IterateAllDomains will return an iterator for all the domain keys present in the KVStore, it's callers duty to close the iterator.
func (Keeper) ReplaceAccountTargets ¶
func (k Keeper) ReplaceAccountTargets(ctx sdk.Context, account types.Account, targets []iovns.BlockchainAddress)
ReplaceAccountTargets updates an account targets
func (Keeper) SetAccount ¶
SetAccount upserts account data
func (Keeper) TransferAccount ¶
TransferAccount transfers the account to aliceAddr new owner after resetting certificates and targets
func (Keeper) TransferDomain ¶
TransferDomain transfers aliceAddr domain
type ParamSubspace ¶
type ParamSubspace interface { }
type QueryAccountsFromOwner ¶
type QueryAccountsFromOwner struct { Owner sdk.AccAddress `json:"owner"` ResultsPerPage int `json:"results_per_page"` Offset int `json:"offset"` }
func (*QueryAccountsFromOwner) Description ¶
func (q *QueryAccountsFromOwner) Description() string
func (*QueryAccountsFromOwner) Handler ¶
func (q *QueryAccountsFromOwner) Handler() QueryHandlerFunc
func (*QueryAccountsFromOwner) QueryPath ¶
func (q *QueryAccountsFromOwner) QueryPath() string
func (*QueryAccountsFromOwner) Use ¶
func (q *QueryAccountsFromOwner) Use() string
func (*QueryAccountsFromOwner) Validate ¶
func (q *QueryAccountsFromOwner) Validate() error
type QueryAccountsInDomain ¶
type QueryAccountsInDomain struct { Domain string `json:"domain" arg:"positional"` ResultsPerPage int `json:"results_per_page" arg:"positional"` Offset int `json:"offset" arg:"positional"` }
func (*QueryAccountsInDomain) Description ¶
func (q *QueryAccountsInDomain) Description() string
func (*QueryAccountsInDomain) Handler ¶
func (q *QueryAccountsInDomain) Handler() QueryHandlerFunc
func (*QueryAccountsInDomain) QueryPath ¶
func (q *QueryAccountsInDomain) QueryPath() string
func (*QueryAccountsInDomain) Use ¶
func (q *QueryAccountsInDomain) Use() string
func (*QueryAccountsInDomain) Validate ¶
func (q *QueryAccountsInDomain) Validate() error
Validate will validate the query model and set defaults
type QueryDomainsFromOwner ¶
type QueryDomainsFromOwner struct { Owner sdk.AccAddress `json:"owner"` ResultsPerPage int `json:"results_per_page"` Offset int `json:"offset"` }
func (*QueryDomainsFromOwner) Description ¶
func (q *QueryDomainsFromOwner) Description() string
func (*QueryDomainsFromOwner) Handler ¶
func (q *QueryDomainsFromOwner) Handler() QueryHandlerFunc
func (*QueryDomainsFromOwner) QueryPath ¶
func (q *QueryDomainsFromOwner) QueryPath() string
func (*QueryDomainsFromOwner) Use ¶
func (q *QueryDomainsFromOwner) Use() string
func (*QueryDomainsFromOwner) Validate ¶
func (q *QueryDomainsFromOwner) Validate() error
type QueryHandlerFunc ¶
type QueryHandlerFunc func(ctx sdk.Context, path []string, query abci.RequestQuery, k Keeper) ([]byte, error)
QueryHandlerFunc defines the query handler for this module
type QueryResolveAccount ¶
func (*QueryResolveAccount) Description ¶
func (q *QueryResolveAccount) Description() string
func (*QueryResolveAccount) Handler ¶
func (q *QueryResolveAccount) Handler() QueryHandlerFunc
func (*QueryResolveAccount) QueryPath ¶
func (q *QueryResolveAccount) QueryPath() string
func (*QueryResolveAccount) Use ¶
func (q *QueryResolveAccount) Use() string
func (*QueryResolveAccount) Validate ¶
func (q *QueryResolveAccount) Validate() error
type QueryResolveDomain ¶
type QueryResolveDomain struct {
Name string `json:"name" arg:"positional"`
}
QueryResolveDomain is the request made to
func (*QueryResolveDomain) Description ¶
func (q *QueryResolveDomain) Description() string
func (*QueryResolveDomain) Handler ¶
func (q *QueryResolveDomain) Handler() QueryHandlerFunc
func (*QueryResolveDomain) QueryPath ¶
func (q *QueryResolveDomain) QueryPath() string
func (*QueryResolveDomain) Use ¶
func (q *QueryResolveDomain) Use() string
func (*QueryResolveDomain) Validate ¶
func (q *QueryResolveDomain) Validate() error