nickname

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = types.ModuleName
	RouterKey  = types.RouterKey
	StoreKey   = types.StoreKey
)
View Source
const (
	QueryGetAccount = "getaddress"
)

Query endpoints definition for GET request

Variables

View Source
var (
	NewMsgSetAccount = types.NewMsgSetNickname
	NewMsgChangeKey  = types.NewMsgChangeKey
	ModuleCdc        = types.ModuleCdc
	RegisterCodec    = types.RegisterCodec
	NewUnitAccount   = types.NewUnitAccount
	NewName          = types.NewName
)

Functions

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 (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) Name

func (AppModule) Name() string

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

func (AppModule) QuerierRoute

func (am AppModule) QuerierRoute() string

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)

func (AppModule) Route

func (am AppModule) Route() string

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

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

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