receipt

package
Version: v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CategoryTypeTransfer   = sdk.CategoryTypeTransfer
	CategoryTypeKeyGen     = sdk.CategoryTypeKeyGen
	CategoryTypeWithdrawal = sdk.CategoryTypeWithdrawal
	CategoryTypeDeposit    = sdk.CategoryTypeDeposit
)
View Source
const (
	// module name
	ModuleName = "receipt"

	// StoreKey is the string store representation
	StoreKey = ModuleName

	// TStoreKey is the string transient store representation
	TStoreKey = "transient_" + ModuleName

	RouterKey = ModuleName

	QuerierRoute = ModuleName

	// Parameter store default parameter store
	DefaultParamspace = ModuleName
)

Variables

View Source
var (
	TagKeyReceipt = "receipt"

	// OrderStoreKeyPrefix prefix for order store
	// order key : OrderStoreKeyPrefix + bhaddress + OrderStoreKeyPrefix + orderID
	ReceiptStoreKeyPrefix = []byte{0x01}

	// OrderNumber Key : OrderIDKey + OrderStoreKeyPrefix + cuaddress
	HeightHashKeyPrefix = []byte("HeightHashKey")
)
View Source
var ModuleCdc = codec.New()

Functions

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)

InitGenesis sets distribution information for genesis.

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis performs basic validation of bank genesis data returning an error for any failed validation criteria.

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

app module

func NewAppModule

func NewAppModule(keeper Keeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)

module begin-block

func (AppModule) EndBlock

module end-block

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage

module export genesis

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate

module init-genesis

func (AppModule) Name

func (AppModule) Name() string

module name

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

module handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

module querier

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

module querier route name

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)

register invariants

func (AppModule) Route

func (AppModule) Route() string

module message route name

type AppModuleBasic

type AppModuleBasic struct{}

app module basics object

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

default genesis state

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command

get the root query command of this module

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command

get the root tx command of this module

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

module name

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

register module codec

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)

register rest routes

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error

module validate genesis

type BalanceFlow

type BalanceFlow = sdk.BalanceFlow

type CUAddress

type CUAddress = sdk.CUAddress

type CategoryType

type CategoryType = sdk.CategoryType

type DepositFlow

type DepositFlow = sdk.DepositFlow

type Flow

type Flow = sdk.Flow

type GenesisState

type GenesisState struct {
}

GenesisState is the bank state that must be provided at genesis.

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState returns a default genesis state

func ExportGenesis

func ExportGenesis(ctx sdk.Context, keeper Keeper) GenesisState

ExportGenesis returns a GenesisState for a given context and keeper.

func NewGenesisState

func NewGenesisState() GenesisState

NewGenesisState creates a new genesis state.

type Int

type Int = sdk.Int

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc *codec.Codec) *Keeper

func (*Keeper) GetReceiptFromResult

func (r *Keeper) GetReceiptFromResult(result *Result) (*sdk.Receipt, error)

func (*Keeper) NewBalanceFlow

func (r *Keeper) NewBalanceFlow(cuAddress sdk.CUAddress, symbol Symbol, orderID string, previousBalance,
	balanceChange, previousBalanceOnHold, balanceOnHoldChange Int) BalanceFlow

func (*Keeper) NewCollectFinishFlow

func (r *Keeper) NewCollectFinishFlow(orderIDs []string, costFee Int) sdk.CollectFinishFlow

func (*Keeper) NewCollectSignFinishFlow

func (r *Keeper) NewCollectSignFinishFlow(orderIDs []string, signedTx []byte) sdk.CollectSignFinishFlow

func (*Keeper) NewCollectWaitSignFlow

func (r *Keeper) NewCollectWaitSignFlow(orderIDs []string, rawData []byte) sdk.CollectWaitSignFlow

func (*Keeper) NewDepositConfirmedFlow

func (r *Keeper) NewDepositConfirmedFlow(validOrderIds, invalidOrderIds []string) sdk.DepositConfirmedFlow

func (*Keeper) NewDepositFlow

func (r *Keeper) NewDepositFlow(CuAddress, multisignedadress, symbol, txhash, orderID, memo string,
	index uint64, amount Int, depositType sdk.DepositType, epoch uint64) DepositFlow

func (*Keeper) NewOpcuAssetTransferFinishFlow

func (r *Keeper) NewOpcuAssetTransferFinishFlow(orderID string, costFee Int) sdk.OpcuAssetTransferFinishFlow

func (*Keeper) NewOpcuAssetTransferFlow

func (r *Keeper) NewOpcuAssetTransferFlow(orderID, opcu, fromAddr, toaddr, symbol string, items []sdk.TransferItem) sdk.OpcuAssetTransferFlow

func (*Keeper) NewOpcuAssetTransferSignFinishFlow

