guardian

package
v0.9.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultCodespace sdk.CodespaceType = "guardian"

	CodeProfilerExists      sdk.CodeType = 100
	CodeProfilerNotExists   sdk.CodeType = 101
	CodeInvalidProfilerName sdk.CodeType = 102
)
View Source
const MsgType = "guardian"

Variables

This section is empty.

Functions

func ErrInvalidProfilerName

func ErrInvalidProfilerName(codespace sdk.CodespaceType, msg string) 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 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 NewHandler

func NewHandler(k Keeper) sdk.Handler

handle all "guardian" type messages.

func ProfilerEqual

func ProfilerEqual(profilerA, profilerB Profiler) bool

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Register concrete types on codec codec

func TrusteeEqual

func TrusteeEqual(trusteeA, trusteeB Trustee) bool

Types

type GenesisState

type GenesisState struct {
	Profilers []Profiler `json:"profilers"`
	Trustees  []Trustee  `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 []Profiler, trustees []Trustee) GenesisState

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, codespace sdk.CodespaceType) Keeper

func (Keeper) AddProfiler

func (k Keeper) AddProfiler(ctx sdk.Context, profiler Profiler) sdk.Error

Add a profiler, only a existing profiler can add a new and the profiler is not existed

func (Keeper) AddTrustee

func (k Keeper) AddTrustee(ctx sdk.Context, trustee Trustee) sdk.Error

Add a trustee

func (Keeper) GetProfiler

func (k Keeper) GetProfiler(ctx sdk.Context, addr sdk.AccAddress) (profiler Profiler, found bool)

func (Keeper) GetProfilers

func (k Keeper) GetProfilers(ctx sdk.Context) sdk.Iterator

Gets all profilers

func (Keeper) GetTrustee

func (k Keeper) GetTrustee(ctx sdk.Context, addr sdk.AccAddress) (trustee Trustee, found bool)

func (Keeper) GetTrustees

func (k Keeper) GetTrustees(ctx sdk.Context) sdk.Iterator

Gets all trustees

type MsgAddProfiler

type MsgAddProfiler struct {
	Profiler
}

______________________________________________________________________ MsgAddProfiler - struct for add a profiler

func NewMsgAddProfiler

func NewMsgAddProfiler(addr, addedAddr sdk.AccAddress, name string) 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 Profiler

type Profiler struct {
	Name      string         `json:"name"`
	Addr      sdk.AccAddress `json:"addr"`
	AddedAddr sdk.AccAddress `json:"added_addr"`
}

func NewProfiler

func NewProfiler(addr, addedAddr sdk.AccAddress) Profiler

type Trustee

type Trustee struct {
	Addr sdk.AccAddress `json:"addr"`
}

func NewTrustee

func NewTrustee(addr sdk.AccAddress) Trustee

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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