types

package
v0.0.0-...-df98d5b Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeCreate  = "create"
	EventTypeSend    = "send"
	EventTypeDeposit = "deposit"
	EventTypeApprove = "approve"
)
View Source
const (
	AttributeKeyIdentity = "identity"
	AttributeKeyConsents = "consents"
	AttributeKeyFrom     = "from"
	AttributeKeyTo       = "to"
	AttributeKeyCoins    = "coins"
	AttributeKeyDeadline = "deadline"
	AttributeKeyHolder   = "holder"
)
View Source
const (
	ModuleName   = "joint"
	QuerierRoute = ModuleName
	RouterKey    = ModuleName
	StoreKey     = ModuleName
)
View Source
const (
	QueryAccount   = "account"
	QueryAccounts  = "accounts"
	QueryTransfer  = "transfer"
	QueryTransfers = "transfers"
)

Variables

View Source
var (
	ErrorMarshal              = errors.Register(ModuleName, 101, "failed to marshal")
	ErrorUnmarshal            = errors.Register(ModuleName, 102, "failed to unmarshal")
	ErrorUnknownMessage       = errors.Register(ModuleName, 103, "unknown message")
	ErrorUnknownQuery         = errors.Register(ModuleName, 104, "unknown query")
	ErrorNegativeCoins        = errors.Register(ModuleName, 105, "negative coins")
	ErrorAccountDoesNotExist  = errors.Register(ModuleName, 106, "address does not exist")
	ErrorTransferDoesNotExist = errors.Register(ModuleName, 107, "transfer does not exist")
	ErrorDeadlineExceeded     = errors.Register(ModuleName, 108, "deadline exceeded")
	ErrorTransferFulfilled    = errors.Register(ModuleName, 109, "transfer fulfilled")
	ErrorDuplicateSigner      = errors.Register(ModuleName, 110, "duplicate signer")
	ErrorHolderDoesNotExist   = errors.Register(ModuleName, 111, "holder does not exist")
)
View Source
var (
	AccountsCountKey = []byte{0x00}
	AccountKeyPrefix = []byte{0x01}

	TransfersCountKey            = []byte{0x10}
	TransferKeyPrefix            = []byte{0x11}
	TransferForDeadlineKeyPrefix = []byte{0x12}
)
View Source
var (
	ModuleCdc *codec.Codec
)

Functions

func AccountKey

func AccountKey(i uint64) []byte

func GetTransferForDeadlineKeyPrefix

func GetTransferForDeadlineKeyPrefix(at time.Time) []byte

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

func TransferForDeadlineKey

func TransferForDeadlineKey(at time.Time, i uint64) []byte

func TransferKey

func TransferKey(i uint64) []byte

Types

type Account

type Account struct {
	Identity uint64           `json:"identity"`
	Consents int              `json:"consents"`
	Holders  []sdk.AccAddress `json:"holders"`
	Coins    sdk.Coins        `json:"coins"`
}

func (Account) String

func (a Account) String() string

func (Account) Validate

func (a Account) Validate() error

type Accounts

type Accounts []Account

type GenesisState

type GenesisState struct {
	Accounts  Accounts  `json:"accounts"`
	Transfers Transfers `json:"transfers"`
}

func DefaultGenesisState

func DefaultGenesisState() GenesisState

func NewGenesisState

func NewGenesisState(accounts Accounts, transfers Transfers) GenesisState

type MsgApprove

type MsgApprove struct {
	Signer sdk.AccAddress `json:"signer"`

	Identity uint64 `json:"identity"`
}

func NewMsgApprove

func NewMsgApprove(signer sdk.AccAddress, identity uint64) MsgApprove

func (MsgApprove) GetSignBytes

func (m MsgApprove) GetSignBytes() []byte

func (MsgApprove) GetSigners

func (m MsgApprove) GetSigners() []sdk.AccAddress

func (MsgApprove) Route

func (m MsgApprove) Route() string

func (MsgApprove) Type

func (m MsgApprove) Type() string