func (r *Keeper) NewOpcuAssetTransferSignFinishFlow(orderID string, signedTx []byte) sdk.OpcuAssetTransferSignFinishFlow

func (*Keeper) NewOpcuAssetTransferWaitSignFlow

func (r *Keeper) NewOpcuAssetTransferWaitSignFlow(orderID string, rawData []byte) sdk.OpcuAssetTransferWaitSignFlow

func (*Keeper) NewOrderFlow

func (r *Keeper) NewOrderFlow(symbol sdk.Symbol, cuAddress sdk.CUAddress, orderID string, orderType sdk.OrderType,
	orderStatus sdk.OrderStatus) OrderFlow

func (*Keeper) NewOrderRetryFlow

func (r *Keeper) NewOrderRetryFlow(orderIDs []string, excludedKeyNode sdk.CUAddress) sdk.OrderRetryFlow

func (*Keeper) NewReceipt

func (r *Keeper) NewReceipt(category CategoryType, flows []Flow) *sdk.Receipt

func (*Keeper) NewSysTransferFinishFlow

func (r *Keeper) NewSysTransferFinishFlow(orderID string, costFee Int) sdk.SysTransferFinishFlow

func (*Keeper) NewSysTransferFlow

func (r *Keeper) NewSysTransferFlow(orderID, fromcu, tocu, fromAddr, toaddr, symbol string, amount Int) sdk.SysTransferFlow

func (*Keeper) NewSysTransferSignFinishFlow

func (r *Keeper) NewSysTransferSignFinishFlow(orderID string, signedTx []byte) sdk.SysTransferSignFinishFlow

func (*Keeper) NewSysTransferWaitSignFlow

func (r *Keeper) NewSysTransferWaitSignFlow(orderID string, rawData []byte) sdk.SysTransferWaitSignFlow

func (*Keeper) NewWithdrawalConfirmFlow

func (r *Keeper) NewWithdrawalConfirmFlow(orderID string, status sdk.WithdrawStatus) sdk.WithdrawalConfirmFlow

func (*Keeper) NewWithdrawalFinishFlow

func (r *Keeper) NewWithdrawalFinishFlow(orderIDs []string, costFee sdk.Int, valid bool) sdk.WithdrawalFinishFlow

func (*Keeper) NewWithdrawalFlow

func (r *Keeper) NewWithdrawalFlow(orderID, fromcu, toaddr, symbol string, amount, gasFee sdk.Int, status sdk.WithdrawStatus) sdk.WithdrawalFlow

func (*Keeper) NewWithdrawalSignFinishFlow

func (r *Keeper) NewWithdrawalSignFinishFlow(orderIDs []string, signedTx []byte) sdk.WithdrawalSignFinishFlow

func (*Keeper) NewWithdrawalWaitSignFlow

func (r *Keeper) NewWithdrawalWaitSignFlow(orderIDs []string, opcu, fromAddr string, rawData []byte) sdk.WithdrawalWaitSignFlow

func (*Keeper) SaveReceiptToResult

func (r *Keeper) SaveReceiptToResult(receipt *sdk.Receipt, result *Result) *Result

type MappingBalanceFlow

type MappingBalanceFlow = sdk.MappingBalanceFlow

type OrderFlow

type OrderFlow = sdk.OrderFlow

type OrderRetryFlow

type OrderRetryFlow = sdk.OrderRetryFlow

type ReceiptKeeperI

type ReceiptKeeperI interface {
	// NewReceipt creates a new receipt with a list of flows
	NewReceipt(category CategoryType, flows []Flow) *sdk.Receipt

	// NewOrderFlow creates a new order flow
	NewOrderFlow(symbol sdk.Symbol, cuAddress CUAddress, orderID string, orderType sdk.OrderType,
		orderStatus sdk.OrderStatus) OrderFlow
	// NewBalanceFlow creates a new balance flow for an asset
	NewBalanceFlow(cuAddress CUAddress, symbol Symbol, orderID string, previousBalance,
		balanceChange, previousBalanceOnHold, balanceOnHoldChange Int) BalanceFlow

	NewDepositFlow(CuAddress, multisignedadress, symbol, txhash, orderID, memo string,
		index uint64, amount Int, depositType sdk.DepositType, epoch uint64) DepositFlow
	// SaveReceiptToResult saves the receipt into a result.
	SaveReceiptToResult(receipt *sdk.Receipt, result *Result) *Result

	GetReceiptFromResult(result *Result) (*sdk.Receipt, error)
}

ReceiptKeeperI defines a module interface for receipt, i.e. all kind of flows. The receipt is part of Result which is stored in the block results.

type Result

type Result = sdk.Result

type Symbol

type Symbol = sdk.Symbol

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL