Documentation ¶
Index ¶
- Constants
- Variables
- func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)
- func RegisterCodec(cdc *codec.Codec)
- func ValidateGenesis(data GenesisState) error
- type AppModule
- func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
- func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (AppModule) QuerierRoute() string
- func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
- func (AppModule) Route() string
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type BalanceFlow
- type CUAddress
- type CategoryType
- type DepositFlow
- type Flow
- type GenesisState
- type Int
- type Keeper
- func (r *Keeper) GetReceiptFromResult(result *Result) (*sdk.Receipt, error)
- func (r *Keeper) NewBalanceFlow(cuAddress sdk.CUAddress, symbol Symbol, orderID string, ...) BalanceFlow
- func (r *Keeper) NewCollectFinishFlow(orderIDs []string, costFee Int, success bool) sdk.CollectFinishFlow
- func (r *Keeper) NewCollectSignFinishFlow(orderIDs []string, signedTx []byte) sdk.CollectSignFinishFlow
- func (r *Keeper) NewCollectWaitSignFlow(orderIDs []string, rawData []byte) sdk.CollectWaitSignFlow
- func (r *Keeper) NewDepositConfirmedFlow(validOrderIds, invalidOrderIds []string) sdk.DepositConfirmedFlow
- func (r *Keeper) NewDepositFlow(CuAddress, multisignedadress, symbol, txhash, orderID, memo string, ...) DepositFlow
- func (r *Keeper) NewOpcuAssetTransferFinishFlow(orderID string, costFee Int) sdk.OpcuAssetTransferFinishFlow
- func (r *Keeper) NewOpcuAssetTransferFlow(orderID, opcu, fromAddr, toaddr, symbol string, items []sdk.TransferItem) sdk.OpcuAssetTransferFlow
- func (r *Keeper) NewOpcuAssetTransferSignFinishFlow(orderID string, signedTx []byte) sdk.OpcuAssetTransferSignFinishFlow
- func (r *Keeper) NewOpcuAssetTransferWaitSignFlow(orderID string, rawData []byte) sdk.OpcuAssetTransferWaitSignFlow
- func (r *Keeper) NewOrderFlow(symbol sdk.Symbol, cuAddress sdk.CUAddress, orderID string, ...) OrderFlow
- func (r *Keeper) NewOrderRetryFlow(orderIDs []string, excludedKeyNode sdk.CUAddress) sdk.OrderRetryFlow
- func (r *Keeper) NewReceipt(category CategoryType, flows []Flow) *sdk.Receipt
- func (r *Keeper) NewRecollectFlow(orderIDs []string) sdk.RecollectFlow
- func (r *Keeper) NewSysTransferFinishFlow(orderID string, costFee Int) sdk.SysTransferFinishFlow
- func (r *Keeper) NewSysTransferFlow(orderID, fromcu, tocu, fromAddr, toaddr, symbol string, amount Int) sdk.SysTransferFlow
- func (r *Keeper) NewSysTransferSignFinishFlow(orderID string, signedTx []byte) sdk.SysTransferSignFinishFlow
- func (r *Keeper) NewSysTransferWaitSignFlow(orderID string, rawData []byte) sdk.SysTransferWaitSignFlow
- func (r *Keeper) NewWithdrawalConfirmFlow(orderID string, status sdk.WithdrawStatus) sdk.WithdrawalConfirmFlow
- func (r *Keeper) NewWithdrawalFinishFlow(orderIDs []string, costFee sdk.Int, valid bool) sdk.WithdrawalFinishFlow
- func (r *Keeper) NewWithdrawalFlow(orderID, fromcu, toaddr, symbol string, amount, gasFee sdk.Int, ...) sdk.WithdrawalFlow
- func (r *Keeper) NewWithdrawalSignFinishFlow(orderIDs []string, signedTx []byte) sdk.WithdrawalSignFinishFlow
- func (r *Keeper) NewWithdrawalWaitSignFlow(orderIDs []string, opcu, fromAddr string, rawData []byte) sdk.WithdrawalWaitSignFlow
- func (r *Keeper) SaveReceiptToResult(receipt *sdk.Receipt, result *Result) *Result
- type MappingBalanceFlow
- type OrderFlow
- type OrderRetryFlow
- type ReceiptKeeperI
- type Result
- type Symbol
Constants ¶
const ( CategoryTypeTransfer = sdk.CategoryTypeTransfer CategoryTypeKeyGen = sdk.CategoryTypeKeyGen CategoryTypeWithdrawal = sdk.CategoryTypeWithdrawal CategoryTypeDeposit = sdk.CategoryTypeDeposit )
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 ¶
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") )
var ModuleCdc = codec.New()
Functions ¶
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)
InitGenesis sets distribution information for genesis.
func RegisterCodec ¶
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 ¶
NewAppModule creates a new AppModule object
func (AppModule) BeginBlock ¶
func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
module begin-block
func (AppModule) EndBlock ¶
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
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) NewQuerierHandler ¶
module querier
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
register invariants
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) 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 CategoryType ¶
type CategoryType = sdk.CategoryType
type DepositFlow ¶
type DepositFlow = sdk.DepositFlow
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 Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (*Keeper) GetReceiptFromResult ¶
func (*Keeper) NewBalanceFlow ¶
func (*Keeper) NewCollectFinishFlow ¶
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 (*Keeper) NewOrderRetryFlow ¶
func (*Keeper) NewReceipt ¶
func (r *Keeper) NewReceipt(category CategoryType, flows []Flow) *sdk.Receipt
func (*Keeper) NewRecollectFlow ¶
func (r *Keeper) NewRecollectFlow(orderIDs []string) sdk.RecollectFlow
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 (*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 ¶
type MappingBalanceFlow ¶
type MappingBalanceFlow = sdk.MappingBalanceFlow
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.