simplestake

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCodespace sdk.CodespaceType = moduleName

	// simplestake errors reserve 300 - 399.
	CodeEmptyValidator        sdk.CodeType = 300
	CodeInvalidUnbond         sdk.CodeType = 301
	CodeEmptyStake            sdk.CodeType = 302
	CodeIncorrectStakingToken sdk.CodeType = 303
)

simple stake errors reserve 300 ~ 399.

Variables

This section is empty.

Functions

func ErrEmptyStake

func ErrEmptyStake(codespace sdk.CodespaceType) sdk.Error

func ErrEmptyValidator

func ErrEmptyValidator(codespace sdk.CodespaceType) sdk.Error

func ErrIncorrectStakingToken

func ErrIncorrectStakingToken(codespace sdk.CodespaceType) sdk.Error

nolint

func ErrInvalidUnbond

func ErrInvalidUnbond(codespace sdk.CodespaceType) sdk.Error

func NewHandler

func NewHandler(k Keeper) sdk.Handler

NewHandler returns a handler for "simplestake" type messages.

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Register concrete types on codec codec

Types

type Keeper

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

simple stake keeper

func NewKeeper

func NewKeeper(key sdk.StoreKey, bankKeeper bank.Keeper, codespace sdk.CodespaceType) Keeper

func (Keeper) Bond

func (k Keeper) Bond(ctx sdk.Context, addr sdk.AccAddress, pubKey crypto.PubKey, stake sdk.Coin) (int64, sdk.Error)

register a bond with the keeper

func (Keeper) Unbond

func (k Keeper) Unbond(ctx sdk.Context, addr sdk.AccAddress) (crypto.PubKey, int64, sdk.Error)

register an unbond with the keeper

type MsgBond

type MsgBond struct {
	Address sdk.AccAddress `json:"address"`
	Stake   sdk.Coin       `json:"coins"`
	PubKey  crypto.PubKey  `json:"pub_key"`
}

simple bond message

func NewMsgBond

func NewMsgBond(addr sdk.AccAddress, stake sdk.Coin, pubKey crypto.PubKey) MsgBond

func (MsgBond) GetSignBytes

func (msg MsgBond) GetSignBytes() []byte

get bond message sign bytes

func (MsgBond) GetSigners

func (msg MsgBond) GetSigners() []sdk.AccAddress

func (MsgBond) Route

func (msg MsgBond) Route() string

nolint

func (MsgBond) Type

func (msg MsgBond) Type() string

func (MsgBond) ValidateBasic

func (msg MsgBond) ValidateBasic() sdk.Error

basic validation of the bond message

type MsgUnbond

type MsgUnbond struct {
	Address sdk.AccAddress `json:"address"`
}

simple unbond message

func NewMsgUnbond

func NewMsgUnbond(addr sdk.AccAddress) MsgUnbond

func (MsgUnbond) GetSignBytes

func (msg MsgUnbond) GetSignBytes() []byte

get unbond message sign bytes

func (MsgUnbond) GetSigners

func (msg MsgUnbond) GetSigners() []sdk.AccAddress

func (MsgUnbond) Route

func (msg MsgUnbond) Route() string

nolint

func (MsgUnbond) Type

func (msg MsgUnbond) Type() string

func (MsgUnbond) ValidateBasic

func (msg MsgUnbond) ValidateBasic() sdk.Error

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

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