types

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCodespace sdk.CodespaceType = ModuleName

	CodeEmptyInputs           sdk.CodeType = 100
	CodeEndpointsFormatErr    sdk.CodeType = 102
	CodeEndpointsEmptyErr     sdk.CodeType = 103
	CodeEndpointsDuplicateErr sdk.CodeType = 104
	CodeBadDenom              sdk.CodeType = 111
	CodeBondInsufficient      sdk.CodeType = 112
	CodeMonikerExist          sdk.CodeType = 113
)
View Source
const (
	ModuleName   = "ipal"
	StoreKey     = ModuleName
	RouterKey    = ModuleName
	QuerierRoute = ModuleName
)
View Source
const (
	QueryServiceNodeList = "list"
	QueryServiceNode     = "node"
	QueryParameters      = "params"
)
View Source
const (
	DefaultUnbondingTime = time.Hour * 24 * 7
)

Variables

View Source
var (
	ServiceNodeKey          = []byte{0x10}
	ServiceNodeByBondKey    = []byte{0x11}
	ServiceNodeByMonikerKey = []byte{0x12}
	UnBondingKey            = []byte{0x13}
)
View Source
var (
	KeyUnbondingTime = []byte("UnbondingTime")
	KeyMinBond       = []byte("MinBond")
)
View Source
var (
	AttributeValueCategory = ModuleName
)
View Source
var (
	DefaultMinBond = sdk.NewCoin(sdk.NativeTokenName, sdk.NewInt(1000000*1))
)
View Source
var ModuleCdc *codec.Codec

Functions

func EndpointsDupCheck added in v1.0.5

func EndpointsDupCheck(eps Endpoints) sdk.Error

func ErrBadDenom added in v1.0.5

func ErrBadDenom(msg string) sdk.Error

func ErrBondInsufficient added in v1.0.5

func ErrBondInsufficient(msg string) sdk.Error

func ErrEmptyInputs

func ErrEmptyInputs(msg string) sdk.Error

func ErrEndpointsDuplicate added in v1.0.5

func ErrEndpointsDuplicate(msg string) sdk.Error

func ErrEndpointsEmpty added in v1.0.5

func ErrEndpointsEmpty() sdk.Error

func ErrEndpointsFormat added in v1.0.5

func ErrEndpointsFormat() sdk.Error

func ErrMonikerExist added in v1.0.5

func ErrMonikerExist(msg string) sdk.Error

func GetServiceNodeByBondKey added in v1.0.5

func GetServiceNodeByBondKey(obj ServiceNode) []byte

func GetServiceNodeByMonikerKey added in v1.0.5

func GetServiceNodeByMonikerKey(moniker string) []byte

func GetServiceNodeKey added in v1.0.5

func GetServiceNodeKey(addr sdk.AccAddress) []byte

func GetUnBondingKey added in v1.0.5

func GetUnBondingKey(timestamp time.Time) []byte

func MustMarshalServiceNode added in v1.0.5

func MustMarshalServiceNode(cdc *codec.Codec, obj ServiceNode) []byte

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Types

type Endpoint added in v1.0.5

type Endpoint struct {
	Type     uint64 `json:"type" yaml:"type"`
	Endpoint string `json:"endpoint" yaml:"endpoint"`
}

func NewEndpoint added in v1.0.5

func NewEndpoint(endpointType uint64, endpoint string) Endpoint

type EndpointDuplicateErrDetector added in v1.0.5

type EndpointDuplicateErrDetector struct {
	V map[int]int
}

type Endpoints added in v1.0.5

type Endpoints []Endpoint

func EndpointsFromString added in v1.0.5

func EndpointsFromString(s string) (r Endpoints, e sdk.Error)

func (Endpoints) String added in v1.0.5

func (e Endpoints) String() string

type GenesisState added in v1.0.5

type GenesisState struct {
	Params Params `json:"params" yaml:"params"`
}

func DefaultGenesisState added in v1.0.5

func DefaultGenesisState() GenesisState

func NewGenesisState added in v1.0.5

func NewGenesisState(params Params) GenesisState

type MsgServiceNodeClaim added in v1.0.5

type MsgServiceNodeClaim struct {
	OperatorAddress sdk.AccAddress `json:"operator_address" yaml:"operator_address"` // address of the ServiceNode's operator
	Moniker         string         `json:"moniker" yaml:"moniker"`                   // name
	Website         string         `json:"website" yaml:"website"`                   // optional website link
	Details         string         `json:"details" yaml:"details"`                   // optional details
	Endpoints       Endpoints      `json:"endpoints" yaml:"endpoints"`               // server endpoint for app client
	Bond            sdk.Coin       `json:"bond" yaml:"bond"`
}