func (MsgApprove) ValidateBasic

func (m MsgApprove) ValidateBasic() error

type MsgCreate

type MsgCreate struct {
	Signer sdk.AccAddress `json:"signer"`

	Consents int              `json:"consents"`
	Holders  []sdk.AccAddress `json:"holders"`
}

func NewMsgCreate

func NewMsgCreate(signer sdk.AccAddress, consents int, holders []sdk.AccAddress) MsgCreate

func (MsgCreate) GetSignBytes

func (m MsgCreate) GetSignBytes() []byte

func (MsgCreate) GetSigners

func (m MsgCreate) GetSigners() []sdk.AccAddress

func (MsgCreate) Route

func (m MsgCreate) Route() string

func (MsgCreate) Type

func (m MsgCreate) Type() string

func (MsgCreate) ValidateBasic

func (m MsgCreate) ValidateBasic() error

type MsgDeposit

type MsgDeposit struct {
	Signer sdk.AccAddress `json:"signer"`

	Identity uint64    `json:"identity"`
	Coins    sdk.Coins `json:"coins"`
}

func NewMsgDeposit

func NewMsgDeposit(signer sdk.AccAddress, identity uint64, coins sdk.Coins) MsgDeposit

func (MsgDeposit) GetSignBytes

func (m MsgDeposit) GetSignBytes() []byte

func (MsgDeposit) GetSigners

func (m MsgDeposit) GetSigners() []sdk.AccAddress

func (MsgDeposit) Route

func (m MsgDeposit) Route() string

func (MsgDeposit) Type

func (m MsgDeposit) Type() string

func (MsgDeposit) ValidateBasic

func (m MsgDeposit) ValidateBasic() error

type MsgSend

type MsgSend struct {
	Signer sdk.AccAddress `json:"signer"`

	From     uint64         `json:"from"`
	To       sdk.AccAddress `json:"to"`
	Coins    sdk.Coins      `json:"coins"`
	Deadline time.Time      `json:"deadline"`
}

func NewMsgSend

func NewMsgSend(signer sdk.AccAddress, from uint64, to sdk.AccAddress, coins sdk.Coins, deadline time.Time) MsgSend

func (MsgSend) GetSignBytes

func (m MsgSend) GetSignBytes() []byte

func (MsgSend) GetSigners

func (m MsgSend) GetSigners() []sdk.AccAddress

func (MsgSend) Route

func (m MsgSend) Route() string

func (MsgSend) Type

func (m MsgSend) Type() string

func (MsgSend) ValidateBasic

func (m MsgSend) ValidateBasic() error

type QueryAccountParams

type QueryAccountParams struct {
	Identity uint64 `json:"identity"`
}

func NewQueryAccountParams

func NewQueryAccountParams(identity uint64) QueryAccountParams

type QueryAccountsParams

type QueryAccountsParams struct {
	Page  int `json:"page"`
	Limit int `json:"limit"`
}

func NewQueryAccountsParams

func NewQueryAccountsParams(page, limit int) QueryAccountsParams

type QueryTransferParams

type QueryTransferParams struct {
	Identity uint64 `json:"identity"`
}

func NewQueryTransferParams

func NewQueryTransferParams(identity uint64) QueryTransferParams

type QueryTransfersParams

type QueryTransfersParams struct {
	Page  int `json:"page"`
	Limit int `json:"limit"`
}

func NewQueryTransfersParams

func NewQueryTransfersParams(page, limit int) QueryTransfersParams

type Transfer

type Transfer struct {
	Identity uint64 `json:"identity"`

	From  uint64         `json:"from"`
	To    sdk.AccAddress `json:"to"`
	Coins sdk.Coins      `json:"coins"`

	Deadline time.Time        `json:"deadline"`
	Signers  []sdk.AccAddress `json:"signers"`
}

func (Transfer) String

func (t Transfer) String() string

func (Transfer) Validate

func (t Transfer) Validate() error

type Transfers

type Transfers []Transfer

Jump to

Keyboard shortcuts

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