types

package
v1.0.11 Latest Latest
Warning

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

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

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"
	QueryServiceNodes    = "nodes"
	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

func EndpointsDupCheck(eps Endpoints) sdk.Error

func ErrBadDenom

func ErrBadDenom(msg string) sdk.Error

func ErrBondInsufficient

func ErrBondInsufficient(msg string) sdk.Error

func ErrEmptyInputs

func ErrEmptyInputs(msg string) sdk.Error

func ErrEndpointsDuplicate

func ErrEndpointsDuplicate(msg string) sdk.Error

func ErrEndpointsEmpty

func ErrEndpointsEmpty() sdk.Error

func ErrEndpointsFormat

func ErrEndpointsFormat() sdk.Error

func ErrMonikerExist

func ErrMonikerExist(msg string) sdk.Error

func GetServiceNodeByBondKey

func GetServiceNodeByBondKey(obj ServiceNode) []byte

func GetServiceNodeByMonikerKey

func GetServiceNodeByMonikerKey(moniker string) []byte

func GetServiceNodeKey

func GetServiceNodeKey(addr sdk.AccAddress) []byte

func GetUnBondingKey

func GetUnBondingKey(timestamp time.Time) []byte

func MustMarshalServiceNode

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

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Types

type Endpoint

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

func NewEndpoint

func NewEndpoint(endpointType uint64, endpoint string) Endpoint

type EndpointDuplicateErrDetector

type EndpointDuplicateErrDetector struct {
	V map[int]int
}

type Endpoints

type Endpoints []Endpoint

func EndpointsFromString

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

func (Endpoints) String

func (e Endpoints) String() string

type GenesisState

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

func DefaultGenesisState

func DefaultGenesisState() GenesisState

func NewGenesisState

func NewGenesisState(params Params) GenesisState

type MsgServiceNodeClaim

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

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

func (MsgServiceNodeClaim) GetSignBytes

func (msg MsgServiceNodeClaim) GetSignBytes() []byte

func (MsgServiceNodeClaim) GetSigners

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

func (MsgServiceNodeClaim) Route

func (msg MsgServiceNodeClaim) Route() string

func (*MsgServiceNodeClaim) TrimSpace

func (msg *MsgServiceNodeClaim) TrimSpace()

func (MsgServiceNodeClaim) Type

func (msg MsgServiceNodeClaim) Type() string

func (MsgServiceNodeClaim) ValidateBasic

func (msg MsgServiceNodeClaim) ValidateBasic() sdk.Error

type Params

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

func DefaultParams

func DefaultParams() Params

func NewParams

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

func (*Params) ParamSetPairs

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

func (Params) String

func (p Params) String() string

type QueryServiceNodeParams

type QueryServiceNodeParams struct {
	AccAddr sdk.AccAddress
}

func NewQueryServiceNodeParams

func NewQueryServiceNodeParams(AccAddr sdk.AccAddress) QueryServiceNodeParams

type QueryServiceNodesParams added in v1.0.10

type QueryServiceNodesParams struct {
	AccAddrs []sdk.AccAddress `json:"acc_addrs"`
}

func NewQueryServiceNodesParams added in v1.0.10

func NewQueryServiceNodesParams(AccAddrs []sdk.AccAddress) QueryServiceNodesParams

type ServiceNode

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

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

func NewServiceNode

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

func UnmarshalServiceNode

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

func (ServiceNode) MarshalYAML

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

func (ServiceNode) String

func (obj ServiceNode) String() string

type ServiceNodes

type ServiceNodes []ServiceNode

func (ServiceNodes) String

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

type ServiceType

type ServiceType uint64
const (
	Chatting ServiceType = 1
	Storage
)

type SupplyKeeper

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

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

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

func (UnBonding) IsMature

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

type UnBondings

type UnBondings []UnBonding

Jump to

Keyboard shortcuts

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