Documentation ¶
Index ¶
- Constants
- Variables
- func InitGenesis(ctx sdk.Context, k NicknameKeeper, data GenesisStateStorage) []abci.ValidatorUpdate
- func NewHandler(k NicknameKeeper) sdk.Handler
- func NewQuerier(k NicknameKeeper) sdk.Querier
- func ValidateGenesis(data GenesisStateStorage) error
- type AppModule
- func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
- func (am AppModule) EndBlock(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (am AppModule) QuerierRoute() string
- func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
- func (am AppModule) Route() string
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type GenesisStateLoad
- type GenesisStateStorage
- type MsgChangeKey
- type MsgSetAccount
- type NicknameKeeper
- func (k *NicknameKeeper) AddrCheck(ctx sdk.Context, name string, address sdk.AccAddress) bool
- func (k *NicknameKeeper) ChangeKey(ctx sdk.Context, name string, oldAddr, newAddr sdk.AccAddress) bool
- func (k *NicknameKeeper) GetAccountIterator(ctx sdk.Context) sdk.Iterator
- func (k *NicknameKeeper) GetUnitAccount(ctx sdk.Context, name string) UnitAccount
- func (k NicknameKeeper) SetAccountIfNotExists(ctx sdk.Context, addr sdk.AccAddress)
- func (k *NicknameKeeper) SetNickname(ctx sdk.Context, name string, address sdk.AccAddress) bool
- type QueryReqUnitAccount
- type QueryResUnitAccount
- type UnitAccount
Constants ¶
const ( ModuleName = types.ModuleName RouterKey = types.RouterKey StoreKey = types.StoreKey )
const (
QueryGetAccount = "getaddress"
)
Query endpoints definition for GET request
Variables ¶
var ( NewMsgSetAccount = types.NewMsgSetNickname NewMsgChangeKey = types.NewMsgChangeKey ModuleCdc = types.ModuleCdc RegisterCodec = types.RegisterCodec NewUnitAccount = types.NewUnitAccount NewName = types.NewName )
Functions ¶
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k NicknameKeeper, data GenesisStateStorage) []abci.ValidatorUpdate
func NewHandler ¶
func NewHandler(k NicknameKeeper) sdk.Handler
NewHandler returns a handler for "nameservice" type messages.
func NewQuerier ¶
func NewQuerier(k NicknameKeeper) sdk.Querier
NewQuerier is the module level router for state queries
func ValidateGenesis ¶
func ValidateGenesis(data GenesisStateStorage) error
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
func NewAppModule ¶
func NewAppModule(k NicknameKeeper) AppModule
NewAppModule creates a new AppModule Object
func (AppModule) BeginBlock ¶
func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
func (AppModule) NewHandler ¶
func (AppModule) NewQuerierHandler ¶
func (AppModule) QuerierRoute ¶
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
type AppModuleBasic ¶
type AppModuleBasic struct{}
app module Basics object
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
Get the root query command of this module
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
Get the root tx command of this module
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
Register rest routes
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
Validation check of the Genesis
type GenesisStateLoad ¶
type GenesisStateLoad struct {
UnitAccountArr []UnitAccount `json:"accountarr"`
}
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisStateLoad
func NewGenesisState ¶
func NewGenesisState(accountRec []UnitAccount) GenesisStateLoad
type GenesisStateStorage ¶
type GenesisStateStorage struct {
UnitAccountArr []MsgSetAccount `json:"accountarr"`
}
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, k NicknameKeeper) GenesisStateStorage
type MsgChangeKey ¶
type MsgChangeKey = types.MsgChangeKey
type MsgSetAccount ¶
type MsgSetAccount = types.MsgSetNickname
type NicknameKeeper ¶
type NicknameKeeper struct { AccountKeeper auth.AccountKeeper // contains filtered or unexported fields }
NicknameKeeper is a store of all the account we've seen, and amino codec Will further check more why store struct should contain codec
func NewNicknameKeeper ¶
func NewNicknameKeeper(storeKey sdk.StoreKey, cdc *codec.Codec, k auth.AccountKeeper) NicknameKeeper
NewNicknameKeeper returns AccountStore DB object
func (*NicknameKeeper) AddrCheck ¶
func (k *NicknameKeeper) AddrCheck(ctx sdk.Context, name string, address sdk.AccAddress) bool
AddrCheck checks account by given address
func (*NicknameKeeper) ChangeKey ¶
func (k *NicknameKeeper) ChangeKey(ctx sdk.Context, name string, oldAddr, newAddr sdk.AccAddress) bool
ChangeKey updates public key of the account and apply to the database
func (*NicknameKeeper) GetAccountIterator ¶
func (k *NicknameKeeper) GetAccountIterator(ctx sdk.Context) sdk.Iterator
GetAccountIterator get iterator for listting all accounts.
func (*NicknameKeeper) GetUnitAccount ¶
func (k *NicknameKeeper) GetUnitAccount(ctx sdk.Context, name string) UnitAccount
GetUnitAccount fetches the AccountInfo with the given unit account data If not found, acc.UnitAccount is nil.
func (NicknameKeeper) SetAccountIfNotExists ¶
func (k NicknameKeeper) SetAccountIfNotExists(ctx sdk.Context, addr sdk.AccAddress)
SetAccountIfNotExists runs if network has no given account
func (*NicknameKeeper) SetNickname ¶
func (k *NicknameKeeper) SetNickname(ctx sdk.Context, name string, address sdk.AccAddress) bool
SetNickname adds the given unit account to the database. It returns false if the account is already stored.
type QueryReqUnitAccount ¶
type QueryReqUnitAccount = types.QueryReqUnitAccount
type QueryResUnitAccount ¶
type QueryResUnitAccount = types.QueryResUnitAccount
type UnitAccount ¶
type UnitAccount = types.UnitAccount