Documentation ¶
Index ¶
- Constants
- func ErrDeleteGenesisProfiler(codespace sdk.CodespaceType, profiler sdk.AccAddress) sdk.Error
- func ErrDeleteGenesisTrustee(codespace sdk.CodespaceType, trustee sdk.AccAddress) sdk.Error
- func ErrInvalidDescription(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidOperator(codespace sdk.CodespaceType, operator sdk.AccAddress) sdk.Error
- func ErrProfilerExists(codespace sdk.CodespaceType, profiler sdk.AccAddress) sdk.Error
- func ErrProfilerNotExists(codespace sdk.CodespaceType, profiler sdk.AccAddress) sdk.Error
- func ErrTrusteeExists(codespace sdk.CodespaceType, trustee sdk.AccAddress) sdk.Error
- func ErrTrusteeNotExists(codespace sdk.CodespaceType, trustee sdk.AccAddress) sdk.Error
- func GetProfilerKey(addr sdk.AccAddress) []byte
- func GetProfilersSubspaceKey() []byte
- func GetTrusteeKey(addr sdk.AccAddress) []byte
- func GetTrusteesSubspaceKey() []byte
- func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)
- func NewHandler(k Keeper) sdk.Handler
- func NewQuerier(k Keeper) sdk.Querier
- func RegisterCodec(cdc *codec.Codec)
- type AccountType
- type AddGuardian
- type DeleteGuardian
- type GenesisState
- type Guardian
- type Keeper
- func (k Keeper) AddProfiler(ctx sdk.Context, guardian Guardian) sdk.Error
- func (k Keeper) AddTrustee(ctx sdk.Context, guardian Guardian) sdk.Error
- func (k Keeper) DeleteProfiler(ctx sdk.Context, address sdk.AccAddress) sdk.Error
- func (k Keeper) DeleteTrustee(ctx sdk.Context, address sdk.AccAddress) sdk.Error
- func (k Keeper) GetProfiler(ctx sdk.Context, addr sdk.AccAddress) (guardian Guardian, found bool)
- func (k Keeper) GetTrustee(ctx sdk.Context, addr sdk.AccAddress) (guardian Guardian, found bool)
- func (k Keeper) ProfilersIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) TrusteesIterator(ctx sdk.Context) sdk.Iterator
- type MsgAddProfiler
- type MsgAddTrustee
- type MsgDeleteProfiler
- type MsgDeleteTrustee
- type Profilers
- type Trustees
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = "guardian" CodeInvalidOperator sdk.CodeType = 100 CodeProfilerExists sdk.CodeType = 101 CodeProfilerNotExists sdk.CodeType = 102 CodeTrusteeExists sdk.CodeType = 103 CodeTrusteeNotExists sdk.CodeType = 104 CodeInvalidDescription sdk.CodeType = 105 CodeDeleteGenesisProfiler sdk.CodeType = 106 CodeDeleteGenesisTrustee sdk.CodeType = 107 CodeInvalidGuardian sdk.CodeType = 108 )
const ( QueryProfilers = "profilers" QueryTrustees = "trustees" )
const MsgType = "guardian"
Variables ¶
This section is empty.
Functions ¶
func ErrDeleteGenesisProfiler ¶
func ErrDeleteGenesisProfiler(codespace sdk.CodespaceType, profiler sdk.AccAddress) sdk.Error
func ErrDeleteGenesisTrustee ¶
func ErrDeleteGenesisTrustee(codespace sdk.CodespaceType, trustee sdk.AccAddress) sdk.Error
func ErrInvalidDescription ¶
func ErrInvalidDescription(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidOperator ¶
func ErrInvalidOperator(codespace sdk.CodespaceType, operator sdk.AccAddress) sdk.Error
func ErrProfilerExists ¶
func ErrProfilerExists(codespace sdk.CodespaceType, profiler sdk.AccAddress) sdk.Error
func ErrProfilerNotExists ¶
func ErrProfilerNotExists(codespace sdk.CodespaceType, profiler sdk.AccAddress) sdk.Error
func ErrTrusteeExists ¶
func ErrTrusteeExists(codespace sdk.CodespaceType, trustee sdk.AccAddress) sdk.Error
func ErrTrusteeNotExists ¶
func ErrTrusteeNotExists(codespace sdk.CodespaceType, trustee sdk.AccAddress) sdk.Error
func GetProfilerKey ¶
func GetProfilerKey(addr sdk.AccAddress) []byte
func GetProfilersSubspaceKey ¶
func GetProfilersSubspaceKey() []byte
Key for getting all profilers from the store
func GetTrusteeKey ¶
func GetTrusteeKey(addr sdk.AccAddress) []byte
func GetTrusteesSubspaceKey ¶
func GetTrusteesSubspaceKey() []byte
Key for getting all profilers from the store
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)
func NewQuerier ¶
Types ¶
type AccountType ¶
type AccountType byte
const ( Genesis AccountType = 0x01 Ordinary AccountType = 0x02 )
func AccountTypeFromString ¶
func AccountTypeFromString(str string) (AccountType, error)
String to AccountType byte, Returns ff if invalid.
func (AccountType) Format ¶
func (bt AccountType) Format(s fmt.State, verb rune)
For Printf / Sprintf, returns bech32 when using %s
func (AccountType) MarshalJSON ¶
func (bt AccountType) MarshalJSON() ([]byte, error)
Marshals to JSON using string
func (*AccountType) UnmarshalJSON ¶
func (bt *AccountType) UnmarshalJSON(data []byte) error
Unmarshals from JSON assuming Bech32 encoding
type AddGuardian ¶
type AddGuardian struct { Description string `json:"description"` Address sdk.AccAddress `json:"address"` // address added AddedBy sdk.AccAddress `json:"added_by"` // address that initiated the tx }
func (AddGuardian) EnsureLength ¶
func (g AddGuardian) EnsureLength() sdk.Error
func (AddGuardian) ValidateBasic ¶
func (g AddGuardian) ValidateBasic() sdk.Error
type DeleteGuardian ¶
type DeleteGuardian struct { Address sdk.AccAddress `json:"address"` // address deleted DeletedBy sdk.AccAddress `json:"deleted_by"` // address that initiated the tx }
func (DeleteGuardian) ValidateBasic ¶
func (g DeleteGuardian) ValidateBasic() sdk.Error
type GenesisState ¶
type GenesisState struct { Profilers []Guardian `json:"profilers"` Trustees []Guardian `json:"trustees"` }
GenesisState - all guardian state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
get raw genesis raw message for testing
func DefaultGenesisStateForTest ¶
func DefaultGenesisStateForTest() GenesisState
get raw genesis raw message for testing
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState
func NewGenesisState ¶
func NewGenesisState(profilers, trustees []Guardian) GenesisState
type Guardian ¶
type Guardian struct { Description string `json:"description"` AccountType AccountType `json:"type"` Address sdk.AccAddress `json:"address"` // this guardian's address AddedBy sdk.AccAddress `json:"added_by"` // address that initiated the AddGuardian tx }
func NewGuardian ¶
func NewGuardian(description string, accountType AccountType, address, addedBy sdk.AccAddress) Guardian
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (Keeper) AddProfiler ¶
Add a profiler, only a existing profiler can add a new and the profiler is not existed
func (Keeper) AddTrustee ¶
Add a trustee
func (Keeper) DeleteProfiler ¶
func (Keeper) DeleteTrustee ¶
func (Keeper) GetProfiler ¶
func (Keeper) GetTrustee ¶
func (Keeper) ProfilersIterator ¶
Gets all profilers
type MsgAddProfiler ¶
type MsgAddProfiler struct {
AddGuardian
}
______________________________________________________________________ MsgAddProfiler - struct for add a profiler
func NewMsgAddProfiler ¶
func NewMsgAddProfiler(description string, address, addedBy sdk.AccAddress) MsgAddProfiler
func (MsgAddProfiler) GetSignBytes ¶
func (msg MsgAddProfiler) GetSignBytes() []byte
func (MsgAddProfiler) GetSigners ¶
func (msg MsgAddProfiler) GetSigners() []sdk.AccAddress
func (MsgAddProfiler) Route ¶
func (msg MsgAddProfiler) Route() string
func (MsgAddProfiler) Type ¶
func (msg MsgAddProfiler) Type() string
func (MsgAddProfiler) ValidateBasic ¶
func (msg MsgAddProfiler) ValidateBasic() sdk.Error
type MsgAddTrustee ¶
type MsgAddTrustee struct {
AddGuardian
}
______________________________________________________________________ MsgAddTrustee - struct for add a trustee
func NewMsgAddTrustee ¶
func NewMsgAddTrustee(description string, address, addedAddress sdk.AccAddress) MsgAddTrustee
func (MsgAddTrustee) GetSignBytes ¶
func (msg MsgAddTrustee) GetSignBytes() []byte
func (MsgAddTrustee) GetSigners ¶
func (msg MsgAddTrustee) GetSigners() []sdk.AccAddress
func (MsgAddTrustee) Route ¶
func (msg MsgAddTrustee) Route() string
func (MsgAddTrustee) Type ¶
func (msg MsgAddTrustee) Type() string
func (MsgAddTrustee) ValidateBasic ¶
func (msg MsgAddTrustee) ValidateBasic() sdk.Error
type MsgDeleteProfiler ¶
type MsgDeleteProfiler struct {
DeleteGuardian
}
______________________________________________________________________ MsgDeleteProfiler - struct for delete a profiler
func NewMsgDeleteProfiler ¶
func NewMsgDeleteProfiler(address, deletedBy sdk.AccAddress) MsgDeleteProfiler
func (MsgDeleteProfiler) GetSignBytes ¶
func (msg MsgDeleteProfiler) GetSignBytes() []byte
func (MsgDeleteProfiler) GetSigners ¶
func (msg MsgDeleteProfiler) GetSigners() []sdk.AccAddress
func (MsgDeleteProfiler) Route ¶
func (msg MsgDeleteProfiler) Route() string
func (MsgDeleteProfiler) Type ¶
func (msg MsgDeleteProfiler) Type() string
func (MsgDeleteProfiler) ValidateBasic ¶
func (msg MsgDeleteProfiler) ValidateBasic() sdk.Error
type MsgDeleteTrustee ¶
type MsgDeleteTrustee struct {
DeleteGuardian
}
______________________________________________________________________ MsgDeleteTrustee - struct for delete a trustee
func NewMsgDeleteTrustee ¶
func NewMsgDeleteTrustee(address, deletedBy sdk.AccAddress) MsgDeleteTrustee
func (MsgDeleteTrustee) GetSignBytes ¶
func (msg MsgDeleteTrustee) GetSignBytes() []byte
func (MsgDeleteTrustee) GetSigners ¶
func (msg MsgDeleteTrustee) GetSigners() []sdk.AccAddress
func (MsgDeleteTrustee) Route ¶
func (msg MsgDeleteTrustee) Route() string
func (MsgDeleteTrustee) Type ¶
func (msg MsgDeleteTrustee) Type() string
func (MsgDeleteTrustee) ValidateBasic ¶
func (msg MsgDeleteTrustee) ValidateBasic() sdk.Error