func NewMsgServiceNodeClaim added in v1.0.5

func NewMsgServiceNodeClaim(operator sdk.AccAddress, moniker, website, details string, endpoints Endpoints, Bond sdk.Coin) MsgServiceNodeClaim

func (MsgServiceNodeClaim) GetSignBytes added in v1.0.5

func (msg MsgServiceNodeClaim) GetSignBytes() []byte

func (MsgServiceNodeClaim) GetSigners added in v1.0.5

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

func (MsgServiceNodeClaim) Route added in v1.0.5

func (msg MsgServiceNodeClaim) Route() string

func (*MsgServiceNodeClaim) TrimSpace added in v1.0.5

func (msg *MsgServiceNodeClaim) TrimSpace()

func (MsgServiceNodeClaim) Type added in v1.0.5

func (msg MsgServiceNodeClaim) Type() string

func (MsgServiceNodeClaim) ValidateBasic added in v1.0.5

func (msg MsgServiceNodeClaim) ValidateBasic() sdk.Error

type Params added in v1.0.5

type Params struct {
	UnbondingTime time.Duration `json:"unbonding_time" yaml:"unbonding_time"`
	MinBond       sdk.Coin      `json:"min_bond" yaml:"min_bond"`
}

func DefaultParams added in v1.0.5

func DefaultParams() Params

func NewParams added in v1.0.5

func NewParams(unbondingTime time.Duration, minBond sdk.Coin) Params

func (*Params) ParamSetPairs added in v1.0.5

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

func (Params) String added in v1.0.5

func (p Params) String() string

type QueryServiceNodeParams added in v1.0.5

type QueryServiceNodeParams struct {
	AccAddr sdk.AccAddress
}

func NewQueryServiceNodeParams added in v1.0.5

func NewQueryServiceNodeParams(AccAddr sdk.AccAddress) QueryServiceNodeParams

type ServiceNode added in v1.0.5

type ServiceNode struct {
	OperatorAddress sdk.AccAddress `json:"operator_address" yaml:"operator_address"` // address of the ServiceNode's operator
	Moniker         string         `json:"moniker" yaml:"moniker"`                   // name
	Website         string         `json:"website" yaml:"website"`                   // optional website link
	Details         string         `json:"details" yaml:"details"`                   // optional details
	Endpoints       Endpoints      `json:"endpoints" yaml:"endpoints"`
	Bond            sdk.Coin       `json:"bond" yaml:"bond"`
}

func MustUnmarshalServiceNode added in v1.0.5

func MustUnmarshalServiceNode(cdc *codec.Codec, value []byte) ServiceNode

func NewServiceNode added in v1.0.5

func NewServiceNode(operator sdk.AccAddress, moniker, website string, details string, endpoints Endpoints, amount sdk.Coin) ServiceNode

func UnmarshalServiceNode added in v1.0.5

func UnmarshalServiceNode(cdc *codec.Codec, value []byte) (obj ServiceNode, err error)

func (ServiceNode) MarshalYAML added in v1.0.5

func (obj ServiceNode) MarshalYAML() (interface{}, error)

func (ServiceNode) String added in v1.0.5

func (obj ServiceNode) String() string

type ServiceNodes added in v1.0.5

type ServiceNodes []ServiceNode

func (ServiceNodes) String added in v1.0.5

func (v ServiceNodes) String() (out string)

type ServiceType added in v1.0.5

type ServiceType uint64
const (
	Chatting ServiceType = 1
	Storage
)

type SupplyKeeper added in v1.0.5

type SupplyKeeper interface {
	GetModuleAddress(name string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, name string) supplyexported.ModuleAccountI

	SetModuleAccount(sdk.Context, supplyexported.ModuleAccountI)

	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) sdk.Error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) sdk.Error
}

type UnBonding added in v1.0.5

type UnBonding struct {
	AccountAddress sdk.AccAddress `json:"account_address" yaml:"account_address"`
	Amount         sdk.Coin       `json:"amount" yaml:"amount"`
	EndTime        time.Time      `json:"end_time" yaml:"end_time"`
}

func NewUnBonding added in v1.0.5

func NewUnBonding(aa sdk.AccAddress, amt sdk.Coin, endTime time.Time) UnBonding

func (UnBonding) IsMature added in v1.0.5

func (ub UnBonding) IsMature(now time.Time) bool

type UnBondings added in v1.0.5

type UnBondings []UnBonding

Jump to

Keyboard shortcuts

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