types

package
v0.0.0-...-c736a29 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "bond"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName
)
View Source
const (
	DefaultMaxBondAmount string = "100000000000stake"
)

Default parameter values.

View Source
const (
	DefaultParamspace = ModuleName
)

Default parameter namespace.

View Source
const RouterKey = ModuleName // this was defined in your key.go file

RouterKey is the module name router key

Variables

View Source
var (
	ErrInvalid = sdkerrors.Register(ModuleName, 1, "custom error message")
)
View Source
var (
	KeyMaxBondAmount = []byte("MaxBondAmount")
)

Keys for parameter access

View Source
var ModuleCdc = codec.New()

ModuleCdc is the codec for the module

Functions

func ParamKeyTable

func ParamKeyTable() subspace.KeyTable

ParamKeyTable - ParamTable for bond module.

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

Types

type Bond

type Bond struct {
	ID      ID        `json:"id,omitempty"`
	Owner   string    `json:"owner,omitempty"`
	Balance sdk.Coins `json:"balance"`
}

Bond represents funds deposited by an account for record rent payments.

type BondID

type BondID struct {
	Address  sdk.Address
	AccNum   uint64
	Sequence uint64
}

BondID simplifies generation of bond IDs.

func (BondID) Generate

func (bondID BondID) Generate() string

Generate creates the bond ID.

type BondUsageKeeper

type BondUsageKeeper interface {
	ModuleName() string
	UsesBond(ctx sdk.Context, bondID ID) bool
}

BondUsageKeeper keep track of bond usage in other modules. Used to, for example, prevent deletion of a bond that's in use.

type ID

type ID string

ID for bonds.

type MsgCancelBond

type MsgCancelBond struct {
	ID     ID             `json:"id"`
	Signer sdk.AccAddress `json:"signer"`
}

MsgCancelBond defines a cancel bond message.

func NewMsgCancelBond

func NewMsgCancelBond(id string, signer sdk.AccAddress) MsgCancelBond

NewMsgCancelBond is the constructor function for MsgCancelBond.

func (MsgCancelBond) GetSignBytes

func (msg MsgCancelBond) GetSignBytes() []byte

GetSignBytes Implements Msg.

func (MsgCancelBond) GetSigners

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

GetSigners Implements Msg.

func (MsgCancelBond) Route

func (msg MsgCancelBond) Route() string

Route Implements Msg.

func (MsgCancelBond) Type

func (msg MsgCancelBond) Type() string

Type Implements Msg.

func (MsgCancelBond) ValidateBasic

func (msg MsgCancelBond) ValidateBasic() error

ValidateBasic Implements Msg.

type MsgCreateBond

type MsgCreateBond struct {
	Coins  sdk.Coins      `json:"coins"`
	Signer sdk.AccAddress `json:"signer"`
}

MsgCreateBond defines a create bond message.

func NewMsgCreateBond

func NewMsgCreateBond(coins sdk.Coins, signer sdk.AccAddress) MsgCreateBond

NewMsgCreateBond is the constructor function for MsgCreateBond.

func (MsgCreateBond) GetSignBytes

func (msg MsgCreateBond) GetSignBytes() []byte

GetSignBytes Implements Msg.

func (MsgCreateBond) GetSigners

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

GetSigners Implements Msg.

func (MsgCreateBond) Route

func (msg MsgCreateBond) Route() string

Route Implements Msg.

func (MsgCreateBond) Type

func (msg MsgCreateBond) Type() string

Type Implements Msg.

func (MsgCreateBond) ValidateBasic

func (msg MsgCreateBond) ValidateBasic() error

ValidateBasic Implements Msg.

type MsgRefillBond

type MsgRefillBond struct {
	ID     ID             `json:"id"`
	Coins  sdk.Coins      `json:"coins"`
	Signer sdk.AccAddress `json:"signer"`
}

MsgRefillBond defines a refill bond message.

func NewMsgRefillBond

func NewMsgRefillBond(id string, denom string, amount int64, signer sdk.AccAddress) MsgRefillBond

NewMsgRefillBond is the constructor function for MsgRefillBond.

func (MsgRefillBond) GetSignBytes

func (msg MsgRefillBond) GetSignBytes() []byte

GetSignBytes Implements Msg.

func (MsgRefillBond) GetSigners

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

GetSigners Implements Msg.

func (MsgRefillBond) Route

func (msg MsgRefillBond) Route() string

Route Implements Msg.

func (MsgRefillBond) Type

func (msg MsgRefillBond) Type() string

Type Implements Msg.

func (MsgRefillBond) ValidateBasic

func (msg MsgRefillBond) ValidateBasic() error

ValidateBasic Implements Msg.

type MsgWithdrawBond

type MsgWithdrawBond struct {
	ID     ID             `json:"id"`
	Coins  sdk.Coins      `json:"coins"`
	Signer sdk.AccAddress `json:"signer"`
}

MsgWithdrawBond defines a withdraw (funds from) bond message.

func NewMsgWithdrawBond

func NewMsgWithdrawBond(id string, denom string, amount int64, signer sdk.AccAddress) MsgWithdrawBond

NewMsgWithdrawBond is the constructor function for MsgWithdrawBond.

func (MsgWithdrawBond) GetSignBytes

func (msg MsgWithdrawBond) GetSignBytes() []byte

GetSignBytes Implements Msg.

func (MsgWithdrawBond) GetSigners

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

GetSigners Implements Msg.

func (MsgWithdrawBond) Route

func (msg MsgWithdrawBond) Route() string

Route Implements Msg.

func (MsgWithdrawBond) Type

func (msg MsgWithdrawBond) Type() string

Type Implements Msg.

func (MsgWithdrawBond) ValidateBasic

func (msg MsgWithdrawBond) ValidateBasic() error

ValidateBasic Implements Msg.

type Params

type Params struct {
	MaxBondAmount string `json:"max_bond_amount" yaml:"max_bond_amount"`
}

Params defines the high level settings for the bond module.

func DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters.

func NewParams

func NewParams(maxBondAmount string) Params

NewParams creates a new Params instance

func (Params) Equal

func (p Params) Equal(p2 Params) bool

Equal returns a boolean determining if two Params types are identical.

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() subspace.ParamSetPairs

ParamSetPairs - implements params.ParamSet

func (Params) String

func (p Params) String() string

String implements the stringer interface.

func (Params) Validate

func (p Params) Validate() error

Validate checks that the parameters have valid values.

Jump to

Keyboard shortcuts

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