types

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeInvalidOperator       = 100
	CodeProfilerExists        = 101
	CodeProfilerNotExists     = 102
	CodeInvalidDescription    = 105
	CodeDeleteGenesisProfiler = 106
	CodeInvalidGuardian       = 108
	CodeAddressEmpty          = 120
	CodeAddedByEmpty          = 121
	CodeDeletedByEmpty        = 122
)
View Source
const (
	ModuleName   = protocol.GuardianModuleName
	StoreKey     = ModuleName
	RouterKey    = ModuleName
	QuerierRoute = ModuleName
)
View Source
const MaxDescLenght = 70
View Source
const (
	QueryProfilers = "profilers"
)

Variables

This section is empty.

Functions

func ErrAddedByEmpty

func ErrAddedByEmpty() error

func ErrAddressEmpty

func ErrAddressEmpty() error

func ErrDeleteGenesisProfiler

func ErrDeleteGenesisProfiler(profiler sdk.AccAddress) error

func ErrDeletedByEmpty

func ErrDeletedByEmpty() error

func ErrInvalidDescription

func ErrInvalidDescription() error

func ErrInvalidOperator

func ErrInvalidOperator(operator sdk.AccAddress) error

func ErrProfilerExists

func ErrProfilerExists(profiler sdk.AccAddress) error

func ErrProfilerNotExists

func ErrProfilerNotExists(profiler sdk.AccAddress) error

func GetProfilerKey

func GetProfilerKey(addr sdk.AccAddress) []byte

func GetProfilersSubspaceKey

func GetProfilersSubspaceKey() []byte

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

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)

func (AccountType) String

func (bt AccountType) String() string

Turns BindingType byte to String

func (*AccountType) UnmarshalJSON

func (bt *AccountType) UnmarshalJSON(data []byte) error

type AddGuardian

type AddGuardian struct {
	Description string         `json:"description"`
	Address     sdk.AccAddress `json:"address"`
	AddedBy     sdk.AccAddress `json:"added_by"`
}

func (AddGuardian) EnsureLength

func (g AddGuardian) EnsureLength() error

func (AddGuardian) ValidateBasic

func (g AddGuardian) ValidateBasic() error

type DeleteGuardian

type DeleteGuardian struct {
	Address   sdk.AccAddress `json:"address"`
	DeletedBy sdk.AccAddress `json:"deleted_by"`
}

func (DeleteGuardian) ValidateBasic

func (g DeleteGuardian) ValidateBasic() error

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

func (Guardian) Equal

func (g Guardian) Equal(guardian Guardian) bool

func (Guardian) Validate

func (g Guardian) Validate() error

type MsgAddProfiler

type MsgAddProfiler struct {
	AddGuardian
}

func NewMsgAddProfiler

func NewMsgAddProfiler(description string, address, addedBy sdk.AccAddress) MsgAddProfiler

func (MsgAddProfiler) GetSignBytes

func (m MsgAddProfiler) GetSignBytes() []byte

func (MsgAddProfiler) GetSigners

func (m MsgAddProfiler) GetSigners() []sdk.AccAddress

func (MsgAddProfiler) Route

func (m MsgAddProfiler) Route() string

func (MsgAddProfiler) Type

func (m MsgAddProfiler) Type() string

func (MsgAddProfiler) ValidateBasic

func (m MsgAddProfiler) ValidateBasic() error

type MsgDeleteProfiler

type MsgDeleteProfiler struct {
	DeleteGuardian
}

func NewMsgDeleteProfiler

func NewMsgDeleteProfiler(address, deletedBy sdk.AccAddress) MsgDeleteProfiler

func (MsgDeleteProfiler) GetSignBytes

func (m MsgDeleteProfiler) GetSignBytes() []byte

func (MsgDeleteProfiler) GetSigners

func (m MsgDeleteProfiler) GetSigners() []sdk.AccAddress

func (MsgDeleteProfiler) Route

func (m MsgDeleteProfiler) Route() string

func (MsgDeleteProfiler) Type

func (m MsgDeleteProfiler) Type() string

func (MsgDeleteProfiler) ValidateBasic

func (m MsgDeleteProfiler) ValidateBasic() error

type Profilers

type Profilers []Guardian

func (Profilers) String

func (ps Profilers) String() (out string)

type Trustees

type Trustees []Guardian

func (Trustees) String

func (ts Trustees) String() (out string)

Jump to

Keyboard shortcuts

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