types

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName uses for schema name in key-value store
	ModuleName = "nameservice"

	// StoreKey sets schema name from ModuleName
	StoreKey = ModuleName
)
View Source
const RouterKey = ModuleName

RouterKey is not in sense yet

Variables

View Source
var ModuleCdc = codec.New()

ModuleCdc is used as a codec in types package

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

Types

type MsgAddrCheck

type MsgAddrCheck struct {
	ID      string         `json:"id"`
	Address sdk.AccAddress `json:"address"`
}

MsgAddrCheck defines a ChangeKey message

func NewMsgAddrCheck

func NewMsgAddrCheck(name string, address sdk.AccAddress) MsgAddrCheck

NewMsgAddrCheck is a constructor function for MsgAddrCheck

func (MsgAddrCheck) GetSignBytes

func (msg MsgAddrCheck) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgAddrCheck) GetSigners

func (msg MsgAddrCheck) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgAddrCheck) Route

func (msg MsgAddrCheck) Route() string

Route should return the name of the module

func (MsgAddrCheck) Type

func (msg MsgAddrCheck) Type() string

Type should return the action

func (MsgAddrCheck) ValidateBasic

func (msg MsgAddrCheck) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgChangeKey

type MsgChangeKey struct {
	ID         string         `json:"ID"`
	OldAddress sdk.AccAddress `json:"oldaddress"`
	NewAddress sdk.AccAddress `json:"newaddress"`
}

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) Type

func (msg MsgChangeKey) Type() string

Type should return the action

func (MsgChangeKey) ValidateBasic

func (msg MsgChangeKey) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgSetAccount

type MsgSetAccount struct {
	ID      string         `json:"id"`
	Address sdk.AccAddress `json:"address"`
}

MsgSetAccount defines a SetAccount message

func NewMsgSetAccount

func NewMsgSetAccount(name string, address sdk.AccAddress) MsgSetAccount

NewMsgSetAccount is a constructor function for MsgSetName

func (MsgSetAccount) GetSignBytes

func (msg MsgSetAccount) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgSetAccount) GetSigners

func (msg MsgSetAccount) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgSetAccount) Route

func (msg MsgSetAccount) Route() string

Route should return the name of the module

func (MsgSetAccount) Type

func (msg MsgSetAccount) Type() string

Type should return the action

func (MsgSetAccount) ValidateBasic

func (msg MsgSetAccount) 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 NewName

func NewName(stringName string) Name

NewName acts like a constuctor of "Name"

func (*Name) Init

func (N *Name) Init(stringName string) error

Init work as a initializer of Name

func (*Name) ToString

func (N *Name) ToString() (string, error)

ToString extracts string form from uint128 "Name" struct

type QueryResUnitAccount

type QueryResUnitAccount struct {
	ID      string         `json:"id"`
	Address sdk.AccAddress `json:"address"`
}

QueryResUnitAccount payload for a UnitAccount query

func (QueryResUnitAccount) String

func (r QueryResUnitAccount) String() string

implement fmt.Stringer

type UnitAccount

type UnitAccount struct {
	ID      Name           `json:"id"`
	Address sdk.AccAddress `json:"address"`
}

UnitAccount used to define Unit account structure

func NewUnitAccount

func NewUnitAccount() UnitAccount

NewUnitAccount returns a new UnitAccount

func (UnitAccount) String

func (w UnitAccount) String() string

implement fmt.Stringer

Jump to

Keyboard shortcuts

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