Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultCodeSpace btypes.CodespaceType = "guardian" CodeInvalidInput btypes.CodeType = 601 // invalid input CodeInvalidCreator btypes.CodeType = 602 // invalid creator CodeUnKnownGuardian btypes.CodeType = 603 // unknown guardian CodeGuardianAlreadyExists btypes.CodeType = 604 // guardian already exists )
Guardian errors reserve 600 ~ 699.
Variables ¶
View Source
var ( // 事件类型 EventTypeAddGuardian = "add-guardian" // 添加系统账户 EventTypeDeleteGuardian = "delete-guardian" // 删除系统账户 EventTypeHaltNetwork = "halt-network" // 停止网络 // 事件参数 AttributeKeyModule = "guardian" // 模块名称 AttributeKeyGuardian = "guardian" // 账户地址 AttributeKeyCreator = "creator" // 创建账户地址 AttributeKeyDeleteBy = "delete-by" // 删除账户地址 AttributeKeyReason = "reason" // 操作原因 )
Functions ¶
func ErrInvalidCreator ¶
func ErrInvalidInput ¶
func ErrUnKnownGuardian ¶
Types ¶
type GenesisState ¶
type GenesisState struct {
Guardians []Guardian `json:"guardians"`
}
创世状态
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
func NewGenesisState ¶
func NewGenesisState(guardians []Guardian) GenesisState
func (GenesisState) Equals ¶
func (gs GenesisState) Equals(gs1 GenesisState) bool
type Guardian ¶
type Guardian struct { Description string `json:"description"` // 描述 GuardianType GuardianType `json:"guardian_type"` // 账户类型:Genesis 创世配置 Ordinary 交易创建 Address btypes.AccAddress `json:"address"` // 账户地址 Creator btypes.AccAddress `json:"creator"` // 创建者账户地址 }
系统账户
func NewGuardian ¶
func NewGuardian(description string, guardianType GuardianType, address, creator btypes.AccAddress) *Guardian
type GuardianType ¶
type GuardianType byte
const ( Genesis GuardianType = 0x01 // 创世配置 Ordinary GuardianType = 0x02 // 交易创建 )
Click to show internal directories.
Click to hide internal directories.