Documentation ¶
Index ¶
- Constants
- Variables
- func ErrBadQueryRequest(codespace sdk.CodespaceType) sdk.Error
- func ErrNoRegisteredReadableID(codespace sdk.CodespaceType, readableid string) sdk.Error
- func RegisterCodec(cdc *codec.Codec)
- type MsgChangeKey
- type MsgSetNickname
- type Name
- type QueryReqUnitAccount
- type QueryResUnitAccount
- type UnitAccount
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = ModuleName CodeBadQueryRequest sdk.CodeType = 400 CodeNoRegisteredReadableID sdk.CodeType = 404 )
const ( // ModuleName uses for schema name in key-value store ModuleName = "nickname" // StoreKey sets schema name from ModuleName StoreKey = ModuleName )
const RouterKey = ModuleName
RouterKey is not in sense yet
Variables ¶
var ModuleCdc = codec.New()
ModuleCdc is used as a codec in types package
Functions ¶
func ErrBadQueryRequest ¶
func ErrBadQueryRequest(codespace sdk.CodespaceType) sdk.Error
ErrBadQueryRequest - malform query request
func ErrNoRegisteredReadableID ¶
func ErrNoRegisteredReadableID(codespace sdk.CodespaceType, readableid string) sdk.Error
ErrNoRegisteredReadableID - no registered readable name
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
Types ¶
type MsgChangeKey ¶
type MsgChangeKey struct { Nickname string `json:"nickname"` OldAddress sdk.AccAddress `json:"old_address"` NewAddress sdk.AccAddress `json:"new_address"` }
MsgChangeKey defines a ChangeKey message
func NewMsgChangeKey ¶
func NewMsgChangeKey(name string, oldAddress, newAddress sdk.AccAddress, ) MsgChangeKey
NewMsgChangeKey is a constructor function for MsgChangeKey
func (MsgChangeKey) GetSignBytes ¶
func (msg MsgChangeKey) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgChangeKey) GetSigners ¶
func (msg MsgChangeKey) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgChangeKey) Route ¶
func (msg MsgChangeKey) Route() string
Route should return the name of the module
func (MsgChangeKey) ValidateBasic ¶
func (msg MsgChangeKey) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type MsgSetNickname ¶
type MsgSetNickname struct { Nickname Name `json:"nickname"` Address sdk.AccAddress `json:"address"` }
MsgSetAccount defines a SetAccount message
func NewMsgSetNickname ¶
func NewMsgSetNickname(name Name, address sdk.AccAddress) MsgSetNickname
NewMsgSetNickname is a constructor function for MsgSetName
func (MsgSetNickname) GetSignBytes ¶
func (msg MsgSetNickname) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgSetNickname) GetSigners ¶
func (msg MsgSetNickname) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgSetNickname) Route ¶
func (msg MsgSetNickname) Route() string
Route should return the name of the module
func (MsgSetNickname) ValidateBasic ¶
func (msg MsgSetNickname) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type Name ¶
type Name struct {
H, L uint64
}
Name is uint128 datatype, and supports redable ID which contains up to 20 letters. But, Golang has no uint128 in native, so it should be created manually. ID fills H uint64 first 10 letters, and fills L next 10 letters.
func (*Name) MustToString ¶
MustToString works as like ToString but no error return
type QueryReqUnitAccount ¶
type QueryReqUnitAccount struct {
Nickname string `json:"nickname"`
}
QueryReqUnitAccount payload for a UnitAccount query
type QueryResUnitAccount ¶
type QueryResUnitAccount struct { Nickname string `json:"nickname"` Address sdk.AccAddress `json:"address"` }
QueryResUnitAccount is response of a UnitAccount query
func (QueryResUnitAccount) String ¶
func (r QueryResUnitAccount) String() string
implement fmt.Stringer
type UnitAccount ¶
type UnitAccount struct { Nickname Name `json:"nick"` Address sdk.AccAddress `json:"address"` }
UnitAccount used to define Unit account structure
func NewUnitAccount ¶
func NewUnitAccount(name Name, address sdk.AccAddress) UnitAccount
NewUnitAccount returns a new UnitAccount