Documentation
¶
Index ¶
- Constants
- Variables
- func ErrGuardianAlreadyExists(msg string) btypes.Error
- func ErrInvalidCreator(msg string) btypes.Error
- func ErrInvalidInput(msg string) btypes.Error
- func ErrUnKnownGuardian(msg string) btypes.Error
- func ValidateGenesis(gs GenesisState) error
- type GenesisState
- type Guardian
- type GuardianType
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 )
QCP errors reserve 700 ~ 799.
Variables ¶
View Source
var ( EventTypeAddGuardian = "add-guardian" EventTypeDeleteGuardian = "delete-guardian" EventTypeHaltNetwork = "halt-network" AttributeKeyModule = "guardian" AttributeKeyGuardian = "guardian" AttributeKeyCreator = "creator" AttributeKeyDeleteBy = "delete-by" AttributeKeyReason = "reaseon" )
Functions ¶
func ErrInvalidCreator ¶
func ErrInvalidInput ¶
func ErrUnKnownGuardian ¶
func ValidateGenesis ¶
func ValidateGenesis(gs GenesisState) error
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"`
Address btypes.Address `json:"address"`
Creator btypes.Address `json:"creator"`
}
func NewGuardian ¶
func NewGuardian(description string, guardianType GuardianType, address, creator btypes.Address) *Guardian
type GuardianType ¶
type GuardianType byte
const ( Genesis GuardianType = 0x01 Ordinary GuardianType = 0x02 )
Click to show internal directories.
Click to hide internal directories.