types

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ModuleName = "order"
View Source
const NoOrderBookErr = "No OrderBook"
View Source
const OpADD = "ADD"
View Source
const OrderBookKey = "OrderBook"
View Source
const QueryState = "shard_state"
View Source
const RouteKey = ModuleName
View Source
const SleepTime = 1 * time.Second
View Source
const StateCommitting = "Committing"
View Source
const StateDone = "Done"
View Source
const StateInit = "Init"

Variables

View Source
var (
	ErrCheckParams        = sdkerrors.Register(string(DefaultCodespace), uint32(CodeCheckParamsError), "invalid params")
	ErrFailedMarshal      = sdkerrors.Register(string(DefaultCodespace), uint32(CodeBadMarshal), "marshal failed")
	ErrInvalidEndPoint    = sdkerrors.Register(string(DefaultCodespace), uint32(CodeInvalidEndPoint), "invalid endpoint")
	ErrGetOrderBookFailed = sdkerrors.Register(string(DefaultCodespace), uint32(CodeGetOrderBookFailed), "get order book failed")
)
View Source
var (
	EventType              = "order"
	AttributeValueCategory = "order"

	AttributeValueAddShard = "add_shard"
)
View Source
var ModuleCdc *codec.Codec
View Source
var (
	StoreKey = "order"
)

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Types

type Actions

type Actions struct {
	Type   string `json:"types"`
	Height int64  `json:"height"`
	Name   string `json:"name"`
}

type CodeType

type CodeType = sdk.CodeType
const (
	DefaultCodespace       sdk.CodespaceType = "order"
	CodeCheckParamsError   CodeType          = 1501
	CodeBadMarshal         CodeType          = 1502
	CodeQueryTxError       CodeType          = 1503
	CodeInvalidEndPoint    CodeType          = 1504
	CodeGetOrderBookFailed CodeType          = 1505
)

type Current

type Current struct {
	Index int    `json:"index"`
	State string `json:"state"`
}

type GenesisState

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

func DefaultGenesisState

func DefaultGenesisState() GenesisState

func NewGenesisState

func NewGenesisState(params Params) GenesisState

type Lists

type Lists struct {
	Name   string `json:"name"`
	Height int64  `json:"height"`
}

type MsgUpgrade

type MsgUpgrade struct {
	FromAddress sdk.AccAddress `json:"from_address"`
	Type        string         `json:"type"`
	Height      int64          `json:"height"`
	Name        string         `json:"name"`
}

func NewMsgUpgrade

func NewMsgUpgrade(from sdk.AccAddress, t, name string, height int64) *MsgUpgrade

func (*MsgUpgrade) Bytes

func (msg *MsgUpgrade) Bytes() []byte

func (*MsgUpgrade) GetFromAddress

func (msg *MsgUpgrade) GetFromAddress() sdk.AccAddress

func (*MsgUpgrade) MsgType

func (msg *MsgUpgrade) MsgType() string

func (*MsgUpgrade) Route

func (msg *MsgUpgrade) Route() string

func (*MsgUpgrade) ValidateBasic

func (msg *MsgUpgrade) ValidateBasic() error

type OrderBook

type OrderBook struct {
	Lists []Lists `json:"lists"`

	Current Current `json:"current"`

	Actions []Actions `json:"actions"`
}

type Params

type Params struct {
	OrderBook OrderBook `json:"orderBook"`
}

func DefaultParams

func DefaultParams() Params

Jump to

Keyboard shortcuts

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