From a38fe781ba9ce5d45b346c7c4ff383c965d14309 Mon Sep 17 00:00:00 2001 From: Lorenz Herzberger <64837895+LaurentMontBlanc@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:57:58 +0100 Subject: [PATCH] 187 implement rddl claim (#298) * ignite scaffold map redeem-claim amount issued:bool --module dao --index beneficiary,liquid-tx-hash * revert: remove autogenerated delete redeem claim logic * fix: replace deprecated autogenerated sdkerrors with errorsmod * refactor: rename issued to confirmed on redeem claim * feat: add claim address param * test: add test for restricted msg UpdateRedeemClaim * refactor: update redeem claim key creation and messages * feat: add SendUpdateRedeemCLaim to util * feat: add RedeemClaimDecorator for ante package * ignite scaffold message confirm-redeem-claim id:uint beneficiary:string --module dao * feat: add handleConfirmRedeemClaim to ante handler * feat: add handleUpdateRedeemClaim to ante handler * feat: implement ConfirmRedeemClaim msg handler * test: add redeem claim test and adjust e2e test suite * fix: make use of uint to rddl string util in CreateRedeemClaim * fix: linter and staticcheck errors * ignite scaffold query redeem-claim-by-liquid-tx-hash liquid-tx-hash --response redeem-claim:RedeemClaim --module dao * feat: add RedeemClaimByLiquidTXHash store capabilities * test: add QueryRedeemClaimByLiquidTxHash to e2e test suite * feat: add RedeemClaimDecorator to ante handler chain * fix: remove redundant planetmint-go from service path * fix: linter and staticcheck errors * fix: go vet errors * fix: remove unused autogenerated simulation * fix: broken simulation * fix: openapi.yml * revert: remove autogenerated redundant test file that causes data race on pipeline * feat: burn claim on CreateRedeemClaim * fix: linter error * test: fix mock bankkeeper for msg server test * fix: reissuance test if statement * chore: removed TODO comment * fix: typo in redeem claim error msg * revert: remove autogenerated genesis state * fix: dao module simulation * revert: remove unused function * fix: linter errors * fix: linter error --------- Signed-off-by: Lorenz Herzberger --- app/ante/ante.go | 1 + app/ante/check_validator_decorator.go | 2 + app/ante/expected_keepers.go | 4 + app/ante/redeem_claim_decorator.go | 90 ++ docs/static/openapi.yml | 359 +++++ go.mod | 1 + go.sum | 2 + proto/planetmintgo/dao/genesis.proto | 5 +- proto/planetmintgo/dao/params.proto | 17 +- proto/planetmintgo/dao/query.proto | 58 +- proto/planetmintgo/dao/redeem_claim.proto | 14 + proto/planetmintgo/dao/tx.proto | 29 + .../dao/pop_participant_selection_suite.go | 99 ++ tests/e2e/dao/restricted_msgs_suite.go | 6 + tests/e2e/dao/suite.go | 15 +- testutil/e2e/e2e.go | 2 +- testutil/keeper/dao.go | 2 + util/issue_commands.go | 7 + x/dao/client/cli/query.go | 4 + x/dao/client/cli/query_redeem_claim.go | 121 ++ x/dao/client/cli/tx.go | 3 + x/dao/client/cli/tx_confirm_redeem_claim.go | 48 + x/dao/client/cli/tx_redeem_claim.go | 87 + x/dao/genesis_test.go | 1 - x/dao/keeper/msg_server_redeem_claim.go | 113 ++ x/dao/keeper/msg_server_redeem_claim_test.go | 93 ++ x/dao/keeper/params.go | 4 + x/dao/keeper/query_redeem_claim.go | 76 + x/dao/keeper/query_redeem_claim_test.go | 130 ++ x/dao/keeper/redeem_claim.go | 118 ++ x/dao/keeper/redeem_claim_test.go | 66 + x/dao/module_simulation.go | 80 + x/dao/simulation/confirm_redeem_claim.go | 29 + x/dao/simulation/redeem_claim.go | 102 ++ x/dao/types/codec.go | 10 + x/dao/types/errors.go | 1 + x/dao/types/genesis.go | 4 - x/dao/types/genesis.pb.go | 20 +- x/dao/types/genesis_test.go | 1 - x/dao/types/key_redeem_claim.go | 45 + x/dao/types/messages_redeem_claim.go | 142 ++ x/dao/types/messages_redeem_claim_test.go | 95 ++ x/dao/types/params.go | 6 +- x/dao/types/params.pb.go | 116 +- x/dao/types/query.pb.go | 1397 +++++++++++++++- x/dao/types/query.pb.gw.go | 307 ++++ x/dao/types/redeem_claim.pb.go | 535 +++++++ x/dao/types/tx.pb.go | 1413 ++++++++++++++++- 48 files changed, 5687 insertions(+), 193 deletions(-) create mode 100644 app/ante/redeem_claim_decorator.go create mode 100644 proto/planetmintgo/dao/redeem_claim.proto create mode 100644 x/dao/client/cli/query_redeem_claim.go create mode 100644 x/dao/client/cli/tx_confirm_redeem_claim.go create mode 100644 x/dao/client/cli/tx_redeem_claim.go create mode 100644 x/dao/keeper/msg_server_redeem_claim.go create mode 100644 x/dao/keeper/msg_server_redeem_claim_test.go create mode 100644 x/dao/keeper/query_redeem_claim.go create mode 100644 x/dao/keeper/query_redeem_claim_test.go create mode 100644 x/dao/keeper/redeem_claim.go create mode 100644 x/dao/keeper/redeem_claim_test.go create mode 100644 x/dao/simulation/confirm_redeem_claim.go create mode 100644 x/dao/simulation/redeem_claim.go create mode 100644 x/dao/types/key_redeem_claim.go create mode 100644 x/dao/types/messages_redeem_claim.go create mode 100644 x/dao/types/messages_redeem_claim_test.go create mode 100644 x/dao/types/redeem_claim.pb.go diff --git a/app/ante/ante.go b/app/ante/ante.go index 78355a7..6f01738 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -61,6 +61,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { NewCheckMachineDecorator(options.MachineKeeper), NewCheckMintAddressDecorator(options.DaoKeeper), NewCheckReissuanceDecorator(options.DaoKeeper), + NewRedeemClaimDecorator(options.DaoKeeper, options.BankKeeper), ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker), ante.NewSetPubKeyDecorator(options.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators diff --git a/app/ante/check_validator_decorator.go b/app/ante/check_validator_decorator.go index 369c1e5..50ec8c8 100644 --- a/app/ante/check_validator_decorator.go +++ b/app/ante/check_validator_decorator.go @@ -31,6 +31,8 @@ func (cv CheckValidatorDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulat fallthrough case "/planetmintgo.dao.MsgReissueRDDLResult": fallthrough + case "/planetmintgo.dao.MsgUpdateRedeemClaim": + fallthrough case "/planetmintgo.machine.MsgNotarizeLiquidAsset": fallthrough case "/planetmintgo.machine.MsgRegisterTrustAnchor": diff --git a/app/ante/expected_keepers.go b/app/ante/expected_keepers.go index 420c8c4..259747c 100644 --- a/app/ante/expected_keepers.go +++ b/app/ante/expected_keepers.go @@ -33,12 +33,16 @@ type BankKeeper interface { IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error SendCoins(ctx sdk.Context, from, to sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin } type DaoKeeper interface { GetMintRequestByHash(ctx sdk.Context, hash string) (val daotypes.MintRequest, found bool) GetMintAddress(ctx sdk.Context) (mintAddress string) + GetClaimAddress(ctx sdk.Context) (claimAddress string) IsValidReissuanceProposal(ctx sdk.Context, msg *daotypes.MsgReissueRDDLProposal) (isValid bool) + GetRedeemClaim(ctx sdk.Context, benficiary string, id uint64) (val daotypes.RedeemClaim, found bool) + GetParams(ctx sdk.Context) (params daotypes.Params) } type StakingKeeper interface { diff --git a/app/ante/redeem_claim_decorator.go b/app/ante/redeem_claim_decorator.go new file mode 100644 index 0000000..48e335c --- /dev/null +++ b/app/ante/redeem_claim_decorator.go @@ -0,0 +1,90 @@ +package ante + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + daotypes "github.com/planetmint/planetmint-go/x/dao/types" +) + +type RedeemClaimDecorator struct { + dk DaoKeeper + bk BankKeeper +} + +func NewRedeemClaimDecorator(dk DaoKeeper, bk BankKeeper) RedeemClaimDecorator { + return RedeemClaimDecorator{ + dk: dk, + bk: bk, + } +} + +func (rcd RedeemClaimDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (_ sdk.Context, err error) { + for _, msg := range tx.GetMsgs() { + switch sdk.MsgTypeURL(msg) { + case "/planetmintgo.dao.MsgCreateRedeemClaim": + ctx, err = rcd.handleCreateRedeemClaim(ctx, msg) + case "/planetmintgo.dao.MsgUpdateRedeemClaim": + ctx, err = rcd.handleUpdateRedeemClaim(ctx, msg) + case "/planetmintgo.dao.MsgConfirmRedeemClaim": + ctx, err = rcd.handleConfirmRedeemClaim(ctx, msg) + default: + continue + } + } + + if err != nil { + return ctx, err + } + + return next(ctx, tx, simulate) +} + +func (rcd RedeemClaimDecorator) handleCreateRedeemClaim(ctx sdk.Context, msg sdk.Msg) (sdk.Context, error) { + createRedeemClaimMsg, ok := msg.(*daotypes.MsgCreateRedeemClaim) + if !ok { + return ctx, errorsmod.Wrapf(sdkerrors.ErrLogic, "could not cast to MsgCreateRedeemClaim") + } + + addr := sdk.MustAccAddressFromBech32(createRedeemClaimMsg.Creator) + + params := rcd.dk.GetParams(ctx) + balance := rcd.bk.GetBalance(ctx, addr, params.ClaimDenom) + + if !balance.Amount.GTE(sdk.NewIntFromUint64(createRedeemClaimMsg.Amount)) { + return ctx, errorsmod.Wrap(sdkerrors.ErrInsufficientFunds, "error during checkTx or reCheckTx") + } + + return ctx, nil +} + +func (rcd RedeemClaimDecorator) handleUpdateRedeemClaim(ctx sdk.Context, msg sdk.Msg) (sdk.Context, error) { + updateClaimMsg, ok := msg.(*daotypes.MsgUpdateRedeemClaim) + if !ok { + return ctx, errorsmod.Wrapf(sdkerrors.ErrLogic, "could not cast to MsgUpdateRedeemClaim") + } + + _, found := rcd.dk.GetRedeemClaim(ctx, updateClaimMsg.Beneficiary, updateClaimMsg.Id) + if !found { + return ctx, errorsmod.Wrapf(sdkerrors.ErrNotFound, "no redeem claim found for beneficiary: %s; id: %d", updateClaimMsg.Beneficiary, updateClaimMsg.Id) + } + + return ctx, nil +} + +func (rcd RedeemClaimDecorator) handleConfirmRedeemClaim(ctx sdk.Context, msg sdk.Msg) (sdk.Context, error) { + confirmClaimMsg, ok := msg.(*daotypes.MsgConfirmRedeemClaim) + if !ok { + return ctx, errorsmod.Wrapf(sdkerrors.ErrLogic, "could not cast to MsgConfirmRedeemClaim") + } + + if confirmClaimMsg.Creator != rcd.dk.GetClaimAddress(ctx) { + return ctx, errorsmod.Wrapf(daotypes.ErrInvalidClaimAddress, "expected: %s; got: %s", rcd.dk.GetClaimAddress(ctx), confirmClaimMsg.Creator) + } + _, found := rcd.dk.GetRedeemClaim(ctx, confirmClaimMsg.Beneficiary, confirmClaimMsg.Id) + if !found { + return ctx, errorsmod.Wrapf(sdkerrors.ErrNotFound, "no redeem claim found for beneficiary: %s; id: %d", confirmClaimMsg.Beneficiary, confirmClaimMsg.Id) + } + + return ctx, nil +} diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 4980879..2522bfa 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -47045,6 +47045,8 @@ paths: mqtt_response_timeout: type: string format: int64 + claim_address: + type: string description: >- QueryParamsResponse is response type for the Query/Params RPC method. @@ -47068,6 +47070,248 @@ paths: additionalProperties: {} tags: - Query + /planetmint/dao/redeem_claim: + get: + operationId: PlanetmintgoDaoRedeemClaimAll + responses: + '200': + description: A successful response. + schema: + type: object + properties: + redeemClaim: + type: array + items: + type: object + properties: + id: + type: string + format: uint64 + beneficiary: + type: string + liquidTxHash: + type: string + amount: + type: string + format: uint64 + confirmed: + type: boolean + creator: + type: string + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /planetmint/dao/redeem_claim/{beneficiary}/{id}: + get: + summary: Queries a list of RedeemClaim items. + operationId: PlanetmintgoDaoRedeemClaim + responses: + '200': + description: A successful response. + schema: + type: object + properties: + redeemClaim: + type: object + properties: + id: + type: string + format: uint64 + beneficiary: + type: string + liquidTxHash: + type: string + amount: + type: string + format: uint64 + confirmed: + type: boolean + creator: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: beneficiary + in: path + required: true + type: string + - name: id + in: path + required: true + type: string + format: uint64 + tags: + - Query + /planetmint/dao/redeem_claim_by_liquid_tx_hash/{liquidTxHash}: + get: + summary: Queries a list of RedeemClaimByLiquidTxHash items. + operationId: PlanetmintgoDaoRedeemClaimByLiquidTxHash + responses: + '200': + description: A successful response. + schema: + type: object + properties: + redeemClaim: + type: object + properties: + id: + type: string + format: uint64 + beneficiary: + type: string + liquidTxHash: + type: string + amount: + type: string + format: uint64 + confirmed: + type: boolean + creator: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: liquidTxHash + in: path + required: true + type: string + tags: + - Query /planetmint/dao/reissuance/{blockHeight}: get: summary: Queries a list of GetReissuance items. @@ -76410,6 +76654,10 @@ definitions: format: uint64 liquidTxHash: type: string + planetmintgo.dao.MsgConfirmRedeemClaimResponse: + type: object + planetmintgo.dao.MsgCreateRedeemClaimResponse: + type: object planetmintgo.dao.MsgDistributionRequestResponse: type: object planetmintgo.dao.MsgDistributionResultResponse: @@ -76426,6 +76674,8 @@ definitions: type: object planetmintgo.dao.MsgUpdateParamsResponse: type: object + planetmintgo.dao.MsgUpdateRedeemClaimResponse: + type: object planetmintgo.dao.Params: type: object properties: @@ -76463,7 +76713,57 @@ definitions: mqtt_response_timeout: type: string format: int64 + claim_address: + type: string description: Params defines the parameters for the module. + planetmintgo.dao.QueryAllRedeemClaimResponse: + type: object + properties: + redeemClaim: + type: array + items: + type: object + properties: + id: + type: string + format: uint64 + beneficiary: + type: string + liquidTxHash: + type: string + amount: + type: string + format: uint64 + confirmed: + type: boolean + creator: + type: string + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } planetmintgo.dao.QueryChallengesResponse: type: object properties: @@ -76587,6 +76887,26 @@ definitions: format: uint64 liquidTxHash: type: string + planetmintgo.dao.QueryGetRedeemClaimResponse: + type: object + properties: + redeemClaim: + type: object + properties: + id: + type: string + format: uint64 + beneficiary: + type: string + liquidTxHash: + type: string + amount: + type: string + format: uint64 + confirmed: + type: boolean + creator: + type: string planetmintgo.dao.QueryGetReissuanceResponse: type: object properties: @@ -76667,7 +76987,29 @@ definitions: mqtt_response_timeout: type: string format: int64 + claim_address: + type: string description: QueryParamsResponse is response type for the Query/Params RPC method. + planetmintgo.dao.QueryRedeemClaimByLiquidTxHashResponse: + type: object + properties: + redeemClaim: + type: object + properties: + id: + type: string + format: uint64 + beneficiary: + type: string + liquidTxHash: + type: string + amount: + type: string + format: uint64 + confirmed: + type: boolean + creator: + type: string planetmintgo.dao.QueryReissuancesResponse: type: object properties: @@ -76717,6 +77059,23 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + planetmintgo.dao.RedeemClaim: + type: object + properties: + id: + type: string + format: uint64 + beneficiary: + type: string + liquidTxHash: + type: string + amount: + type: string + format: uint64 + confirmed: + type: boolean + creator: + type: string planetmintgo.dao.Reissuance: type: object properties: diff --git a/go.mod b/go.mod index 9d1fc00..8d31b55 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( cosmossdk.io/api v0.3.1 cosmossdk.io/errors v1.0.0 cosmossdk.io/math v1.1.2 + cosmossdk.io/simapp v0.0.0-20230323161446-0af178d721ff github.com/btcsuite/btcd v0.23.2 github.com/btcsuite/btcd/btcutil v1.1.2 github.com/cometbft/cometbft v0.37.2 diff --git a/go.sum b/go.sum index 3cbbfa7..aecc387 100644 --- a/go.sum +++ b/go.sum @@ -199,6 +199,8 @@ cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk= cosmossdk.io/log v1.2.1/go.mod h1:GNSCc/6+DhFIj1aLn/j7Id7PaO8DzNylUZoOYBL9+I4= cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM= cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= +cosmossdk.io/simapp v0.0.0-20230323161446-0af178d721ff h1:P1ialzTepD1oxdNPYc5N8Eggq3RdejZq3cJs8YYMs9Y= +cosmossdk.io/simapp v0.0.0-20230323161446-0af178d721ff/go.mod h1:AKzx6Mb544LjJ9RHmGFHjY9rEOLiUAi8I0F727TR0dY= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= diff --git a/proto/planetmintgo/dao/genesis.proto b/proto/planetmintgo/dao/genesis.proto index 66aaa53..58a645a 100644 --- a/proto/planetmintgo/dao/genesis.proto +++ b/proto/planetmintgo/dao/genesis.proto @@ -1,12 +1,15 @@ syntax = "proto3"; + package planetmintgo.dao; import "gogoproto/gogo.proto"; import "planetmintgo/dao/params.proto"; +import "planetmintgo/dao/redeem_claim.proto"; option go_package = "github.com/planetmint/planetmint-go/x/dao/types"; // GenesisState defines the dao module's genesis state. message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; + Params params = 1 [(gogoproto.nullable) = false]; } + diff --git a/proto/planetmintgo/dao/params.proto b/proto/planetmintgo/dao/params.proto index 33261c3..8e25e36 100644 --- a/proto/planetmintgo/dao/params.proto +++ b/proto/planetmintgo/dao/params.proto @@ -10,18 +10,19 @@ message Params { option (gogoproto.goproto_stringer) = false; string mint_address = 1; - string token_denom =2; - string fee_denom =3; - string staged_denom =4; - string claim_denom =5; - string reissuance_asset =6; - int64 reissuance_epochs=7; - int64 pop_epochs =8; - int64 distribution_offset =9; + string token_denom = 2; + string fee_denom = 3; + string staged_denom = 4; + string claim_denom = 5; + string reissuance_asset = 6; + int64 reissuance_epochs = 7; + int64 pop_epochs = 8; + int64 distribution_offset = 9; string distribution_address_early_inv = 10; string distribution_address_investor = 11; string distribution_address_strategic = 12; string distribution_address_dao = 13; string distribution_address_pop = 14; int64 mqtt_response_timeout = 15; + string claim_address = 16; } diff --git a/proto/planetmintgo/dao/query.proto b/proto/planetmintgo/dao/query.proto index e40695c..262c554 100644 --- a/proto/planetmintgo/dao/query.proto +++ b/proto/planetmintgo/dao/query.proto @@ -12,6 +12,7 @@ import "planetmintgo/dao/reissuance.proto"; import "planetmintgo/dao/challenge.proto"; import "amino/amino.proto"; import "planetmintgo/dao/distribution_order.proto"; +import "planetmintgo/dao/redeem_claim.proto"; option go_package = "github.com/planetmint/planetmint-go/x/dao/types"; @@ -57,6 +58,7 @@ service Query { // Queries a list of Challenges items. rpc Challenges (QueryChallengesRequest) returns (QueryChallengesResponse) { option (google.api.http).get = "/planetmint/dao/challenges"; + } // Queries a list of GetDistribution items. @@ -64,6 +66,22 @@ service Query { option (google.api.http).get = "/planetmint/dao/distribution/{height}"; } + + // Queries a list of RedeemClaim items. + rpc RedeemClaim (QueryGetRedeemClaimRequest) returns (QueryGetRedeemClaimResponse) { + option (google.api.http).get = "/planetmint/dao/redeem_claim/{beneficiary}/{id}"; + + } + rpc RedeemClaimAll (QueryAllRedeemClaimRequest) returns (QueryAllRedeemClaimResponse) { + option (google.api.http).get = "/planetmint/dao/redeem_claim"; + + } + + // Queries a list of RedeemClaimByLiquidTxHash items. + rpc RedeemClaimByLiquidTxHash (QueryRedeemClaimByLiquidTxHashRequest) returns (QueryRedeemClaimByLiquidTxHashResponse) { + option (google.api.http).get = "/planetmint/dao/redeem_claim_by_liquid_tx_hash/{liquidTxHash}"; + + } } // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} @@ -104,11 +122,8 @@ message QueryReissuancesRequest { } message QueryReissuancesResponse { - repeated Reissuance reissuances = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated Reissuance reissuances = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } message QueryGetChallengeRequest { @@ -124,11 +139,8 @@ message QueryChallengesRequest { } message QueryChallengesResponse { - repeated Challenge challenges = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated Challenge challenges = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } message QueryGetDistributionRequest { @@ -139,3 +151,29 @@ message QueryGetDistributionResponse { DistributionOrder distribution = 1; } +message QueryGetRedeemClaimRequest { + string beneficiary = 1; + uint64 id = 2; +} + +message QueryGetRedeemClaimResponse { + RedeemClaim redeemClaim = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllRedeemClaimRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllRedeemClaimResponse { + repeated RedeemClaim redeemClaim = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryRedeemClaimByLiquidTxHashRequest { + string liquidTxHash = 1; +} + +message QueryRedeemClaimByLiquidTxHashResponse { + RedeemClaim redeemClaim = 1; +} + diff --git a/proto/planetmintgo/dao/redeem_claim.proto b/proto/planetmintgo/dao/redeem_claim.proto new file mode 100644 index 0000000..8ca721d --- /dev/null +++ b/proto/planetmintgo/dao/redeem_claim.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package planetmintgo.dao; + +option go_package = "github.com/planetmint/planetmint-go/x/dao/types"; + +message RedeemClaim { + uint64 id = 1; + string beneficiary = 2; + string liquidTxHash = 3; + uint64 amount = 4; + bool confirmed = 5; + string creator = 6; +} + diff --git a/proto/planetmintgo/dao/tx.proto b/proto/planetmintgo/dao/tx.proto index b7a8b7e..133664a 100644 --- a/proto/planetmintgo/dao/tx.proto +++ b/proto/planetmintgo/dao/tx.proto @@ -10,6 +10,7 @@ import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; +import "planetmintgo/dao/redeem_claim.proto"; option go_package = "github.com/planetmint/planetmint-go/x/dao/types"; @@ -23,6 +24,9 @@ service Msg { rpc UpdateParams (MsgUpdateParams ) returns (MsgUpdateParamsResponse ); rpc ReportPopResult (MsgReportPopResult ) returns (MsgReportPopResultResponse ); rpc InitPop (MsgInitPop ) returns (MsgInitPopResponse ); + rpc CreateRedeemClaim (MsgCreateRedeemClaim ) returns (MsgCreateRedeemClaimResponse ); + rpc UpdateRedeemClaim (MsgUpdateRedeemClaim ) returns (MsgUpdateRedeemClaimResponse ); + rpc ConfirmRedeemClaim (MsgConfirmRedeemClaim ) returns (MsgConfirmRedeemClaimResponse ); } message MsgReportPopResult { string creator = 1; @@ -101,3 +105,28 @@ message MsgInitPop { message MsgInitPopResponse {} +message MsgCreateRedeemClaim { + string creator = 1; + string beneficiary = 2; + uint64 amount = 3; +} + +message MsgCreateRedeemClaimResponse {} + +message MsgUpdateRedeemClaim { + string creator = 1; + uint64 id = 2; + string beneficiary = 3; + string liquidTxHash = 4; +} + +message MsgUpdateRedeemClaimResponse {} + +message MsgConfirmRedeemClaim { + string creator = 1; + uint64 id = 2; + string beneficiary = 3; +} + +message MsgConfirmRedeemClaimResponse {} + diff --git a/tests/e2e/dao/pop_participant_selection_suite.go b/tests/e2e/dao/pop_participant_selection_suite.go index d498660..14b3521 100644 --- a/tests/e2e/dao/pop_participant_selection_suite.go +++ b/tests/e2e/dao/pop_participant_selection_suite.go @@ -1,12 +1,17 @@ package dao import ( + "bufio" "fmt" "log" "math" + "os" "strconv" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + sdk "github.com/cosmos/cosmos-sdk/types" bank "github.com/cosmos/cosmos-sdk/x/bank/client/cli" + "github.com/planetmint/planetmint-go/lib" "github.com/planetmint/planetmint-go/testutil" clitestutil "github.com/planetmint/planetmint-go/testutil/cli" e2etestutil "github.com/planetmint/planetmint-go/testutil/e2e" @@ -44,6 +49,7 @@ type PopSelectionE2ETestSuite struct { popEpochs int64 reissuanceEpochs int64 distributionOffset int64 + claimDenom string } func NewPopSelectionE2ETestSuite(cfg network.Config) *PopSelectionE2ETestSuite { @@ -56,6 +62,11 @@ func (s *PopSelectionE2ETestSuite) SetupSuite() { s.popEpochs = 10 s.reissuanceEpochs = 60 s.distributionOffset = 2 + s.claimDenom = "crddl" + + s.cfg.Mnemonics = []string{sample.Mnemonic} + valAddr, err := s.createValAccount(s.cfg) + s.Require().NoError(err) var daoGenState daotypes.GenesisState s.cfg.Codec.MustUnmarshalJSON(s.cfg.GenesisState[daotypes.ModuleName], &daoGenState) @@ -64,6 +75,7 @@ func (s *PopSelectionE2ETestSuite) SetupSuite() { daoGenState.Params.DistributionOffset = s.distributionOffset daoGenState.Params.MqttResponseTimeout = 200 daoGenState.Params.FeeDenom = sample.FeeDenom + daoGenState.Params.ClaimAddress = valAddr.String() s.cfg.GenesisState[daotypes.ModuleName] = s.cfg.Codec.MustMarshalJSON(&daoGenState) s.network = network.New(s.T(), s.cfg) @@ -226,3 +238,90 @@ func (s *PopSelectionE2ETestSuite) TestTokenDistribution1() { s.VerifyTokens(daoGenState.Params.ClaimDenom) } + +func (s *PopSelectionE2ETestSuite) TestTokenRedeemClaim() { + val := s.network.Validators[0] + + k, err := val.ClientCtx.Keyring.Key(machines[0].name) + s.Require().NoError(err) + addr, _ := k.GetAddress() + + // Addr sends CreateRedeemClaim => accepted query redeem claim + createClaimMsg := daotypes.NewMsgCreateRedeemClaim(addr.String(), "liquidAddress", 10000) + out, err := lib.BroadcastTxWithFileLock(addr, createClaimMsg) + s.Require().NoError(err) + + txResponse, err := lib.GetTxResponseFromOut(out) + s.Require().NoError(err) + s.Require().Equal(int(0), int(txResponse.Code)) + + // WaitForBlock => Validator should implicitly send UpdateRedeemClaim + s.Require().NoError(s.network.WaitForNextBlock()) + + // Claim burned on CreateRedeemClaim + balanceOut, err := clitestutil.ExecTestCLICmd(val.ClientCtx, bank.GetBalancesCmd(), []string{ + addr.String(), + fmt.Sprintf("--%s=%s", bank.FlagDenom, s.claimDenom), + }) + s.Require().NoError(err) + assert.Equal(s.T(), "amount: \"5993140682\"\ndenom: crddl\n", balanceOut.String()) // 3 * 1997716894 - 10000 = 5993140682 + + // Addr sends ConfirmRedeemClaim => rejected not claim address + confirmMsg := daotypes.NewMsgConfirmRedeemClaim(addr.String(), 0, "liquidAddress") + out, err = lib.BroadcastTxWithFileLock(addr, confirmMsg) + s.Require().NoError(err) + + txResponse, err = lib.GetTxResponseFromOut(out) + s.Require().NoError(err) + s.Require().Equal(int(21), int(txResponse.Code)) + + // Validator with Claim Address sends ConfirmRedeemClaim => accepted + valConfirmMsg := daotypes.NewMsgConfirmRedeemClaim(val.Address.String(), 0, "liquidAddress") + out, err = lib.BroadcastTxWithFileLock(val.Address, valConfirmMsg) + s.Require().NoError(err) + + txResponse, err = lib.GetTxResponseFromOut(out) + s.Require().NoError(err) + s.Require().Equal(int(0), int(txResponse.Code)) + + // WaitForBlock before query + s.Require().NoError(s.network.WaitForNextBlock()) + + // QueryRedeemClaim + qOut, err := clitestutil.ExecTestCLICmd(val.ClientCtx, daocli.CmdShowRedeemClaim(), []string{"liquidAddress", "0"}) + s.Require().NoError(err) + assert.Equal(s.T(), "redeemClaim:\n amount: \"10000\"\n beneficiary: liquidAddress\n confirmed: true\n creator: plmnt1kp93kns6hs2066d8qw0uz84fw3vlthewt2ck6p\n id: \"0\"\n liquidTxHash: \"0000000000000000000000000000000000000000000000000000000000000000\"\n", qOut.String()) + + qOut, err = clitestutil.ExecTestCLICmd(val.ClientCtx, daocli.CmdRedeemClaimByLiquidTxHash(), []string{"0000000000000000000000000000000000000000000000000000000000000000"}) + s.Require().NoError(err) + assert.Equal(s.T(), "redeemClaim:\n amount: \"10000\"\n beneficiary: liquidAddress\n confirmed: true\n creator: plmnt1kp93kns6hs2066d8qw0uz84fw3vlthewt2ck6p\n id: \"0\"\n liquidTxHash: \"0000000000000000000000000000000000000000000000000000000000000000\"\n", qOut.String()) +} + +func (s *PopSelectionE2ETestSuite) createValAccount(cfg network.Config) (address sdk.AccAddress, err error) { + buf := bufio.NewReader(os.Stdin) + + kb, err := keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, s.T().TempDir(), buf, cfg.Codec, cfg.KeyringOptions...) + if err != nil { + return nil, err + } + + keyringAlgos, _ := kb.SupportedAlgorithms() + algo, err := keyring.NewSigningAlgoFromString(cfg.SigningAlgo, keyringAlgos) + if err != nil { + return nil, err + } + + mnemonic := cfg.Mnemonics[0] + + record, err := kb.NewAccount("node0", mnemonic, keyring.DefaultBIP39Passphrase, sdk.GetConfig().GetFullBIP44Path(), algo) + if err != nil { + return nil, err + } + + addr, err := record.GetAddress() + if err != nil { + return nil, err + } + + return addr, nil +} diff --git a/tests/e2e/dao/restricted_msgs_suite.go b/tests/e2e/dao/restricted_msgs_suite.go index a03e8b5..59c829b 100644 --- a/tests/e2e/dao/restricted_msgs_suite.go +++ b/tests/e2e/dao/restricted_msgs_suite.go @@ -17,6 +17,7 @@ var msgs = []sdk.Msg{ &daotypes.MsgDistributionResult{}, &daotypes.MsgReissueRDDLProposal{}, &daotypes.MsgReissueRDDLResult{}, + &daotypes.MsgUpdateRedeemClaim{}, &machinetypes.MsgRegisterTrustAnchor{}, &machinetypes.MsgNotarizeLiquidAsset{}, } @@ -109,6 +110,11 @@ func setCreator(msg sdk.Msg, creator string) sdk.Msg { if ok { msg.Creator = creator } + case "/planetmintgo.dao.MsgUpdateRedeemClaim": + msg, ok := msg.(*daotypes.MsgUpdateRedeemClaim) + if ok { + msg.Creator = creator + } case "/planetmintgo.machine.MsgNotarizeLiquidAsset": msg, ok := msg.(*machinetypes.MsgNotarizeLiquidAsset) if ok { diff --git a/tests/e2e/dao/suite.go b/tests/e2e/dao/suite.go index 9ec1048..8c4f75d 100644 --- a/tests/e2e/dao/suite.go +++ b/tests/e2e/dao/suite.go @@ -80,6 +80,7 @@ func (s *E2ETestSuite) SetupSuite() { daoGenState.Params.DistributionOffset = s.distributionOffset daoGenState.Params.ReissuanceEpochs = s.reissuanceEpochs daoGenState.Params.MintAddress = valAddr.String() + daoGenState.Params.ClaimAddress = valAddr.String() s.cfg.GenesisState[daotypes.ModuleName] = s.cfg.Codec.MustMarshalJSON(&daoGenState) bbalances := sdk.NewCoins( @@ -102,6 +103,12 @@ func (s *E2ETestSuite) SetupSuite() { s.cfg.MinGasPrices = fmt.Sprintf("0.000006%s", daoGenState.Params.FeeDenom) s.network = network.New(s.T(), s.cfg) + + // create account for redeem claim test case + account, err := e2etestutil.CreateAccount(s.network, sample.Name, sample.Mnemonic) + s.Require().NoError(err) + err = e2etestutil.FundAccount(s.network, account) + s.Require().NoError(err) } // TearDownSuite clean up after testing @@ -137,11 +144,9 @@ func (s *E2ETestSuite) TestMintToken() { s.Require().NoError(err) // send mint token request from non mint address - account, err := e2etestutil.CreateAccount(s.network, sample.Name, sample.Mnemonic) + k, err := val.ClientCtx.Keyring.Key(sample.Name) s.Require().NoError(err) - err = e2etestutil.FundAccount(s.network, account) - s.Require().NoError(err) - addr, _ := account.GetAddress() + addr, _ := k.GetAddress() msg1 = daotypes.NewMsgMintToken(addr.String(), &mintRequest) out, err = lib.BroadcastTxWithFileLock(addr, msg1) @@ -198,7 +203,7 @@ func (s *E2ETestSuite) TestReissuance() { // 1: block 26: sending the reissuance result broadcast tx succeeded // 2: block 27: confirmation wait = 2 - if latestHeight%(s.reissuanceEpochs+wait) == 0 { + if latestHeight%s.reissuanceEpochs == wait { break } } diff --git a/testutil/e2e/e2e.go b/testutil/e2e/e2e.go index 9840a10..0dd7eee 100644 --- a/testutil/e2e/e2e.go +++ b/testutil/e2e/e2e.go @@ -36,7 +36,7 @@ func FundAccount(network *network.Network, account *keyring.Record) (err error) } // sending funds to account to initialize account on chain - coin := sdk.NewCoins(sdk.NewInt64Coin("stake", 1000)) // TODO: make denom dependent on cfg + coin := sdk.NewCoins(sdk.NewInt64Coin("stake", 1000)) msg := banktypes.NewMsgSend(val.Address, addr, coin) out, err := lib.BroadcastTxWithFileLock(val.Address, msg) if err != nil { diff --git a/testutil/keeper/dao.go b/testutil/keeper/dao.go index 30f0763..15290c9 100644 --- a/testutil/keeper/dao.go +++ b/testutil/keeper/dao.go @@ -55,7 +55,9 @@ func DaoKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { bk := daotestutil.NewMockBankKeeper(ctrl) bk.EXPECT().MintCoins(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + bk.EXPECT().BurnCoins(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() bk.EXPECT().SendCoinsFromModuleToAccount(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + bk.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() k := keeper.NewKeeper( cdc, diff --git a/util/issue_commands.go b/util/issue_commands.go index d0c4edf..3fe51ee 100644 --- a/util/issue_commands.go +++ b/util/issue_commands.go @@ -91,3 +91,10 @@ func SendInitPoP(goCtx context.Context, proposer string, challenger string, chal loggingContext := "PoP" buildSignBroadcastTx(goCtx, loggingContext, sendingValidatorAddress, msg) } + +func SendUpdateRedeemClaim(goCtx context.Context, beneficiary string, id uint64, txID string) { + sendingValidatorAddress := config.GetConfig().ValidatorAddress + msg := daotypes.NewMsgUpdateRedeemClaim(sendingValidatorAddress, beneficiary, txID, id) + loggingContext := "redeem claim" + buildSignBroadcastTx(goCtx, loggingContext, sendingValidatorAddress, msg) +} diff --git a/x/dao/client/cli/query.go b/x/dao/client/cli/query.go index 462a11d..a874ea0 100644 --- a/x/dao/client/cli/query.go +++ b/x/dao/client/cli/query.go @@ -35,6 +35,10 @@ func GetQueryCmd(_ string) *cobra.Command { cmd.AddCommand(CmdGetDistribution()) + cmd.AddCommand(CmdListRedeemClaim()) + cmd.AddCommand(CmdShowRedeemClaim()) + cmd.AddCommand(CmdRedeemClaimByLiquidTxHash()) + // this line is used by starport scaffolding # 1 return cmd diff --git a/x/dao/client/cli/query_redeem_claim.go b/x/dao/client/cli/query_redeem_claim.go new file mode 100644 index 0000000..1c8b0b0 --- /dev/null +++ b/x/dao/client/cli/query_redeem_claim.go @@ -0,0 +1,121 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/planetmint/planetmint-go/x/dao/types" +) + +func CmdListRedeemClaim() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-redeem-claim", + Short: "list all redeem-claim", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllRedeemClaimRequest{ + Pagination: pageReq, + } + + res, err := queryClient.RedeemClaimAll(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowRedeemClaim() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-redeem-claim [beneficiary] [id]", + Short: "shows a redeem-claim", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + argBeneficiary := args[0] + argID, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + + params := &types.QueryGetRedeemClaimRequest{ + Beneficiary: argBeneficiary, + Id: argID, + } + + res, err := queryClient.RedeemClaim(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +var _ = strconv.Itoa(0) + +func CmdRedeemClaimByLiquidTxHash() *cobra.Command { + cmd := &cobra.Command{ + Use: "redeem-claim-by-liquid-tx-hash [liquid-tx-hash]", + Short: "Query redeem-claim-by-liquid-tx-hash", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + reqLiquidTxHash := args[0] + + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryRedeemClaimByLiquidTxHashRequest{ + + LiquidTxHash: reqLiquidTxHash, + } + + res, err := queryClient.RedeemClaimByLiquidTxHash(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/dao/client/cli/tx.go b/x/dao/client/cli/tx.go index 2fa9fcc..e4d8322 100644 --- a/x/dao/client/cli/tx.go +++ b/x/dao/client/cli/tx.go @@ -33,6 +33,9 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdDistributionRequest()) cmd.AddCommand(CmdUpdateParams()) cmd.AddCommand(CmdInitPop()) + cmd.AddCommand(CmdCreateRedeemClaim()) + cmd.AddCommand(CmdUpdateRedeemClaim()) + cmd.AddCommand(CmdConfirmRedeemClaim()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/dao/client/cli/tx_confirm_redeem_claim.go b/x/dao/client/cli/tx_confirm_redeem_claim.go new file mode 100644 index 0000000..af69d81 --- /dev/null +++ b/x/dao/client/cli/tx_confirm_redeem_claim.go @@ -0,0 +1,48 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/planetmint/planetmint-go/x/dao/types" + "github.com/spf13/cast" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdConfirmRedeemClaim() *cobra.Command { + cmd := &cobra.Command{ + Use: "confirm-redeem-claim [id] [beneficiary]", + Short: "Broadcast message confirm-redeem-claim", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argID, err := cast.ToUint64E(args[0]) + if err != nil { + return err + } + argBeneficiary := args[1] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgConfirmRedeemClaim( + clientCtx.GetFromAddress().String(), + argID, + argBeneficiary, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/dao/client/cli/tx_redeem_claim.go b/x/dao/client/cli/tx_redeem_claim.go new file mode 100644 index 0000000..793e638 --- /dev/null +++ b/x/dao/client/cli/tx_redeem_claim.go @@ -0,0 +1,87 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/planetmint/planetmint-go/x/dao/types" + "github.com/spf13/cobra" +) + +func CmdCreateRedeemClaim() *cobra.Command { + cmd := &cobra.Command{ + Use: "create-redeem-claim [beneficiary] [amount]", + Short: "Create a new redeem-claim", + Args: cobra.ExactArgs(4), + RunE: func(cmd *cobra.Command, args []string) (err error) { + // Get indexes + indexBeneficiary := args[0] + + // Get value arguments + argAmount, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgCreateRedeemClaim( + clientCtx.GetFromAddress().String(), + indexBeneficiary, + argAmount, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +func CmdUpdateRedeemClaim() *cobra.Command { + cmd := &cobra.Command{ + Use: "update-redeem-claim [beneficiary] [id] [liquid-tx-hash]", + Short: "Update a redeem-claim", + Args: cobra.ExactArgs(4), + RunE: func(cmd *cobra.Command, args []string) (err error) { + // Get indexes + indexBeneficiary := args[0] + indexID, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + + // Get value arguments + argLiquidTxHash := args[2] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgUpdateRedeemClaim( + clientCtx.GetFromAddress().String(), + indexBeneficiary, + argLiquidTxHash, + indexID, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/dao/genesis_test.go b/x/dao/genesis_test.go index 4a201fb..a54afb7 100644 --- a/x/dao/genesis_test.go +++ b/x/dao/genesis_test.go @@ -14,7 +14,6 @@ func TestGenesis(t *testing.T) { t.Parallel() genesisState := types.GenesisState{ Params: types.DefaultParams(), - // this line is used by starport scaffolding # genesis/test/state } diff --git a/x/dao/keeper/msg_server_redeem_claim.go b/x/dao/keeper/msg_server_redeem_claim.go new file mode 100644 index 0000000..5d225a6 --- /dev/null +++ b/x/dao/keeper/msg_server_redeem_claim.go @@ -0,0 +1,113 @@ +package keeper + +import ( + "context" + "fmt" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/planetmint/planetmint-go/util" + "github.com/planetmint/planetmint-go/x/dao/types" +) + +var ( + createRedeemClaimTag = "create redeem claim: " +) + +func (k msgServer) CreateRedeemClaim(goCtx context.Context, msg *types.MsgCreateRedeemClaim) (*types.MsgCreateRedeemClaimResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + params := k.GetParams(ctx) + + var redeemClaim = types.RedeemClaim{ + Creator: msg.Creator, + Beneficiary: msg.Beneficiary, + Amount: msg.Amount, + } + + err := k.burnClaimAmount(ctx, sdk.MustAccAddressFromBech32(msg.Creator), msg.Amount) + if err != nil { + util.GetAppLogger().Error(ctx, createRedeemClaimTag+"could not burn claim") + } + + id := k.CreateNewRedeemClaim( + ctx, + redeemClaim, + ) + + if util.IsValidatorBlockProposer(ctx, ctx.BlockHeader().ProposerAddress) { + util.GetAppLogger().Info(ctx, fmt.Sprintf("Issuing RDDL claim: %s/%d", msg.Beneficiary, id)) + txID, err := util.DistributeAsset(msg.Beneficiary, util.UintValueToRDDLTokenString(msg.Amount), params.ReissuanceAsset) + if err != nil { + util.GetAppLogger().Error(ctx, createRedeemClaimTag+"could not issue claim to beneficiary: "+msg.GetBeneficiary()) + } + util.SendUpdateRedeemClaim(goCtx, msg.Beneficiary, id, txID) + } + + return &types.MsgCreateRedeemClaimResponse{}, nil +} + +func (k msgServer) UpdateRedeemClaim(goCtx context.Context, msg *types.MsgUpdateRedeemClaim) (*types.MsgUpdateRedeemClaimResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + valFound, isFound := k.GetRedeemClaim( + ctx, + msg.Beneficiary, + msg.Id, + ) + if !isFound { + return nil, errorsmod.Wrap(sdkerrors.ErrKeyNotFound, "index not set") + } + + var redeemClaim = types.RedeemClaim{ + Creator: valFound.Creator, + Beneficiary: msg.Beneficiary, + LiquidTxHash: msg.LiquidTxHash, + Amount: valFound.Amount, + Id: valFound.Id, + } + + k.SetRedeemClaim(ctx, redeemClaim) + + return &types.MsgUpdateRedeemClaimResponse{}, nil +} + +func (k msgServer) ConfirmRedeemClaim(goCtx context.Context, msg *types.MsgConfirmRedeemClaim) (*types.MsgConfirmRedeemClaimResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + valFound, isFound := k.GetRedeemClaim( + ctx, + msg.Beneficiary, + msg.Id, + ) + if !isFound { + return nil, errorsmod.Wrap(sdkerrors.ErrKeyNotFound, "index not set") + } + + var redeemClaim = types.RedeemClaim{ + Creator: valFound.Creator, + Beneficiary: msg.Beneficiary, + LiquidTxHash: valFound.LiquidTxHash, + Amount: valFound.Amount, + Id: valFound.Id, + Confirmed: true, + } + + k.SetRedeemClaim(ctx, redeemClaim) + + return &types.MsgConfirmRedeemClaimResponse{}, nil +} + +func (k msgServer) burnClaimAmount(ctx sdk.Context, addr sdk.AccAddress, amount uint64) (err error) { + params := k.GetParams(ctx) + burnCoins := sdk.NewCoins(sdk.NewCoin(params.ClaimDenom, sdk.NewIntFromUint64(amount))) + err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, addr, types.ModuleName, burnCoins) + if err != nil { + return err + } + err = k.bankKeeper.BurnCoins(ctx, types.ModuleName, burnCoins) + if err != nil { + return err + } + return +} diff --git a/x/dao/keeper/msg_server_redeem_claim_test.go b/x/dao/keeper/msg_server_redeem_claim_test.go new file mode 100644 index 0000000..659e6c3 --- /dev/null +++ b/x/dao/keeper/msg_server_redeem_claim_test.go @@ -0,0 +1,93 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" + + keepertest "github.com/planetmint/planetmint-go/testutil/keeper" + "github.com/planetmint/planetmint-go/testutil/sample" + "github.com/planetmint/planetmint-go/x/dao/keeper" + "github.com/planetmint/planetmint-go/x/dao/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestRedeemClaimMsgServerCreate(t *testing.T) { + t.Parallel() + k, ctx := keepertest.DaoKeeper(t) + srv := keeper.NewMsgServerImpl(*k) + wctx := sdk.WrapSDKContext(ctx) + creator := sample.ConstBech32Addr + for i := 0; i < 5; i++ { + expected := &types.MsgCreateRedeemClaim{Creator: creator, + Beneficiary: strconv.Itoa(i), + } + _, err := srv.CreateRedeemClaim(wctx, expected) + require.NoError(t, err) + rst, found := k.GetRedeemClaim(ctx, + expected.Beneficiary, + uint64(0), + ) + require.True(t, found) + require.Equal(t, expected.Creator, rst.Creator) + } +} + +func TestRedeemClaimMsgServerUpdate(t *testing.T) { + t.Parallel() + creator := sample.ConstBech32Addr + + tests := []struct { + desc string + request *types.MsgUpdateRedeemClaim + err error + }{ + { + desc: "Completed", + request: &types.MsgUpdateRedeemClaim{Creator: creator, + Beneficiary: strconv.Itoa(0), + LiquidTxHash: strconv.Itoa(0), + }, + }, + { + desc: "KeyNotFound", + request: &types.MsgUpdateRedeemClaim{Creator: creator, + Beneficiary: strconv.Itoa(100000), + LiquidTxHash: strconv.Itoa(100000), + }, + err: sdkerrors.ErrKeyNotFound, + }, + } + for _, tc := range tests { + tc := tc + t.Run(tc.desc, func(t *testing.T) { + t.Parallel() + k, ctx := keepertest.DaoKeeper(t) + srv := keeper.NewMsgServerImpl(*k) + wctx := sdk.WrapSDKContext(ctx) + expected := &types.MsgCreateRedeemClaim{Creator: creator, + Beneficiary: strconv.Itoa(0), + } + _, err := srv.CreateRedeemClaim(wctx, expected) + require.NoError(t, err) + + _, err = srv.UpdateRedeemClaim(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + rst, found := k.GetRedeemClaim(ctx, + expected.Beneficiary, + uint64(0), + ) + require.True(t, found) + require.Equal(t, expected.Creator, rst.Creator) + } + }) + } +} diff --git a/x/dao/keeper/params.go b/x/dao/keeper/params.go index 40c8511..14ab6c3 100644 --- a/x/dao/keeper/params.go +++ b/x/dao/keeper/params.go @@ -34,3 +34,7 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { func (k Keeper) GetMintAddress(ctx sdk.Context) (mintAddress string) { return k.GetParams(ctx).MintAddress } + +func (k Keeper) GetClaimAddress(ctx sdk.Context) (claimAddress string) { + return k.GetParams(ctx).ClaimAddress +} diff --git a/x/dao/keeper/query_redeem_claim.go b/x/dao/keeper/query_redeem_claim.go new file mode 100644 index 0000000..157b3e1 --- /dev/null +++ b/x/dao/keeper/query_redeem_claim.go @@ -0,0 +1,76 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/planetmint/planetmint-go/x/dao/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) RedeemClaimAll(goCtx context.Context, req *types.QueryAllRedeemClaimRequest) (*types.QueryAllRedeemClaimResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var redeemClaims []types.RedeemClaim + ctx := sdk.UnwrapSDKContext(goCtx) + + store := ctx.KVStore(k.storeKey) + redeemClaimStore := prefix.NewStore(store, types.KeyPrefix(types.RedeemClaimKeyPrefix)) + + pageRes, err := query.Paginate(redeemClaimStore, req.Pagination, func(key []byte, value []byte) error { + var redeemClaim types.RedeemClaim + if err := k.cdc.Unmarshal(value, &redeemClaim); err != nil { + return err + } + + redeemClaims = append(redeemClaims, redeemClaim) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllRedeemClaimResponse{RedeemClaim: redeemClaims, Pagination: pageRes}, nil +} + +func (k Keeper) RedeemClaim(goCtx context.Context, req *types.QueryGetRedeemClaimRequest) (*types.QueryGetRedeemClaimResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetRedeemClaim( + ctx, + req.Beneficiary, + req.Id, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetRedeemClaimResponse{RedeemClaim: val}, nil +} + +func (k Keeper) RedeemClaimByLiquidTxHash(goCtx context.Context, req *types.QueryRedeemClaimByLiquidTxHashRequest) (*types.QueryRedeemClaimByLiquidTxHashResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetRedeemClaimByLiquidTXHash( + ctx, + req.LiquidTxHash, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryRedeemClaimByLiquidTxHashResponse{RedeemClaim: &val}, nil +} diff --git a/x/dao/keeper/query_redeem_claim_test.go b/x/dao/keeper/query_redeem_claim_test.go new file mode 100644 index 0000000..f5118fa --- /dev/null +++ b/x/dao/keeper/query_redeem_claim_test.go @@ -0,0 +1,130 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/planetmint/planetmint-go/testutil/keeper" + "github.com/planetmint/planetmint-go/testutil/nullify" + "github.com/planetmint/planetmint-go/x/dao/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestRedeemClaimQuerySingle(t *testing.T) { + keeper, ctx := keepertest.DaoKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNRedeemClaim(keeper, ctx, 2) + tests := []struct { + desc string + request *types.QueryGetRedeemClaimRequest + response *types.QueryGetRedeemClaimResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetRedeemClaimRequest{ + Beneficiary: msgs[0].Beneficiary, + Id: msgs[0].Id, + }, + response: &types.QueryGetRedeemClaimResponse{RedeemClaim: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetRedeemClaimRequest{ + Beneficiary: msgs[1].Beneficiary, + Id: msgs[1].Id, + }, + response: &types.QueryGetRedeemClaimResponse{RedeemClaim: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetRedeemClaimRequest{ + Beneficiary: strconv.Itoa(100000), + Id: uint64(100000), + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.RedeemClaim(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +func TestRedeemClaimQueryPaginated(t *testing.T) { + keeper, ctx := keepertest.DaoKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNRedeemClaim(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllRedeemClaimRequest { + return &types.QueryAllRedeemClaimRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.RedeemClaimAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.RedeemClaim), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.RedeemClaim), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.RedeemClaimAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.RedeemClaim), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.RedeemClaim), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.RedeemClaimAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(msgs), + nullify.Fill(resp.RedeemClaim), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.RedeemClaimAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/dao/keeper/redeem_claim.go b/x/dao/keeper/redeem_claim.go new file mode 100644 index 0000000..2b8f2d6 --- /dev/null +++ b/x/dao/keeper/redeem_claim.go @@ -0,0 +1,118 @@ +package keeper + +import ( + "encoding/binary" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/planetmint/planetmint-go/x/dao/types" +) + +// GetBeneficiaryRedeemClaimCount get the total number of RedeemClaim for a beneficiary +func (k Keeper) GetBeneficiaryRedeemClaimCount(ctx sdk.Context, beneficiary string) uint64 { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RedeemClaimBeneficiaryCountKeyPrefix)) + byteKey := types.KeyPrefix(beneficiary) + bz := store.Get(byteKey) + + // Count doesn't exist: no element + if bz == nil { + return 0 + } + + // Parse bytes + return binary.BigEndian.Uint64(bz) +} + +// SetBeneficiaryRedeemClaimCount set the total number of RedeemClaim for beneficiary +func (k Keeper) SetBeneficiaryRedeemClaimCount(ctx sdk.Context, beneficiary string, count uint64) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RedeemClaimBeneficiaryCountKeyPrefix)) + byteKey := types.KeyPrefix(beneficiary) + bz := make([]byte, 8) + binary.BigEndian.PutUint64(bz, count) + store.Set(byteKey, bz) +} + +// SetRedeemClaim set a specific redeemClaim in the store from its index +func (k Keeper) SetRedeemClaim(ctx sdk.Context, redeemClaim types.RedeemClaim) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RedeemClaimKeyPrefix)) + b := k.cdc.MustMarshal(&redeemClaim) + + if redeemClaim.LiquidTxHash != "" { + k.SetRedeemClaimByLiquidTXHash(ctx, redeemClaim) + } + + store.Set(types.RedeemClaimKey( + redeemClaim.Beneficiary, + redeemClaim.Id, + ), b) +} + +// SetRedeemClaimByLiquidTXHash set a specific redeemClaim in the store from its index +func (k Keeper) SetRedeemClaimByLiquidTXHash(ctx sdk.Context, redeemClaim types.RedeemClaim) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RedeemClaimLiquidTXKeyPrefix)) + b := k.cdc.MustMarshal(&redeemClaim) + byteKey := types.KeyPrefix(redeemClaim.LiquidTxHash) + store.Set(byteKey, b) +} + +// GetRedeemClaimByLiquidTXHash returns a redeemClaim from its index +func (k Keeper) GetRedeemClaimByLiquidTXHash(ctx sdk.Context, liquidTXHash string) (val types.RedeemClaim, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RedeemClaimLiquidTXKeyPrefix)) + b := store.Get(types.KeyPrefix(liquidTXHash)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// CreateNewRedeemClaim creates a specific redeemClaim in the store from its index +func (k Keeper) CreateNewRedeemClaim(ctx sdk.Context, redeemClaim types.RedeemClaim) uint64 { + count := k.GetBeneficiaryRedeemClaimCount(ctx, redeemClaim.Beneficiary) + + redeemClaim.Id = count + k.SetRedeemClaim(ctx, redeemClaim) + + // Update BeneficiaryRedeemCount + k.SetBeneficiaryRedeemClaimCount(ctx, redeemClaim.Beneficiary, count+1) + + return count +} + +// GetRedeemClaim returns a redeemClaim from its index +func (k Keeper) GetRedeemClaim( + ctx sdk.Context, + beneficiary string, + id uint64, + +) (val types.RedeemClaim, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RedeemClaimKeyPrefix)) + + b := store.Get(types.RedeemClaimKey( + beneficiary, + id, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// GetAllRedeemClaim returns all redeemClaim +func (k Keeper) GetAllRedeemClaim(ctx sdk.Context) (list []types.RedeemClaim) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RedeemClaimKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.RedeemClaim + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/dao/keeper/redeem_claim_test.go b/x/dao/keeper/redeem_claim_test.go new file mode 100644 index 0000000..e93f0fb --- /dev/null +++ b/x/dao/keeper/redeem_claim_test.go @@ -0,0 +1,66 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + keepertest "github.com/planetmint/planetmint-go/testutil/keeper" + "github.com/planetmint/planetmint-go/testutil/nullify" + "github.com/planetmint/planetmint-go/x/dao/keeper" + "github.com/planetmint/planetmint-go/x/dao/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNRedeemClaim(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.RedeemClaim { + items := make([]types.RedeemClaim, n) + for i := range items { + items[i].Beneficiary = strconv.Itoa(i) + id := keeper.CreateNewRedeemClaim(ctx, items[i]) + items[i].Id = id + } + return items +} + +func TestRedeemClaimGet(t *testing.T) { + t.Parallel() + keeper, ctx := keepertest.DaoKeeper(t) + items := createNRedeemClaim(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetRedeemClaim(ctx, + item.Beneficiary, + item.Id, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) + } +} + +func TestRedeemClaimGetAll(t *testing.T) { + t.Parallel() + keeper, ctx := keepertest.DaoKeeper(t) + items := createNRedeemClaim(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllRedeemClaim(ctx)), + ) +} + +func TestRedeemClaimByLiquidTXHash(t *testing.T) { + t.Parallel() + keeper, ctx := keepertest.DaoKeeper(t) + items := createNRedeemClaim(keeper, ctx, 10) + for i, item := range items { + item.LiquidTxHash = strconv.Itoa(i) + keeper.SetRedeemClaimByLiquidTXHash(ctx, item) + rc, found := keeper.GetRedeemClaimByLiquidTXHash(ctx, strconv.Itoa(i)) + require.True(t, found) + require.Equal(t, item, rc) + } +} diff --git a/x/dao/module_simulation.go b/x/dao/module_simulation.go index 931744d..ef53808 100644 --- a/x/dao/module_simulation.go +++ b/x/dao/module_simulation.go @@ -39,6 +39,22 @@ const ( // TODO: Determine the simulation weight value defaultWeightMsgInitPop int = 100 + opWeightMsgCreateRedeemClaim = "op_weight_msg_redeem_claim" + // TODO: Determine the simulation weight value + defaultWeightMsgCreateRedeemClaim int = 100 + + opWeightMsgUpdateRedeemClaim = "op_weight_msg_redeem_claim" + // TODO: Determine the simulation weight value + defaultWeightMsgUpdateRedeemClaim int = 100 + + opWeightMsgDeleteRedeemClaim = "op_weight_msg_redeem_claim" + // TODO: Determine the simulation weight value + defaultWeightMsgDeleteRedeemClaim int = 100 + + opWeightMsgConfirmRedeemClaim = "op_weight_msg_confirm_redeem_claim" + // TODO: Determine the simulation weight value + defaultWeightMsgConfirmRedeemClaim int = 100 + // this line is used by starport scaffolding # simapp/module/const ) @@ -111,6 +127,46 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp daosimulation.SimulateMsgInitPop(am.accountKeeper, am.bankKeeper, am.keeper), )) + var weightMsgCreateRedeemClaim int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgCreateRedeemClaim, &weightMsgCreateRedeemClaim, nil, + func(_ *rand.Rand) { + weightMsgCreateRedeemClaim = defaultWeightMsgCreateRedeemClaim + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgCreateRedeemClaim, + daosimulation.SimulateMsgCreateRedeemClaim(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgUpdateRedeemClaim int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUpdateRedeemClaim, &weightMsgUpdateRedeemClaim, nil, + func(_ *rand.Rand) { + weightMsgUpdateRedeemClaim = defaultWeightMsgUpdateRedeemClaim + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgUpdateRedeemClaim, + daosimulation.SimulateMsgUpdateRedeemClaim(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgDeleteRedeemClaim int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgDeleteRedeemClaim, &weightMsgDeleteRedeemClaim, nil, + func(_ *rand.Rand) { + weightMsgDeleteRedeemClaim = defaultWeightMsgDeleteRedeemClaim + }, + ) + + var weightMsgConfirmRedeemClaim int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgConfirmRedeemClaim, &weightMsgConfirmRedeemClaim, nil, + func(_ *rand.Rand) { + weightMsgConfirmRedeemClaim = defaultWeightMsgConfirmRedeemClaim + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgConfirmRedeemClaim, + daosimulation.SimulateMsgConfirmRedeemClaim(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations @@ -151,6 +207,30 @@ func (am AppModule) ProposalMsgs(_ module.SimulationState) []simtypes.WeightedPr return nil }, ), + simulation.NewWeightedProposalMsg( + opWeightMsgCreateRedeemClaim, + defaultWeightMsgCreateRedeemClaim, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + daosimulation.SimulateMsgCreateRedeemClaim(am.accountKeeper, am.bankKeeper, am.keeper) + return nil + }, + ), + simulation.NewWeightedProposalMsg( + opWeightMsgUpdateRedeemClaim, + defaultWeightMsgUpdateRedeemClaim, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + daosimulation.SimulateMsgUpdateRedeemClaim(am.accountKeeper, am.bankKeeper, am.keeper) + return nil + }, + ), + simulation.NewWeightedProposalMsg( + opWeightMsgConfirmRedeemClaim, + defaultWeightMsgConfirmRedeemClaim, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + daosimulation.SimulateMsgConfirmRedeemClaim(am.accountKeeper, am.bankKeeper, am.keeper) + return nil + }, + ), // this line is used by starport scaffolding # simapp/module/OpMsg } } diff --git a/x/dao/simulation/confirm_redeem_claim.go b/x/dao/simulation/confirm_redeem_claim.go new file mode 100644 index 0000000..d18e0fc --- /dev/null +++ b/x/dao/simulation/confirm_redeem_claim.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/planetmint/planetmint-go/x/dao/keeper" + "github.com/planetmint/planetmint-go/x/dao/types" +) + +func SimulateMsgConfirmRedeemClaim( + _ types.AccountKeeper, + _ types.BankKeeper, + _ keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgConfirmRedeemClaim{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the ConfirmRedeemClaim simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "ConfirmRedeemClaim simulation not implemented"), nil, nil + } +} diff --git a/x/dao/simulation/redeem_claim.go b/x/dao/simulation/redeem_claim.go new file mode 100644 index 0000000..fa50dc0 --- /dev/null +++ b/x/dao/simulation/redeem_claim.go @@ -0,0 +1,102 @@ +package simulation + +import ( + "math/rand" + "strconv" + + simappparams "cosmossdk.io/simapp/params" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + "github.com/planetmint/planetmint-go/x/dao/keeper" + "github.com/planetmint/planetmint-go/x/dao/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func SimulateMsgCreateRedeemClaim( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + + i := r.Int() + msg := &types.MsgCreateRedeemClaim{ + Creator: simAccount.Address.String(), + Beneficiary: strconv.Itoa(i), + } + + _, found := k.GetRedeemClaim(ctx, msg.Beneficiary, uint64(i)) + if found { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "RedeemClaim already exist"), nil, nil + } + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: simappparams.MakeTestEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: simAccount, + ModuleName: types.ModuleName, + CoinsSpentInMsg: sdk.NewCoins(), + AccountKeeper: ak, + Bankkeeper: bk, + } + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + +func SimulateMsgUpdateRedeemClaim( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + var ( + simAccount = simtypes.Account{} + redeemClaim = types.RedeemClaim{} + msg = &types.MsgUpdateRedeemClaim{} + allRedeemClaim = k.GetAllRedeemClaim(ctx) + found = false + ) + for _, obj := range allRedeemClaim { + simAccount, found = FindAccount(accs, obj.Creator) + if found { + redeemClaim = obj + break + } + } + if !found { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "redeemClaim creator not found"), nil, nil + } + msg.Creator = simAccount.Address.String() + + msg.Beneficiary = redeemClaim.Beneficiary + msg.LiquidTxHash = redeemClaim.LiquidTxHash + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: simappparams.MakeTestEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: simAccount, + ModuleName: types.ModuleName, + CoinsSpentInMsg: sdk.NewCoins(), + AccountKeeper: ak, + Bankkeeper: bk, + } + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} diff --git a/x/dao/types/codec.go b/x/dao/types/codec.go index c632e79..539b0b5 100644 --- a/x/dao/types/codec.go +++ b/x/dao/types/codec.go @@ -16,6 +16,9 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgDistributionRequest{}, "dao/DistributionRequest", nil) cdc.RegisterConcrete(&MsgUpdateParams{}, "dao/UpdateParams", nil) cdc.RegisterConcrete(&MsgInitPop{}, "dao/InitPop", nil) + cdc.RegisterConcrete(&MsgCreateRedeemClaim{}, "dao/CreateRedeemClaim", nil) + cdc.RegisterConcrete(&MsgUpdateRedeemClaim{}, "dao/UpdateRedeemClaim", nil) + cdc.RegisterConcrete(&MsgConfirmRedeemClaim{}, "dao/ConfirmRedeemClaim", nil) // this line is used by starport scaffolding # 2 } @@ -36,6 +39,13 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgInitPop{}, ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgCreateRedeemClaim{}, + &MsgUpdateRedeemClaim{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgConfirmRedeemClaim{}, + ) // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/dao/types/errors.go b/x/dao/types/errors.go index 6d952f8..6bb3341 100644 --- a/x/dao/types/errors.go +++ b/x/dao/types/errors.go @@ -27,4 +27,5 @@ var ( ErrRestrictedMsg = errorsmod.Register(ModuleName, 18, "restricted validator msg") ErrDistributionWrongHeight = errorsmod.Register(ModuleName, 19, "distribution wrong height") ErrConvertClaims = errorsmod.Register(ModuleName, 20, "convert claim failed") + ErrInvalidClaimAddress = errorsmod.Register(ModuleName, 21, "invalid claim address") ) diff --git a/x/dao/types/genesis.go b/x/dao/types/genesis.go index 0af9b44..f2689b7 100644 --- a/x/dao/types/genesis.go +++ b/x/dao/types/genesis.go @@ -1,9 +1,5 @@ package types -import ( -// this line is used by starport scaffolding # genesis/types/import -) - // DefaultIndex is the default global index const DefaultIndex uint64 = 1 diff --git a/x/dao/types/genesis.pb.go b/x/dao/types/genesis.pb.go index 7686f0f..b9ecf1f 100644 --- a/x/dao/types/genesis.pb.go +++ b/x/dao/types/genesis.pb.go @@ -75,19 +75,21 @@ func init() { func init() { proto.RegisterFile("planetmintgo/dao/genesis.proto", fileDescriptor_cae3132315bdc9f8) } var fileDescriptor_cae3132315bdc9f8 = []byte{ - // 192 bytes of a gzipped FileDescriptorProto + // 211 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0xc8, 0x49, 0xcc, 0x4b, 0x2d, 0xc9, 0xcd, 0xcc, 0x2b, 0x49, 0xcf, 0xd7, 0x4f, 0x49, 0xcc, 0xd7, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x40, 0x96, 0xd7, 0x4b, 0x49, 0xcc, 0x97, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xea, 0x83, 0x58, 0x10, 0x75, 0x52, - 0xb2, 0x18, 0xe6, 0x14, 0x24, 0x16, 0x25, 0xe6, 0x42, 0x8d, 0x51, 0x72, 0xe3, 0xe2, 0x71, 0x87, - 0x98, 0x1b, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xc6, 0xc5, 0x06, 0x91, 0x97, 0x60, 0x54, 0x60, - 0xd4, 0xe0, 0x36, 0x92, 0xd0, 0x43, 0xb7, 0x47, 0x2f, 0x00, 0x2c, 0xef, 0xc4, 0x72, 0xe2, 0x9e, - 0x3c, 0x43, 0x10, 0x54, 0xb5, 0x93, 0xe7, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, - 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, - 0x44, 0xe9, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x23, 0xcc, 0x42, - 0x62, 0xea, 0xa6, 0xe7, 0xeb, 0x57, 0x80, 0x5d, 0x56, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, - 0x76, 0x99, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x23, 0x6c, 0x19, 0x02, 0x01, 0x00, 0x00, + 0xb2, 0x18, 0xe6, 0x14, 0x24, 0x16, 0x25, 0xe6, 0x42, 0x8d, 0x91, 0x52, 0xc6, 0x90, 0x2e, 0x4a, + 0x4d, 0x49, 0x4d, 0xcd, 0x8d, 0x4f, 0xce, 0x49, 0xcc, 0xcc, 0x85, 0x28, 0x52, 0x72, 0xe3, 0xe2, + 0x71, 0x87, 0x58, 0x1e, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xc6, 0xc5, 0x06, 0x31, 0x44, 0x82, + 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x42, 0x0f, 0xdd, 0x31, 0x7a, 0x01, 0x60, 0x79, 0x27, 0x96, + 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xa0, 0xaa, 0x9d, 0x3c, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, + 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, + 0x58, 0x8e, 0x21, 0x4a, 0x3f, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, + 0x61, 0x16, 0x12, 0x53, 0x37, 0x3d, 0x5f, 0xbf, 0x02, 0xec, 0xbe, 0x92, 0xca, 0x82, 0xd4, 0xe2, + 0x24, 0x36, 0xb0, 0xcb, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x88, 0xef, 0x33, 0x4d, 0x27, + 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/dao/types/genesis_test.go b/x/dao/types/genesis_test.go index 4769cfc..2bb904c 100644 --- a/x/dao/types/genesis_test.go +++ b/x/dao/types/genesis_test.go @@ -22,7 +22,6 @@ func TestGenesisState_Validate(t *testing.T) { { desc: "valid genesis state", genState: &types.GenesisState{ - // this line is used by starport scaffolding # types/genesis/validField }, valid: true, diff --git a/x/dao/types/key_redeem_claim.go b/x/dao/types/key_redeem_claim.go new file mode 100644 index 0000000..1f5d082 --- /dev/null +++ b/x/dao/types/key_redeem_claim.go @@ -0,0 +1,45 @@ +package types + +import ( + "encoding/binary" +) + +var _ binary.ByteOrder + +const ( + // RedeemClaimKeyPrefix is the prefix to retrieve all RedeemClaim + RedeemClaimKeyPrefix = "RedeemClaim/value/" + RedeemClaimBeneficiaryCountKeyPrefix = "RedeemClaim/beneficiary/count/" + RedeemClaimLiquidTXKeyPrefix = "RedeemClaim/liquidTX/value/" +) + +// RedeemClaimKey returns the store key to retrieve a RedeemClaim from the index fields +func RedeemClaimKey( + beneficiary string, + id uint64, +) []byte { + var key []byte + + beneficiaryBytes := []byte(beneficiary) + key = append(key, beneficiaryBytes...) + key = append(key, []byte("/")...) + + idBytes := SerializeUint64(id) + key = append(key, idBytes...) + key = append(key, []byte("/")...) + + return key +} + +func SerializeUint64(value uint64) []byte { + buf := make([]byte, 8) + // Adding 1 because 0 will be interpreted as nil, which is an invalid key + binary.BigEndian.PutUint64(buf, value+1) + return buf +} + +func DeserializeUint64(value []byte) uint64 { + integer := binary.BigEndian.Uint64(value) + // Subtract 1 because addition in serialization + return integer - 1 +} diff --git a/x/dao/types/messages_redeem_claim.go b/x/dao/types/messages_redeem_claim.go new file mode 100644 index 0000000..78e8527 --- /dev/null +++ b/x/dao/types/messages_redeem_claim.go @@ -0,0 +1,142 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const ( + TypeMsgCreateRedeemClaim = "create_redeem_claim" + TypeMsgUpdateRedeemClaim = "update_redeem_claim" + TypeMsgConfirmRedeemClaim = "confirm_redeem_claim" +) + +var _ sdk.Msg = &MsgCreateRedeemClaim{} + +func NewMsgCreateRedeemClaim( + creator string, + beneficiary string, + amount uint64, + +) *MsgCreateRedeemClaim { + return &MsgCreateRedeemClaim{ + Creator: creator, + Beneficiary: beneficiary, + Amount: amount, + } +} + +func (msg *MsgCreateRedeemClaim) Route() string { + return RouterKey +} + +func (msg *MsgCreateRedeemClaim) Type() string { + return TypeMsgCreateRedeemClaim +} + +func (msg *MsgCreateRedeemClaim) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgCreateRedeemClaim) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgCreateRedeemClaim) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + return nil +} + +var _ sdk.Msg = &MsgUpdateRedeemClaim{} + +func NewMsgUpdateRedeemClaim( + creator string, + beneficiary string, + liquidTxHash string, + id uint64, + +) *MsgUpdateRedeemClaim { + return &MsgUpdateRedeemClaim{ + Creator: creator, + Beneficiary: beneficiary, + LiquidTxHash: liquidTxHash, + Id: id, + } +} + +func (msg *MsgUpdateRedeemClaim) Route() string { + return RouterKey +} + +func (msg *MsgUpdateRedeemClaim) Type() string { + return TypeMsgUpdateRedeemClaim +} + +func (msg *MsgUpdateRedeemClaim) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgUpdateRedeemClaim) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgUpdateRedeemClaim) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + return nil +} + +var _ sdk.Msg = &MsgConfirmRedeemClaim{} + +func NewMsgConfirmRedeemClaim(creator string, id uint64, beneficiary string) *MsgConfirmRedeemClaim { + return &MsgConfirmRedeemClaim{ + Creator: creator, + Id: id, + Beneficiary: beneficiary, + } +} + +func (msg *MsgConfirmRedeemClaim) Route() string { + return RouterKey +} + +func (msg *MsgConfirmRedeemClaim) Type() string { + return TypeMsgConfirmRedeemClaim +} + +func (msg *MsgConfirmRedeemClaim) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgConfirmRedeemClaim) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgConfirmRedeemClaim) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + return nil +} diff --git a/x/dao/types/messages_redeem_claim_test.go b/x/dao/types/messages_redeem_claim_test.go new file mode 100644 index 0000000..fd3b5ca --- /dev/null +++ b/x/dao/types/messages_redeem_claim_test.go @@ -0,0 +1,95 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgCreateRedeemClaim_ValidateBasic(t *testing.T) { + t.Parallel() + tests := []struct { + name string + msg MsgCreateRedeemClaim + err error + }{ + { + name: "invalid address", + msg: MsgCreateRedeemClaim{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, + } + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} + +func TestMsgUpdateRedeemClaim_ValidateBasic(t *testing.T) { + t.Parallel() + tests := []struct { + name string + msg MsgUpdateRedeemClaim + err error + }{ + { + name: "invalid address", + msg: MsgUpdateRedeemClaim{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, + } + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} + +func TestMsgConfirmRedeemClaim_ValidateBasic(t *testing.T) { + t.Parallel() + tests := []struct { + name string + msg MsgConfirmRedeemClaim + err error + }{ + { + name: "invalid address", + msg: MsgConfirmRedeemClaim{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, + } + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/dao/types/params.go b/x/dao/types/params.go index 4c56dc5..ef34e8b 100644 --- a/x/dao/types/params.go +++ b/x/dao/types/params.go @@ -17,7 +17,7 @@ func NewParams(mintAddress string, tokenDenom string, feeDenom string, stagedDen claimDenom string, reissuanceAsset string, reissuanceEpochs int64, popEpochs int64, distributionOffset int64, distributionAddressEarlyInv string, distributionAddressInvestor string, distributionAddressStrategic string, distributionAddressDao string, distributionAddressPop string, - mqttResponseTimeout int64) Params { + mqttResponseTimeout int64, claimAddress string) Params { return Params{ MintAddress: mintAddress, TokenDenom: tokenDenom, @@ -41,6 +41,7 @@ func NewParams(mintAddress string, tokenDenom string, feeDenom string, stagedDen DistributionAddressDao: distributionAddressDao, DistributionAddressPop: distributionAddressPop, MqttResponseTimeout: mqttResponseTimeout, + ClaimAddress: claimAddress, } } @@ -61,7 +62,8 @@ func DefaultParams() Params { "vjTyRN2G42Yq3T5TJBecHj1dF1xdhKF89hKV4HJN3uXxUbaVGVR76hAfVRQqQCovWaEpar7G5qBBprFG", "vjU8eMzU3JbUWZEpVANt2ePJuPWSPixgjiSj2jDMvkVVQQi2DDnZuBRVX4Ygt5YGBf5zvTWCr1ntdqYH", "vjTvXCFSReRsZ7grdsAreRR12KuKpDw8idueQJK9Yh1BYS7ggAqgvCxCgwh13KGK6M52y37HUmvr4GdD", - 2000) + 2000, + "plmnt1dyuhg8ldu3d6nvhrvzzemtc3893dys9v9lvdty") } // ParamSetPairs get the params.ParamSet diff --git a/x/dao/types/params.pb.go b/x/dao/types/params.pb.go index b802109..b3fc00b 100644 --- a/x/dao/types/params.pb.go +++ b/x/dao/types/params.pb.go @@ -40,6 +40,7 @@ type Params struct { DistributionAddressDao string `protobuf:"bytes,13,opt,name=distribution_address_dao,json=distributionAddressDao,proto3" json:"distribution_address_dao,omitempty"` DistributionAddressPop string `protobuf:"bytes,14,opt,name=distribution_address_pop,json=distributionAddressPop,proto3" json:"distribution_address_pop,omitempty"` MqttResponseTimeout int64 `protobuf:"varint,15,opt,name=mqtt_response_timeout,json=mqttResponseTimeout,proto3" json:"mqtt_response_timeout,omitempty"` + ClaimAddress string `protobuf:"bytes,16,opt,name=claim_address,json=claimAddress,proto3" json:"claim_address,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -179,6 +180,13 @@ func (m *Params) GetMqttResponseTimeout() int64 { return 0 } +func (m *Params) GetClaimAddress() string { + if m != nil { + return m.ClaimAddress + } + return "" +} + func init() { proto.RegisterType((*Params)(nil), "planetmintgo.dao.Params") } @@ -186,37 +194,38 @@ func init() { func init() { proto.RegisterFile("planetmintgo/dao/params.proto", fileDescriptor_a58575036b3ad531) } var fileDescriptor_a58575036b3ad531 = []byte{ - // 466 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0x31, 0x6f, 0x13, 0x31, - 0x14, 0xc7, 0x73, 0xb4, 0x0d, 0xcd, 0x4b, 0xa0, 0xc5, 0x05, 0x64, 0x51, 0x72, 0x69, 0x99, 0x8a, - 0x10, 0x39, 0x09, 0x16, 0xc4, 0xd6, 0x92, 0x0e, 0x99, 0xa8, 0x02, 0x13, 0xcb, 0xc9, 0xc9, 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, 0xf4, 0x63, 0x15, 0x37, 0xae, - 0x57, 0x71, 0xe3, 0xef, 0x2a, 0x6e, 0x7c, 0x49, 0x72, 0xe9, 0x2e, 0xe7, 0xe3, 0xfe, 0x84, 0x8a, - 0xe4, 0x76, 0x43, 0x6a, 0xc7, 0xd7, 0x39, 0x25, 0xdf, 0xfd, 0x3a, 0xb9, 0x2b, 0x8d, 0x76, 0xdc, - 0xf4, 0x6b, 0xf2, 0xf6, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x69, 0x6a, 0x2e, 0x26, 0x6f, 0x03, - 0x00, 0x00, + // 483 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0xb1, 0x6e, 0x13, 0x4d, + 0x14, 0x85, 0xbd, 0x7f, 0x12, 0xff, 0xf1, 0xd8, 0x21, 0x66, 0x02, 0x68, 0x44, 0xf0, 0x3a, 0x81, + 0x26, 0x08, 0xe1, 0x95, 0xa0, 0x41, 0x74, 0x09, 0x4e, 0xe1, 0x8a, 0xc8, 0x50, 0xd1, 0xac, 0xc6, + 0xbb, 0xd7, 0x9b, 0x11, 0xde, 0xb9, 0xc3, 0xce, 0xd8, 0x22, 0x6f, 0x41, 0x49, 0xc9, 0xe3, 0x50, + 0xa6, 0xa4, 0x44, 0xf6, 0x43, 0xd0, 0xa2, 0xbd, 0xb3, 0x56, 0x16, 0xc9, 0xee, 0x46, 0xe7, 0x7c, + 0xe7, 0xdc, 0xd1, 0x68, 0x2e, 0xeb, 0x99, 0x99, 0xd4, 0xe0, 0x72, 0xa5, 0x5d, 0x86, 0x51, 0x2a, + 0x31, 0x32, 0xb2, 0x90, 0xb9, 0x1d, 0x98, 0x02, 0x1d, 0xf2, 0x6e, 0xdd, 0x1e, 0xa4, 0x12, 0x1f, + 0x3f, 0xc8, 0x30, 0x43, 0x32, 0xa3, 0xf2, 0xe4, 0xb9, 0xa7, 0x7f, 0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Marshal() (dAtA []byte, err error) { @@ -239,6 +248,15 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ClaimAddress) > 0 { + i -= len(m.ClaimAddress) + copy(dAtA[i:], m.ClaimAddress) + i = encodeVarintParams(dAtA, i, uint64(len(m.ClaimAddress))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } if m.MqttResponseTimeout != 0 { i = encodeVarintParams(dAtA, i, uint64(m.MqttResponseTimeout)) i-- @@ -412,6 +430,10 @@ func (m *Params) Size() (n int) { if m.MqttResponseTimeout != 0 { n += 1 + sovParams(uint64(m.MqttResponseTimeout)) } + l = len(m.ClaimAddress) + if l > 0 { + n += 2 + l + sovParams(uint64(l)) + } return n } @@ -878,6 +900,38 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClaimAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/dao/types/query.pb.go b/x/dao/types/query.pb.go index f7cc6ea..8e8e191 100644 --- a/x/dao/types/query.pb.go +++ b/x/dao/types/query.pb.go @@ -746,6 +746,288 @@ func (m *QueryGetDistributionResponse) GetDistribution() *DistributionOrder { return nil } +type QueryGetRedeemClaimRequest struct { + Beneficiary string `protobuf:"bytes,1,opt,name=beneficiary,proto3" json:"beneficiary,omitempty"` + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryGetRedeemClaimRequest) Reset() { *m = QueryGetRedeemClaimRequest{} } +func (m *QueryGetRedeemClaimRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetRedeemClaimRequest) ProtoMessage() {} +func (*QueryGetRedeemClaimRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_07bad0eeb5b27724, []int{16} +} +func (m *QueryGetRedeemClaimRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRedeemClaimRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRedeemClaimRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetRedeemClaimRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRedeemClaimRequest.Merge(m, src) +} +func (m *QueryGetRedeemClaimRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRedeemClaimRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRedeemClaimRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRedeemClaimRequest proto.InternalMessageInfo + +func (m *QueryGetRedeemClaimRequest) GetBeneficiary() string { + if m != nil { + return m.Beneficiary + } + return "" +} + +func (m *QueryGetRedeemClaimRequest) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +type QueryGetRedeemClaimResponse struct { + RedeemClaim RedeemClaim `protobuf:"bytes,1,opt,name=redeemClaim,proto3" json:"redeemClaim"` +} + +func (m *QueryGetRedeemClaimResponse) Reset() { *m = QueryGetRedeemClaimResponse{} } +func (m *QueryGetRedeemClaimResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetRedeemClaimResponse) ProtoMessage() {} +func (*QueryGetRedeemClaimResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_07bad0eeb5b27724, []int{17} +} +func (m *QueryGetRedeemClaimResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRedeemClaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRedeemClaimResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetRedeemClaimResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRedeemClaimResponse.Merge(m, src) +} +func (m *QueryGetRedeemClaimResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRedeemClaimResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRedeemClaimResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRedeemClaimResponse proto.InternalMessageInfo + +func (m *QueryGetRedeemClaimResponse) GetRedeemClaim() RedeemClaim { + if m != nil { + return m.RedeemClaim + } + return RedeemClaim{} +} + +type QueryAllRedeemClaimRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRedeemClaimRequest) Reset() { *m = QueryAllRedeemClaimRequest{} } +func (m *QueryAllRedeemClaimRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllRedeemClaimRequest) ProtoMessage() {} +func (*QueryAllRedeemClaimRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_07bad0eeb5b27724, []int{18} +} +func (m *QueryAllRedeemClaimRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRedeemClaimRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRedeemClaimRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllRedeemClaimRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRedeemClaimRequest.Merge(m, src) +} +func (m *QueryAllRedeemClaimRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRedeemClaimRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRedeemClaimRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRedeemClaimRequest proto.InternalMessageInfo + +func (m *QueryAllRedeemClaimRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllRedeemClaimResponse struct { + RedeemClaim []RedeemClaim `protobuf:"bytes,1,rep,name=redeemClaim,proto3" json:"redeemClaim"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRedeemClaimResponse) Reset() { *m = QueryAllRedeemClaimResponse{} } +func (m *QueryAllRedeemClaimResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllRedeemClaimResponse) ProtoMessage() {} +func (*QueryAllRedeemClaimResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_07bad0eeb5b27724, []int{19} +} +func (m *QueryAllRedeemClaimResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRedeemClaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRedeemClaimResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllRedeemClaimResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRedeemClaimResponse.Merge(m, src) +} +func (m *QueryAllRedeemClaimResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRedeemClaimResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRedeemClaimResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRedeemClaimResponse proto.InternalMessageInfo + +func (m *QueryAllRedeemClaimResponse) GetRedeemClaim() []RedeemClaim { + if m != nil { + return m.RedeemClaim + } + return nil +} + +func (m *QueryAllRedeemClaimResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryRedeemClaimByLiquidTxHashRequest struct { + LiquidTxHash string `protobuf:"bytes,1,opt,name=liquidTxHash,proto3" json:"liquidTxHash,omitempty"` +} + +func (m *QueryRedeemClaimByLiquidTxHashRequest) Reset() { *m = QueryRedeemClaimByLiquidTxHashRequest{} } +func (m *QueryRedeemClaimByLiquidTxHashRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRedeemClaimByLiquidTxHashRequest) ProtoMessage() {} +func (*QueryRedeemClaimByLiquidTxHashRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_07bad0eeb5b27724, []int{20} +} +func (m *QueryRedeemClaimByLiquidTxHashRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRedeemClaimByLiquidTxHashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRedeemClaimByLiquidTxHashRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryRedeemClaimByLiquidTxHashRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRedeemClaimByLiquidTxHashRequest.Merge(m, src) +} +func (m *QueryRedeemClaimByLiquidTxHashRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRedeemClaimByLiquidTxHashRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRedeemClaimByLiquidTxHashRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRedeemClaimByLiquidTxHashRequest proto.InternalMessageInfo + +func (m *QueryRedeemClaimByLiquidTxHashRequest) GetLiquidTxHash() string { + if m != nil { + return m.LiquidTxHash + } + return "" +} + +type QueryRedeemClaimByLiquidTxHashResponse struct { + RedeemClaim *RedeemClaim `protobuf:"bytes,1,opt,name=redeemClaim,proto3" json:"redeemClaim,omitempty"` +} + +func (m *QueryRedeemClaimByLiquidTxHashResponse) Reset() { + *m = QueryRedeemClaimByLiquidTxHashResponse{} +} +func (m *QueryRedeemClaimByLiquidTxHashResponse) String() string { return proto.CompactTextString(m) } +func (*QueryRedeemClaimByLiquidTxHashResponse) ProtoMessage() {} +func (*QueryRedeemClaimByLiquidTxHashResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_07bad0eeb5b27724, []int{21} +} +func (m *QueryRedeemClaimByLiquidTxHashResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRedeemClaimByLiquidTxHashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRedeemClaimByLiquidTxHashResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryRedeemClaimByLiquidTxHashResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRedeemClaimByLiquidTxHashResponse.Merge(m, src) +} +func (m *QueryRedeemClaimByLiquidTxHashResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryRedeemClaimByLiquidTxHashResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRedeemClaimByLiquidTxHashResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRedeemClaimByLiquidTxHashResponse proto.InternalMessageInfo + +func (m *QueryRedeemClaimByLiquidTxHashResponse) GetRedeemClaim() *RedeemClaim { + if m != nil { + return m.RedeemClaim + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "planetmintgo.dao.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "planetmintgo.dao.QueryParamsResponse") @@ -763,72 +1045,93 @@ func init() { proto.RegisterType((*QueryChallengesResponse)(nil), "planetmintgo.dao.QueryChallengesResponse") proto.RegisterType((*QueryGetDistributionRequest)(nil), "planetmintgo.dao.QueryGetDistributionRequest") proto.RegisterType((*QueryGetDistributionResponse)(nil), "planetmintgo.dao.QueryGetDistributionResponse") + proto.RegisterType((*QueryGetRedeemClaimRequest)(nil), "planetmintgo.dao.QueryGetRedeemClaimRequest") + proto.RegisterType((*QueryGetRedeemClaimResponse)(nil), "planetmintgo.dao.QueryGetRedeemClaimResponse") + proto.RegisterType((*QueryAllRedeemClaimRequest)(nil), "planetmintgo.dao.QueryAllRedeemClaimRequest") + proto.RegisterType((*QueryAllRedeemClaimResponse)(nil), "planetmintgo.dao.QueryAllRedeemClaimResponse") + proto.RegisterType((*QueryRedeemClaimByLiquidTxHashRequest)(nil), "planetmintgo.dao.QueryRedeemClaimByLiquidTxHashRequest") + proto.RegisterType((*QueryRedeemClaimByLiquidTxHashResponse)(nil), "planetmintgo.dao.QueryRedeemClaimByLiquidTxHashResponse") } func init() { proto.RegisterFile("planetmintgo/dao/query.proto", fileDescriptor_07bad0eeb5b27724) } var fileDescriptor_07bad0eeb5b27724 = []byte{ - // 954 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0xb3, 0x6d, 0x09, 0xca, 0x73, 0x10, 0x30, 0xb4, 0xc1, 0x6c, 0x1c, 0x93, 0x4e, 0x52, - 0x9a, 0x38, 0x64, 0x87, 0xa4, 0x40, 0x85, 0x44, 0x85, 0x30, 0xa8, 0x69, 0x0f, 0x15, 0x65, 0x0f, - 0x1c, 0x7a, 0x29, 0x63, 0x7b, 0xb4, 0xbb, 0xc2, 0xde, 0x71, 0x77, 0xd6, 0x88, 0x28, 0xca, 0x05, - 0x89, 0x03, 0x37, 0xa4, 0x5e, 0x91, 0xb8, 0x22, 0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 0x67, 0x94, - 0x94, 0xf9, 0x50, 0x46, 0x3d, 0x11, 0xa5, 0x52, 0x7a, 0x19, 0xc8, 0xa7, 0x49, 0x3b, 0xee, 0xeb, - 0x12, 0xdd, 0x94, 0x8f, 0xde, 0x83, 0x57, 0x26, 0xde, 0xaa, 0xa1, 0x0c, 0x95, 0x20, 0xef, 0xc2, - 0x72, 0xda, 0x8a, 0xba, 0xb5, 0x69, 0xed, 0xd4, 0x0e, 0xeb, 0xce, 0xf4, 0xe6, 0x38, 0x69, 0x44, - 0xfb, 0xd2, 0x93, 0x3f, 0x5f, 0x5f, 0x72, 0x51, 0x4d, 0x6f, 0xc2, 0x55, 0x9d, 0xee, 0x48, 0xc4, - 0xf7, 0x82, 0x30, 0xc6, 0x55, 0x54, 0xfb, 0xf8, 0x0e, 0x57, 0x3e, 0x3e, 0x11, 0x02, 0x97, 0x7c, - 0xae, 0x7c, 0x9d, 0x7a, 0xc5, 0xd5, 0x63, 0x2a, 0x80, 0x56, 0x05, 0x22, 0xd6, 0x07, 0x50, 0x1b, - 0xe4, 0xb3, 0xc8, 0xb6, 0x51, 0x64, 0x33, 0x52, 0xb8, 0x66, 0x04, 0xbd, 0x85, 0x7c, 0x93, 0x6b, - 0x7c, 0xd8, 0xeb, 0x45, 0x42, 0x65, 0x3d, 0x21, 0x75, 0x78, 0x9e, 0xa7, 0x6f, 0x10, 0x31, 0x7b, - 0xa4, 0x3e, 0x52, 0x96, 0x84, 0x23, 0x65, 0x1b, 0x56, 0x8d, 0x35, 0xb3, 0x16, 0x36, 0x2b, 0x31, - 0x95, 0x3b, 0x11, 0x43, 0x6f, 0xc1, 0x6b, 0x59, 0x3f, 0xdc, 0xf1, 0x97, 0x92, 0x01, 0x6e, 0x42, - 0xad, 0xd3, 0x97, 0xdd, 0x2f, 0xee, 0x88, 0xc0, 0xf3, 0xd3, 0x36, 0x5c, 0x74, 0xcd, 0x57, 0xf4, - 0x01, 0xd8, 0xb3, 0xc2, 0x11, 0xf0, 0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, - 0xc8, 0x63, 0x0b, 0x56, 0x4d, 0x93, 0x24, 0xad, 0xf2, 0xe2, 0xa7, 0xdd, 0xd7, 0xde, 0x5b, 0x48, - 0x8b, 0x38, 0x2d, 0x8d, 0xb3, 0x4d, 0xe8, 0x34, 0xce, 0xd8, 0x98, 0xd8, 0x89, 0x8f, 0x1d, 0xfa, - 0xc6, 0x02, 0xc8, 0xfd, 0x8f, 0xec, 0x94, 0xac, 0x53, 0x70, 0x61, 0x7b, 0x77, 0x01, 0x25, 0xf2, - 0x50, 0xcd, 0xd3, 0x20, 0x76, 0x29, 0x8f, 0x22, 0x3f, 0x58, 0xf0, 0xe2, 0x94, 0x49, 0x91, 0xfd, - 0xf2, 0xa2, 0x67, 0x78, 0xa0, 0xed, 0x2c, 0x2a, 0x47, 0xac, 0x7d, 0x8d, 0x75, 0x9d, 0x5c, 0x9b, - 0xc6, 0x32, 0x8d, 0x6d, 0xdc, 0xa9, 0xf6, 0xdd, 0x27, 0x67, 0x4d, 0xeb, 0xe9, 0x59, 0xd3, 0xfa, - 0xfb, 0xac, 0x69, 0x7d, 0x77, 0xde, 0x5c, 0x7a, 0x7a, 0xde, 0x5c, 0xfa, 0xe3, 0xbc, 0xb9, 0xf4, - 0x80, 0x79, 0x41, 0xec, 0x8f, 0x3a, 0x4e, 0x57, 0x0e, 0xcc, 0x54, 0xf9, 0x70, 0xdf, 0x93, 0xec, - 0x2b, 0x9d, 0x3a, 0x3e, 0x1e, 0x0a, 0xd5, 0x59, 0xd6, 0xff, 0x65, 0x6f, 0xfc, 0x17, 0x00, 0x00, - 0xff, 0xff, 0x93, 0x15, 0x35, 0x23, 0x4a, 0x0c, 0x00, 0x00, + // 1198 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xc0, 0xb3, 0x69, 0x08, 0xca, 0x4b, 0x5a, 0x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 0xa6, 0xfe, + 0xd1, 0xb1, 0xdc, 0x02, 0x29, 0xcc, 0x59, 0xd2, 0x32, 0x9e, 0x6b, 0x62, 0x8d, 0x9a, 0x70, 0x7d, + 0x94, 0xb1, 0xb8, 0x2d, 0x9e, 0xf5, 0x4c, 0x13, 0x09, 0xd8, 0xf9, 0xf7, 0x22, 0x3c, 0x23, 0x7c, + 0x91, 0x36, 0x4c, 0x87, 0x8d, 0x9d, 0xac, 0xa6, 0xf5, 0xd3, 0xf3, 0x83, 0xba, 0x36, 0x42, 0x2a, + 0x24, 0xa4, 0xc5, 0x2f, 0x7e, 0xfb, 0xfb, 0xf1, 0xe4, 0x02, 0x99, 0xd7, 0x62, 0x71, 0x69, 0x2a, + 0x23, 0xbf, 0x28, 0x70, 0x65, 0x68, 0xeb, 0x27, 0x37, 0x33, 0x1c, 0xe4, 0x4d, 0x18, 0xea, 0x6b, + 0x67, 0x53, 0x42, 0xc8, 0x6d, 0x01, 0xb9, 0x49, 0x36, 0x06, 0x21, 0x13, 0x63, 0x9f, 0x16, 0xcc, + 0x2b, 0x5a, 0x37, 0xf8, 0xdb, 0x23, 0xbf, 0x2a, 0x70, 0x65, 0xe8, 0x30, 0x90, 0xc9, 0x9d, 0x37, + 0x79, 0x64, 0x72, 0xe7, 0xce, 0x1b, 0x74, 0x57, 0x70, 0x6f, 0x13, 0x2d, 0x9f, 0x1b, 0x87, 0x18, + 0xad, 0x8b, 0x1f, 0x3d, 0xf2, 0x8d, 0x02, 0x17, 0x13, 0x13, 0x02, 0xd9, 0xcc, 0x4e, 0x5c, 0x6a, + 0x0c, 0x51, 0x5f, 0x19, 0x4f, 0x18, 0x29, 0x5f, 0x15, 0x94, 0x25, 0xb2, 0x3e, 0x48, 0x19, 0x37, + 0x64, 0xad, 0x2b, 0xcd, 0x30, 0x3d, 0xf2, 0x95, 0x02, 0xb3, 0xd2, 0x00, 0x40, 0x36, 0x32, 0xfc, + 0xa5, 0x07, 0x11, 0xb5, 0x34, 0x8e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0x61, 0x3f, 0xad, + 0xfa, 0xc7, 0xd5, 0xb0, 0x68, 0xcb, 0xfd, 0xb5, 0x77, 0x70, 0xff, 0xc9, 0x49, 0x51, 0x79, 0x7a, + 0x52, 0x54, 0xfe, 0x3a, 0x29, 0x2a, 0x5f, 0x9f, 0x16, 0x27, 0x9e, 0x9e, 0x16, 0x27, 0xfe, 0x38, + 0x2d, 0x4e, 0x3c, 0xd2, 0x0c, 0xd3, 0x6f, 0xb4, 0x6b, 0xe5, 0xba, 0xd3, 0x94, 0x5d, 0xc4, 0x9f, + 0x5b, 0x86, 0xa3, 0x1d, 0x0b, 0x97, 0x7e, 0xa7, 0xc5, 0xbd, 0xda, 0xb4, 0xf8, 0x1f, 0xfb, 0xe6, + 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x28, 0x3e, 0x68, 0x3b, 0x07, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -859,6 +1162,11 @@ type QueryClient interface { Challenges(ctx context.Context, in *QueryChallengesRequest, opts ...grpc.CallOption) (*QueryChallengesResponse, error) // Queries a list of GetDistribution items. GetDistribution(ctx context.Context, in *QueryGetDistributionRequest, opts ...grpc.CallOption) (*QueryGetDistributionResponse, error) + // Queries a list of RedeemClaim items. + RedeemClaim(ctx context.Context, in *QueryGetRedeemClaimRequest, opts ...grpc.CallOption) (*QueryGetRedeemClaimResponse, error) + RedeemClaimAll(ctx context.Context, in *QueryAllRedeemClaimRequest, opts ...grpc.CallOption) (*QueryAllRedeemClaimResponse, error) + // Queries a list of RedeemClaimByLiquidTxHash items. + RedeemClaimByLiquidTxHash(ctx context.Context, in *QueryRedeemClaimByLiquidTxHashRequest, opts ...grpc.CallOption) (*QueryRedeemClaimByLiquidTxHashResponse, error) } type queryClient struct { @@ -941,6 +1249,33 @@ func (c *queryClient) GetDistribution(ctx context.Context, in *QueryGetDistribut return out, nil } +func (c *queryClient) RedeemClaim(ctx context.Context, in *QueryGetRedeemClaimRequest, opts ...grpc.CallOption) (*QueryGetRedeemClaimResponse, error) { + out := new(QueryGetRedeemClaimResponse) + err := c.cc.Invoke(ctx, "/planetmintgo.dao.Query/RedeemClaim", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RedeemClaimAll(ctx context.Context, in *QueryAllRedeemClaimRequest, opts ...grpc.CallOption) (*QueryAllRedeemClaimResponse, error) { + out := new(QueryAllRedeemClaimResponse) + err := c.cc.Invoke(ctx, "/planetmintgo.dao.Query/RedeemClaimAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RedeemClaimByLiquidTxHash(ctx context.Context, in *QueryRedeemClaimByLiquidTxHashRequest, opts ...grpc.CallOption) (*QueryRedeemClaimByLiquidTxHashResponse, error) { + out := new(QueryRedeemClaimByLiquidTxHashResponse) + err := c.cc.Invoke(ctx, "/planetmintgo.dao.Query/RedeemClaimByLiquidTxHash", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -959,6 +1294,11 @@ type QueryServer interface { Challenges(context.Context, *QueryChallengesRequest) (*QueryChallengesResponse, error) // Queries a list of GetDistribution items. GetDistribution(context.Context, *QueryGetDistributionRequest) (*QueryGetDistributionResponse, error) + // Queries a list of RedeemClaim items. + RedeemClaim(context.Context, *QueryGetRedeemClaimRequest) (*QueryGetRedeemClaimResponse, error) + RedeemClaimAll(context.Context, *QueryAllRedeemClaimRequest) (*QueryAllRedeemClaimResponse, error) + // Queries a list of RedeemClaimByLiquidTxHash items. + RedeemClaimByLiquidTxHash(context.Context, *QueryRedeemClaimByLiquidTxHashRequest) (*QueryRedeemClaimByLiquidTxHashResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -989,6 +1329,15 @@ func (*UnimplementedQueryServer) Challenges(ctx context.Context, req *QueryChall func (*UnimplementedQueryServer) GetDistribution(ctx context.Context, req *QueryGetDistributionRequest) (*QueryGetDistributionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetDistribution not implemented") } +func (*UnimplementedQueryServer) RedeemClaim(ctx context.Context, req *QueryGetRedeemClaimRequest) (*QueryGetRedeemClaimResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RedeemClaim not implemented") +} +func (*UnimplementedQueryServer) RedeemClaimAll(ctx context.Context, req *QueryAllRedeemClaimRequest) (*QueryAllRedeemClaimResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RedeemClaimAll not implemented") +} +func (*UnimplementedQueryServer) RedeemClaimByLiquidTxHash(ctx context.Context, req *QueryRedeemClaimByLiquidTxHashRequest) (*QueryRedeemClaimByLiquidTxHashResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RedeemClaimByLiquidTxHash not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1138,6 +1487,60 @@ func _Query_GetDistribution_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Query_RedeemClaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetRedeemClaimRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RedeemClaim(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/planetmintgo.dao.Query/RedeemClaim", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RedeemClaim(ctx, req.(*QueryGetRedeemClaimRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RedeemClaimAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllRedeemClaimRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RedeemClaimAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/planetmintgo.dao.Query/RedeemClaimAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RedeemClaimAll(ctx, req.(*QueryAllRedeemClaimRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RedeemClaimByLiquidTxHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRedeemClaimByLiquidTxHashRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RedeemClaimByLiquidTxHash(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/planetmintgo.dao.Query/RedeemClaimByLiquidTxHash", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RedeemClaimByLiquidTxHash(ctx, req.(*QueryRedeemClaimByLiquidTxHashRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "planetmintgo.dao.Query", HandlerType: (*QueryServer)(nil), @@ -1174,6 +1577,18 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "GetDistribution", Handler: _Query_GetDistribution_Handler, }, + { + MethodName: "RedeemClaim", + Handler: _Query_RedeemClaim_Handler, + }, + { + MethodName: "RedeemClaimAll", + Handler: _Query_RedeemClaimAll_Handler, + }, + { + MethodName: "RedeemClaimByLiquidTxHash", + Handler: _Query_RedeemClaimByLiquidTxHash_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "planetmintgo/dao/query.proto", @@ -1722,6 +2137,223 @@ func (m *QueryGetDistributionResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *QueryGetRedeemClaimRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetRedeemClaimRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRedeemClaimRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x10 + } + if len(m.Beneficiary) > 0 { + i -= len(m.Beneficiary) + copy(dAtA[i:], m.Beneficiary) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Beneficiary))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetRedeemClaimResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetRedeemClaimResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRedeemClaimResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.RedeemClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAllRedeemClaimRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllRedeemClaimRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRedeemClaimRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllRedeemClaimResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllRedeemClaimResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRedeemClaimResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.RedeemClaim) > 0 { + for iNdEx := len(m.RedeemClaim) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RedeemClaim[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryRedeemClaimByLiquidTxHashRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryRedeemClaimByLiquidTxHashRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRedeemClaimByLiquidTxHashRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.LiquidTxHash) > 0 { + i -= len(m.LiquidTxHash) + copy(dAtA[i:], m.LiquidTxHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.LiquidTxHash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryRedeemClaimByLiquidTxHashResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryRedeemClaimByLiquidTxHashResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRedeemClaimByLiquidTxHashResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RedeemClaim != nil { + { + size, err := m.RedeemClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1944,6 +2576,91 @@ func (m *QueryGetDistributionResponse) Size() (n int) { return n } +func (m *QueryGetRedeemClaimRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Beneficiary) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + return n +} + +func (m *QueryGetRedeemClaimResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.RedeemClaim.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllRedeemClaimRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllRedeemClaimResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RedeemClaim) > 0 { + for _, e := range m.RedeemClaim { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryRedeemClaimByLiquidTxHashRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.LiquidTxHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryRedeemClaimByLiquidTxHashResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RedeemClaim != nil { + l = m.RedeemClaim.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3296,6 +4013,564 @@ func (m *QueryGetDistributionResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryGetRedeemClaimRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetRedeemClaimRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetRedeemClaimRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Beneficiary", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Beneficiary = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetRedeemClaimResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetRedeemClaimResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetRedeemClaimResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RedeemClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RedeemClaim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllRedeemClaimRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllRedeemClaimRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllRedeemClaimRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllRedeemClaimResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllRedeemClaimResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllRedeemClaimResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RedeemClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RedeemClaim = append(m.RedeemClaim, RedeemClaim{}) + if err := m.RedeemClaim[len(m.RedeemClaim)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryRedeemClaimByLiquidTxHashRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryRedeemClaimByLiquidTxHashRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRedeemClaimByLiquidTxHashRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidTxHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LiquidTxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryRedeemClaimByLiquidTxHashResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryRedeemClaimByLiquidTxHashResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRedeemClaimByLiquidTxHashResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RedeemClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RedeemClaim == nil { + m.RedeemClaim = &RedeemClaim{} + } + if err := m.RedeemClaim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/dao/types/query.pb.gw.go b/x/dao/types/query.pb.gw.go index 2d4120f..53546d3 100644 --- a/x/dao/types/query.pb.gw.go +++ b/x/dao/types/query.pb.gw.go @@ -393,6 +393,172 @@ func local_request_Query_GetDistribution_0(ctx context.Context, marshaler runtim } +func request_Query_RedeemClaim_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRedeemClaimRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["beneficiary"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "beneficiary") + } + + protoReq.Beneficiary, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "beneficiary", err) + } + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.RedeemClaim(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RedeemClaim_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRedeemClaimRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["beneficiary"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "beneficiary") + } + + protoReq.Beneficiary, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "beneficiary", err) + } + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.RedeemClaim(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_RedeemClaimAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_RedeemClaimAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRedeemClaimRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RedeemClaimAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RedeemClaimAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RedeemClaimAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRedeemClaimRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RedeemClaimAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RedeemClaimAll(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_RedeemClaimByLiquidTxHash_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRedeemClaimByLiquidTxHashRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["liquidTxHash"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "liquidTxHash") + } + + protoReq.LiquidTxHash, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "liquidTxHash", err) + } + + msg, err := client.RedeemClaimByLiquidTxHash(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RedeemClaimByLiquidTxHash_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRedeemClaimByLiquidTxHashRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["liquidTxHash"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "liquidTxHash") + } + + protoReq.LiquidTxHash, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "liquidTxHash", err) + } + + msg, err := server.RedeemClaimByLiquidTxHash(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -583,6 +749,75 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_RedeemClaim_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RedeemClaim_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RedeemClaim_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RedeemClaimAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RedeemClaimAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RedeemClaimAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RedeemClaimByLiquidTxHash_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RedeemClaimByLiquidTxHash_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RedeemClaimByLiquidTxHash_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -784,6 +1019,66 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_RedeemClaim_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RedeemClaim_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RedeemClaim_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RedeemClaimAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RedeemClaimAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RedeemClaimAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RedeemClaimByLiquidTxHash_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RedeemClaimByLiquidTxHash_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RedeemClaimByLiquidTxHash_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -803,6 +1098,12 @@ var ( pattern_Query_Challenges_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"planetmint", "dao", "challenges"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_GetDistribution_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"planetmint", "dao", "distribution", "height"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RedeemClaim_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"planetmint", "dao", "redeem_claim", "beneficiary", "id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RedeemClaimAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"planetmint", "dao", "redeem_claim"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RedeemClaimByLiquidTxHash_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"planetmint", "dao", "redeem_claim_by_liquid_tx_hash", "liquidTxHash"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -821,4 +1122,10 @@ var ( forward_Query_Challenges_0 = runtime.ForwardResponseMessage forward_Query_GetDistribution_0 = runtime.ForwardResponseMessage + + forward_Query_RedeemClaim_0 = runtime.ForwardResponseMessage + + forward_Query_RedeemClaimAll_0 = runtime.ForwardResponseMessage + + forward_Query_RedeemClaimByLiquidTxHash_0 = runtime.ForwardResponseMessage ) diff --git a/x/dao/types/redeem_claim.pb.go b/x/dao/types/redeem_claim.pb.go new file mode 100644 index 0000000..0667ae9 --- /dev/null +++ b/x/dao/types/redeem_claim.pb.go @@ -0,0 +1,535 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: planetmintgo/dao/redeem_claim.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type RedeemClaim struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Beneficiary string `protobuf:"bytes,2,opt,name=beneficiary,proto3" json:"beneficiary,omitempty"` + LiquidTxHash string `protobuf:"bytes,3,opt,name=liquidTxHash,proto3" json:"liquidTxHash,omitempty"` + Amount uint64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` + Confirmed bool `protobuf:"varint,5,opt,name=confirmed,proto3" json:"confirmed,omitempty"` + Creator string `protobuf:"bytes,6,opt,name=creator,proto3" json:"creator,omitempty"` +} + +func (m *RedeemClaim) Reset() { *m = RedeemClaim{} } +func (m *RedeemClaim) String() string { return proto.CompactTextString(m) } +func (*RedeemClaim) ProtoMessage() {} +func (*RedeemClaim) Descriptor() ([]byte, []int) { + return fileDescriptor_57a8f72ea08c516f, []int{0} +} +func (m *RedeemClaim) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RedeemClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RedeemClaim.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RedeemClaim) XXX_Merge(src proto.Message) { + xxx_messageInfo_RedeemClaim.Merge(m, src) +} +func (m *RedeemClaim) XXX_Size() int { + return m.Size() +} +func (m *RedeemClaim) XXX_DiscardUnknown() { + xxx_messageInfo_RedeemClaim.DiscardUnknown(m) +} + +var xxx_messageInfo_RedeemClaim proto.InternalMessageInfo + +func (m *RedeemClaim) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *RedeemClaim) GetBeneficiary() string { + if m != nil { + return m.Beneficiary + } + return "" +} + +func (m *RedeemClaim) GetLiquidTxHash() string { + if m != nil { + return m.LiquidTxHash + } + return "" +} + +func (m *RedeemClaim) GetAmount() uint64 { + if m != nil { + return m.Amount + } + return 0 +} + +func (m *RedeemClaim) GetConfirmed() bool { + if m != nil { + return m.Confirmed + } + return false +} + +func (m *RedeemClaim) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func init() { + proto.RegisterType((*RedeemClaim)(nil), "planetmintgo.dao.RedeemClaim") +} + +func init() { + proto.RegisterFile("planetmintgo/dao/redeem_claim.proto", fileDescriptor_57a8f72ea08c516f) +} + +var fileDescriptor_57a8f72ea08c516f = []byte{ + // 256 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0x31, 0x4e, 0xc3, 0x30, + 0x14, 0x86, 0xe3, 0x50, 0x02, 0x75, 0x11, 0x42, 0x1e, 0x90, 0x07, 0x64, 0x45, 0x65, 0xc9, 0x42, + 0x32, 0x70, 0x03, 0x58, 0x60, 0x8d, 0x98, 0x58, 0x90, 0x13, 0xbb, 0xe9, 0x93, 0x62, 0xbf, 0xe0, + 0x3a, 0x52, 0x7b, 0x0b, 0xee, 0xc2, 0x25, 0x18, 0x3b, 0x32, 0xa2, 0xe4, 0x22, 0x08, 0x0b, 0xd4, + 0xb0, 0xbd, 0xff, 0xd3, 0xa7, 0x5f, 0x7a, 0x3f, 0xbd, 0xee, 0x5a, 0x69, 0xb5, 0x37, 0x60, 0x7d, + 0x83, 0x85, 0x92, 0x58, 0x38, 0xad, 0xb4, 0x36, 0x2f, 0x75, 0x2b, 0xc1, 0xe4, 0x9d, 0x43, 0x8f, + 0xec, 0x62, 0x2a, 0xe5, 0x4a, 0xe2, 0xf2, 0x9d, 0xd0, 0x45, 0x19, 0xc4, 0xfb, 0x1f, 0x8f, 0x9d, + 0xd3, 0x18, 0x14, 0x27, 0x29, 0xc9, 0x66, 0x65, 0x0c, 0x8a, 0xa5, 0x74, 0x51, 0x69, 0xab, 0x57, + 0x50, 0x83, 0x74, 0x3b, 0x1e, 0xa7, 0x24, 0x9b, 0x97, 0x53, 0xc4, 0x96, 0xf4, 0xac, 0x85, 0xd7, + 0x1e, 0xd4, 0xd3, 0xf6, 0x41, 0x6e, 0xd6, 0xfc, 0x28, 0x28, 0xff, 0x18, 0xbb, 0xa4, 0x89, 0x34, + 0xd8, 0x5b, 0xcf, 0x67, 0xa1, 0xf9, 0x37, 0xb1, 0x2b, 0x3a, 0xaf, 0xd1, 0xae, 0xc0, 0x19, 0xad, + 0xf8, 0x71, 0x4a, 0xb2, 0xd3, 0xf2, 0x00, 0x18, 0xa7, 0x27, 0xb5, 0xd3, 0xd2, 0xa3, 0xe3, 0x49, + 0x28, 0xfd, 0x8b, 0x77, 0x8f, 0x1f, 0x83, 0x20, 0xfb, 0x41, 0x90, 0xaf, 0x41, 0x90, 0xb7, 0x51, + 0x44, 0xfb, 0x51, 0x44, 0x9f, 0xa3, 0x88, 0x9e, 0x8b, 0x06, 0xfc, 0xba, 0xaf, 0xf2, 0x1a, 0x4d, + 0x71, 0x78, 0x76, 0x72, 0xde, 0x34, 0x58, 0x6c, 0xc3, 0x3e, 0x7e, 0xd7, 0xe9, 0x4d, 0x95, 0x84, + 0x65, 0x6e, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x3d, 0x42, 0x49, 0xe4, 0x40, 0x01, 0x00, 0x00, +} + +func (m *RedeemClaim) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RedeemClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RedeemClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintRedeemClaim(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0x32 + } + if m.Confirmed { + i-- + if m.Confirmed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.Amount != 0 { + i = encodeVarintRedeemClaim(dAtA, i, uint64(m.Amount)) + i-- + dAtA[i] = 0x20 + } + if len(m.LiquidTxHash) > 0 { + i -= len(m.LiquidTxHash) + copy(dAtA[i:], m.LiquidTxHash) + i = encodeVarintRedeemClaim(dAtA, i, uint64(len(m.LiquidTxHash))) + i-- + dAtA[i] = 0x1a + } + if len(m.Beneficiary) > 0 { + i -= len(m.Beneficiary) + copy(dAtA[i:], m.Beneficiary) + i = encodeVarintRedeemClaim(dAtA, i, uint64(len(m.Beneficiary))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintRedeemClaim(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintRedeemClaim(dAtA []byte, offset int, v uint64) int { + offset -= sovRedeemClaim(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RedeemClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovRedeemClaim(uint64(m.Id)) + } + l = len(m.Beneficiary) + if l > 0 { + n += 1 + l + sovRedeemClaim(uint64(l)) + } + l = len(m.LiquidTxHash) + if l > 0 { + n += 1 + l + sovRedeemClaim(uint64(l)) + } + if m.Amount != 0 { + n += 1 + sovRedeemClaim(uint64(m.Amount)) + } + if m.Confirmed { + n += 2 + } + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovRedeemClaim(uint64(l)) + } + return n +} + +func sovRedeemClaim(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRedeemClaim(x uint64) (n int) { + return sovRedeemClaim(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RedeemClaim) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRedeemClaim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RedeemClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RedeemClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRedeemClaim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Beneficiary", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRedeemClaim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRedeemClaim + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRedeemClaim + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Beneficiary = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidTxHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRedeemClaim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRedeemClaim + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRedeemClaim + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LiquidTxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + m.Amount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRedeemClaim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Amount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Confirmed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRedeemClaim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Confirmed = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRedeemClaim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRedeemClaim + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRedeemClaim + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRedeemClaim(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRedeemClaim + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRedeemClaim(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRedeemClaim + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRedeemClaim + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRedeemClaim + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthRedeemClaim + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRedeemClaim + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRedeemClaim + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRedeemClaim = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRedeemClaim = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRedeemClaim = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/dao/types/tx.pb.go b/x/dao/types/tx.pb.go index cd35ca4..84801dd 100644 --- a/x/dao/types/tx.pb.go +++ b/x/dao/types/tx.pb.go @@ -849,6 +849,302 @@ func (m *MsgInitPopResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgInitPopResponse proto.InternalMessageInfo +type MsgCreateRedeemClaim struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Beneficiary string `protobuf:"bytes,2,opt,name=beneficiary,proto3" json:"beneficiary,omitempty"` + Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *MsgCreateRedeemClaim) Reset() { *m = MsgCreateRedeemClaim{} } +func (m *MsgCreateRedeemClaim) String() string { return proto.CompactTextString(m) } +func (*MsgCreateRedeemClaim) ProtoMessage() {} +func (*MsgCreateRedeemClaim) Descriptor() ([]byte, []int) { + return fileDescriptor_7117c47dbc1828c7, []int{16} +} +func (m *MsgCreateRedeemClaim) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateRedeemClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateRedeemClaim.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateRedeemClaim) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateRedeemClaim.Merge(m, src) +} +func (m *MsgCreateRedeemClaim) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateRedeemClaim) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateRedeemClaim.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateRedeemClaim proto.InternalMessageInfo + +func (m *MsgCreateRedeemClaim) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgCreateRedeemClaim) GetBeneficiary() string { + if m != nil { + return m.Beneficiary + } + return "" +} + +func (m *MsgCreateRedeemClaim) GetAmount() uint64 { + if m != nil { + return m.Amount + } + return 0 +} + +type MsgCreateRedeemClaimResponse struct { +} + +func (m *MsgCreateRedeemClaimResponse) Reset() { *m = MsgCreateRedeemClaimResponse{} } +func (m *MsgCreateRedeemClaimResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateRedeemClaimResponse) ProtoMessage() {} +func (*MsgCreateRedeemClaimResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7117c47dbc1828c7, []int{17} +} +func (m *MsgCreateRedeemClaimResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateRedeemClaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateRedeemClaimResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateRedeemClaimResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateRedeemClaimResponse.Merge(m, src) +} +func (m *MsgCreateRedeemClaimResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateRedeemClaimResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateRedeemClaimResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateRedeemClaimResponse proto.InternalMessageInfo + +type MsgUpdateRedeemClaim struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + Beneficiary string `protobuf:"bytes,3,opt,name=beneficiary,proto3" json:"beneficiary,omitempty"` + LiquidTxHash string `protobuf:"bytes,4,opt,name=liquidTxHash,proto3" json:"liquidTxHash,omitempty"` +} + +func (m *MsgUpdateRedeemClaim) Reset() { *m = MsgUpdateRedeemClaim{} } +func (m *MsgUpdateRedeemClaim) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateRedeemClaim) ProtoMessage() {} +func (*MsgUpdateRedeemClaim) Descriptor() ([]byte, []int) { + return fileDescriptor_7117c47dbc1828c7, []int{18} +} +func (m *MsgUpdateRedeemClaim) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateRedeemClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateRedeemClaim.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateRedeemClaim) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateRedeemClaim.Merge(m, src) +} +func (m *MsgUpdateRedeemClaim) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateRedeemClaim) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateRedeemClaim.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateRedeemClaim proto.InternalMessageInfo + +func (m *MsgUpdateRedeemClaim) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUpdateRedeemClaim) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *MsgUpdateRedeemClaim) GetBeneficiary() string { + if m != nil { + return m.Beneficiary + } + return "" +} + +func (m *MsgUpdateRedeemClaim) GetLiquidTxHash() string { + if m != nil { + return m.LiquidTxHash + } + return "" +} + +type MsgUpdateRedeemClaimResponse struct { +} + +func (m *MsgUpdateRedeemClaimResponse) Reset() { *m = MsgUpdateRedeemClaimResponse{} } +func (m *MsgUpdateRedeemClaimResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateRedeemClaimResponse) ProtoMessage() {} +func (*MsgUpdateRedeemClaimResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7117c47dbc1828c7, []int{19} +} +func (m *MsgUpdateRedeemClaimResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateRedeemClaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateRedeemClaimResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateRedeemClaimResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateRedeemClaimResponse.Merge(m, src) +} +func (m *MsgUpdateRedeemClaimResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateRedeemClaimResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateRedeemClaimResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateRedeemClaimResponse proto.InternalMessageInfo + +type MsgConfirmRedeemClaim struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + Beneficiary string `protobuf:"bytes,3,opt,name=beneficiary,proto3" json:"beneficiary,omitempty"` +} + +func (m *MsgConfirmRedeemClaim) Reset() { *m = MsgConfirmRedeemClaim{} } +func (m *MsgConfirmRedeemClaim) String() string { return proto.CompactTextString(m) } +func (*MsgConfirmRedeemClaim) ProtoMessage() {} +func (*MsgConfirmRedeemClaim) Descriptor() ([]byte, []int) { + return fileDescriptor_7117c47dbc1828c7, []int{20} +} +func (m *MsgConfirmRedeemClaim) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConfirmRedeemClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConfirmRedeemClaim.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConfirmRedeemClaim) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConfirmRedeemClaim.Merge(m, src) +} +func (m *MsgConfirmRedeemClaim) XXX_Size() int { + return m.Size() +} +func (m *MsgConfirmRedeemClaim) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConfirmRedeemClaim.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConfirmRedeemClaim proto.InternalMessageInfo + +func (m *MsgConfirmRedeemClaim) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgConfirmRedeemClaim) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *MsgConfirmRedeemClaim) GetBeneficiary() string { + if m != nil { + return m.Beneficiary + } + return "" +} + +type MsgConfirmRedeemClaimResponse struct { +} + +func (m *MsgConfirmRedeemClaimResponse) Reset() { *m = MsgConfirmRedeemClaimResponse{} } +func (m *MsgConfirmRedeemClaimResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConfirmRedeemClaimResponse) ProtoMessage() {} +func (*MsgConfirmRedeemClaimResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7117c47dbc1828c7, []int{21} +} +func (m *MsgConfirmRedeemClaimResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConfirmRedeemClaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConfirmRedeemClaimResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConfirmRedeemClaimResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConfirmRedeemClaimResponse.Merge(m, src) +} +func (m *MsgConfirmRedeemClaimResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConfirmRedeemClaimResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConfirmRedeemClaimResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConfirmRedeemClaimResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgReportPopResult)(nil), "planetmintgo.dao.MsgReportPopResult") proto.RegisterType((*MsgReportPopResultResponse)(nil), "planetmintgo.dao.MsgReportPopResultResponse") @@ -866,70 +1162,87 @@ func init() { proto.RegisterType((*MsgUpdateParamsResponse)(nil), "planetmintgo.dao.MsgUpdateParamsResponse") proto.RegisterType((*MsgInitPop)(nil), "planetmintgo.dao.MsgInitPop") proto.RegisterType((*MsgInitPopResponse)(nil), "planetmintgo.dao.MsgInitPopResponse") + proto.RegisterType((*MsgCreateRedeemClaim)(nil), "planetmintgo.dao.MsgCreateRedeemClaim") + proto.RegisterType((*MsgCreateRedeemClaimResponse)(nil), "planetmintgo.dao.MsgCreateRedeemClaimResponse") + proto.RegisterType((*MsgUpdateRedeemClaim)(nil), "planetmintgo.dao.MsgUpdateRedeemClaim") + proto.RegisterType((*MsgUpdateRedeemClaimResponse)(nil), "planetmintgo.dao.MsgUpdateRedeemClaimResponse") + proto.RegisterType((*MsgConfirmRedeemClaim)(nil), "planetmintgo.dao.MsgConfirmRedeemClaim") + proto.RegisterType((*MsgConfirmRedeemClaimResponse)(nil), "planetmintgo.dao.MsgConfirmRedeemClaimResponse") } func init() { proto.RegisterFile("planetmintgo/dao/tx.proto", fileDescriptor_7117c47dbc1828c7) } var fileDescriptor_7117c47dbc1828c7 = []byte{ - // 926 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x41, 0x6f, 0xdc, 0x44, - 0x14, 0x8e, 0x9b, 0x74, 0xc3, 0xbe, 0x04, 0xd2, 0x4c, 0x43, 0xea, 0x98, 0xc4, 0x5d, 0xdc, 0xa8, - 0x6c, 0xa3, 0x76, 0x0d, 0x45, 0x42, 0x02, 0x0e, 0x88, 0x10, 0x09, 0x56, 0xc2, 0x22, 0x72, 0xcb, - 0x05, 0x21, 0x45, 0xce, 0x7a, 0xf0, 0x8e, 0xe2, 0xf5, 0x38, 0x33, 0xb3, 0x55, 0x22, 0x6e, 0xfd, - 0x05, 0x9c, 0x38, 0xf1, 0x03, 0x38, 0x16, 0x89, 0x1f, 0xd1, 0x63, 0xc5, 0x89, 0x13, 0xaa, 0x92, - 0x43, 0x7f, 0x02, 0xd7, 0xca, 0x33, 0x63, 0xaf, 0x1d, 0x3b, 0xbb, 0x7b, 0x49, 0xe6, 0xbd, 0xef, - 0x7b, 0xef, 0x7d, 0x3b, 0x6f, 0xde, 0x93, 0x61, 0x2b, 0x8d, 0x83, 0x04, 0x8b, 0x11, 0x49, 0x44, - 0x44, 0xdd, 0x30, 0xa0, 0xae, 0x38, 0xeb, 0xa5, 0x8c, 0x0a, 0x8a, 0x6e, 0x95, 0xa1, 0x5e, 0x18, - 0x50, 0xab, 0x53, 0x23, 0x0f, 0x86, 0x41, 0x1c, 0xe3, 0x24, 0xc2, 0x2a, 0xc6, 0xba, 0x57, 0x63, - 0x64, 0xc7, 0x23, 0x86, 0x4f, 0xc7, 0x98, 0x0b, 0x4d, 0x7a, 0x50, 0x23, 0x85, 0x84, 0x0b, 0x46, - 0x8e, 0xc7, 0x82, 0xd0, 0xe4, 0x88, 0xb2, 0x10, 0x33, 0x4d, 0xdd, 0xa9, 0x51, 0xd3, 0x80, 0x05, - 0x23, 0xae, 0xe1, 0xf5, 0x60, 0x44, 0x12, 0xea, 0xca, 0xbf, 0xda, 0xb5, 0x11, 0xd1, 0x88, 0xca, - 0xa3, 0x9b, 0x9d, 0xb4, 0x77, 0x6b, 0x40, 0xf9, 0x88, 0xf2, 0x23, 0x05, 0x28, 0x43, 0x43, 0x77, - 0x94, 0xe5, 0x8e, 0x78, 0xe4, 0x3e, 0xfb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x9f, 0x8e, 0x17, 0x49, 0x4f, 0x60, 0xbd, 0xbe, - 0x93, 0xee, 0xcf, 0xd2, 0xa6, 0x78, 0x56, 0x6f, 0x3e, 0x5e, 0x51, 0x2c, 0x01, 0xd4, 0xb0, 0x5b, - 0x3e, 0x6a, 0xcc, 0x52, 0x27, 0x5a, 0xee, 0x9c, 0xc4, 0xa2, 0xde, 0x29, 0xdc, 0x6e, 0x9a, 0xd8, - 0xee, 0x1c, 0x79, 0x24, 0xf3, 0x9a, 0x26, 0x4d, 0x19, 0x44, 0xf4, 0x33, 0xac, 0x56, 0x86, 0xf0, - 0xc3, 0xc6, 0x0c, 0x65, 0x8a, 0xf5, 0x60, 0x26, 0xa5, 0xc8, 0x8e, 0x61, 0xed, 0xea, 0x37, 0xc5, - 0xee, 0x35, 0x3d, 0xa8, 0xb0, 0xac, 0x87, 0xf3, 0xb0, 0x8a, 0x32, 0x1e, 0x2c, 0xe7, 0x53, 0xb9, - 0xdd, 0x18, 0xa8, 0x51, 0x6b, 0x77, 0x1a, 0x9a, 0xa7, 0xdb, 0xef, 0xbf, 0xbc, 0xb0, 0x8d, 0x57, - 0x17, 0xb6, 0xf1, 0xfa, 0xc2, 0x36, 0x7e, 0xbb, 0xb4, 0x17, 0x5e, 0x5d, 0xda, 0x0b, 0xff, 0x5e, - 0xda, 0x0b, 0x3f, 0xb9, 0x11, 0x11, 0xc3, 0xf1, 0x71, 0x6f, 0x40, 0x47, 0xee, 0x24, 0x53, 0xe9, - 0xf8, 0x28, 0xa2, 0xee, 0x99, 0xfa, 0xb4, 0x3c, 0x4f, 0x31, 0x3f, 0x6e, 0xc9, 0xcf, 0xab, 0x4f, - 0xdf, 0x06, 0x00, 0x00, 0xff, 0xff, 0x31, 0xb7, 0xf0, 0x33, 0x7b, 0x0a, 0x00, 0x00, + // 1094 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0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e1, 0x45, + 0x6b, 0x7e, 0x94, 0xd7, 0x68, 0x10, 0x20, 0x4f, 0x7c, 0x4c, 0x6b, 0xbe, 0x82, 0xe5, 0xb2, 0x82, + 0xa9, 0x69, 0x7a, 0xa8, 0x4f, 0x53, 0x79, 0xdb, 0x6f, 0x32, 0x99, 0xf3, 0x06, 0x12, 0xd5, 0x84, + 0x57, 0x14, 0x2f, 0xe8, 0xfd, 0x62, 0xc0, 0x4a, 0x9b, 0x87, 0xdf, 0xa6, 0x01, 0x12, 0xf8, 0x48, + 0x6a, 0xa1, 0xf9, 0x09, 0xd4, 0x50, 0x57, 0x74, 0x28, 0x23, 0xe2, 0x2a, 0xa7, 0xb6, 0x57, 0xff, + 0xe3, 0xf7, 0x27, 0x6b, 0x4a, 0xe6, 0xbe, 0x0c, 0x02, 0x86, 0x39, 0x7f, 0x2e, 0x18, 0x49, 0x42, + 0xaf, 0x0f, 0x35, 0x3f, 0x87, 0x85, 0x5c, 0x4d, 0x15, 0xe1, 0xba, 0x4e, 0x38, 0xaf, 0xb0, 0x57, + 0x7b, 0xfd, 0xd7, 0x83, 0x99, 0xdf, 0xde, 0xbd, 0xda, 0x35, 0x3c, 0x95, 0xf2, 0xd9, 0x9d, 0x97, + 0xef, 0x5e, 0xed, 0xf6, 0x37, 0x73, 0x36, 0xe0, 0xfe, 0x10, 0xaf, 0x82, 0xf3, 0xaf, 0x06, 0x40, + 0x9b, 0x87, 0x87, 0x09, 0xe9, 0x8d, 0xcb, 0x88, 0x3e, 0x6e, 0x42, 0x8d, 0x24, 0x44, 0x10, 0x19, + 0xcb, 0x6f, 0x42, 0xdf, 0x61, 0xda, 0x00, 0x85, 0x18, 0x32, 0x35, 0x69, 0x25, 0xcf, 0x40, 0x1c, + 0xab, 0x51, 0x2b, 0x79, 0xcc, 0x75, 0x58, 0xe8, 0xe4, 0x37, 0x26, 0x97, 0x22, 0x65, 0x39, 0x6b, + 0x52, 0xc2, 0x15, 0xbb, 0x82, 0xf4, 0x0f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c, 0xab, 0x12, 0xdb, 0xe6, + 0x14, 0xfb, 0x48, 0xe4, 0x88, 0x43, 0x1a, 0xa3, 0xa1, 0xe6, 0xf7, 0xb0, 0x3c, 0xa0, 0x9f, 0xef, + 0x57, 0xee, 0x50, 0x86, 0x58, 0x8f, 0x26, 0x42, 0x8a, 0xdd, 0x31, 0xac, 0x0c, 0xff, 0x39, 0xb8, + 0x3d, 0xe2, 0x0c, 0x06, 0x50, 0xd6, 0xe3, 0x69, 0x50, 0x45, 0x99, 0x36, 0x2c, 0xf6, 0x04, 0x75, + 0xb3, 0x32, 0x51, 0x45, 0xad, 0xed, 0x71, 0xd1, 0xf2, 0x8c, 0xe9, 0x5a, 0x57, 0x3d, 0x63, 0x1a, + 0x6e, 0xc4, 0x8c, 0x8d, 0xd4, 0xb3, 0xac, 0x98, 0xae, 0x65, 0x3b, 0x63, 0x5a, 0x3c, 0xb9, 0xd8, + 0x48, 0x4d, 0xca, 0x06, 0xba, 0x42, 0x90, 0xaa, 0x07, 0x5a, 0x07, 0x8e, 0x18, 0xe8, 0xd1, 0xea, + 0xb3, 0x77, 0xf8, 0xfa, 0xda, 0x36, 0xde, 0x5c, 0xdb, 0xc6, 0xdb, 0x6b, 0xdb, 0xf8, 0xf9, 0xc6, + 0x9e, 0x79, 0x73, 0x63, 0xcf, 0xfc, 0x79, 0x63, 0xcf, 0x7c, 0xe7, 0x86, 0x44, 0x74, 0xba, 0xa7, + 0x2d, 0x9f, 0xc6, 0x6e, 0x7f, 0xd3, 0xd2, 0xf2, 0x49, 0x48, 0xdd, 0xcb, 0xfc, 0x47, 0xd8, 0x55, + 0x8a, 0xf9, 0xe9, 0x82, 0xfc, 0x8d, 0xf1, 0xf1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x81, 0x5c, + 0x0d, 0x9f, 0xa5, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -952,6 +1265,9 @@ type MsgClient interface { UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) ReportPopResult(ctx context.Context, in *MsgReportPopResult, opts ...grpc.CallOption) (*MsgReportPopResultResponse, error) InitPop(ctx context.Context, in *MsgInitPop, opts ...grpc.CallOption) (*MsgInitPopResponse, error) + CreateRedeemClaim(ctx context.Context, in *MsgCreateRedeemClaim, opts ...grpc.CallOption) (*MsgCreateRedeemClaimResponse, error) + UpdateRedeemClaim(ctx context.Context, in *MsgUpdateRedeemClaim, opts ...grpc.CallOption) (*MsgUpdateRedeemClaimResponse, error) + ConfirmRedeemClaim(ctx context.Context, in *MsgConfirmRedeemClaim, opts ...grpc.CallOption) (*MsgConfirmRedeemClaimResponse, error) } type msgClient struct { @@ -1034,6 +1350,33 @@ func (c *msgClient) InitPop(ctx context.Context, in *MsgInitPop, opts ...grpc.Ca return out, nil } +func (c *msgClient) CreateRedeemClaim(ctx context.Context, in *MsgCreateRedeemClaim, opts ...grpc.CallOption) (*MsgCreateRedeemClaimResponse, error) { + out := new(MsgCreateRedeemClaimResponse) + err := c.cc.Invoke(ctx, "/planetmintgo.dao.Msg/CreateRedeemClaim", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateRedeemClaim(ctx context.Context, in *MsgUpdateRedeemClaim, opts ...grpc.CallOption) (*MsgUpdateRedeemClaimResponse, error) { + out := new(MsgUpdateRedeemClaimResponse) + err := c.cc.Invoke(ctx, "/planetmintgo.dao.Msg/UpdateRedeemClaim", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConfirmRedeemClaim(ctx context.Context, in *MsgConfirmRedeemClaim, opts ...grpc.CallOption) (*MsgConfirmRedeemClaimResponse, error) { + out := new(MsgConfirmRedeemClaimResponse) + err := c.cc.Invoke(ctx, "/planetmintgo.dao.Msg/ConfirmRedeemClaim", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { ReissueRDDLProposal(context.Context, *MsgReissueRDDLProposal) (*MsgReissueRDDLProposalResponse, error) @@ -1044,6 +1387,9 @@ type MsgServer interface { UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) ReportPopResult(context.Context, *MsgReportPopResult) (*MsgReportPopResultResponse, error) InitPop(context.Context, *MsgInitPop) (*MsgInitPopResponse, error) + CreateRedeemClaim(context.Context, *MsgCreateRedeemClaim) (*MsgCreateRedeemClaimResponse, error) + UpdateRedeemClaim(context.Context, *MsgUpdateRedeemClaim) (*MsgUpdateRedeemClaimResponse, error) + ConfirmRedeemClaim(context.Context, *MsgConfirmRedeemClaim) (*MsgConfirmRedeemClaimResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1074,6 +1420,15 @@ func (*UnimplementedMsgServer) ReportPopResult(ctx context.Context, req *MsgRepo func (*UnimplementedMsgServer) InitPop(ctx context.Context, req *MsgInitPop) (*MsgInitPopResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InitPop not implemented") } +func (*UnimplementedMsgServer) CreateRedeemClaim(ctx context.Context, req *MsgCreateRedeemClaim) (*MsgCreateRedeemClaimResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateRedeemClaim not implemented") +} +func (*UnimplementedMsgServer) UpdateRedeemClaim(ctx context.Context, req *MsgUpdateRedeemClaim) (*MsgUpdateRedeemClaimResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateRedeemClaim not implemented") +} +func (*UnimplementedMsgServer) ConfirmRedeemClaim(ctx context.Context, req *MsgConfirmRedeemClaim) (*MsgConfirmRedeemClaimResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConfirmRedeemClaim not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1223,6 +1578,60 @@ func _Msg_InitPop_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } +func _Msg_CreateRedeemClaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateRedeemClaim) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateRedeemClaim(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/planetmintgo.dao.Msg/CreateRedeemClaim", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateRedeemClaim(ctx, req.(*MsgCreateRedeemClaim)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateRedeemClaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateRedeemClaim) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateRedeemClaim(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/planetmintgo.dao.Msg/UpdateRedeemClaim", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateRedeemClaim(ctx, req.(*MsgUpdateRedeemClaim)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConfirmRedeemClaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConfirmRedeemClaim) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConfirmRedeemClaim(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/planetmintgo.dao.Msg/ConfirmRedeemClaim", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConfirmRedeemClaim(ctx, req.(*MsgConfirmRedeemClaim)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "planetmintgo.dao.Msg", HandlerType: (*MsgServer)(nil), @@ -1259,6 +1668,18 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "InitPop", Handler: _Msg_InitPop_Handler, }, + { + MethodName: "CreateRedeemClaim", + Handler: _Msg_CreateRedeemClaim_Handler, + }, + { + MethodName: "UpdateRedeemClaim", + Handler: _Msg_UpdateRedeemClaim_Handler, + }, + { + MethodName: "ConfirmRedeemClaim", + Handler: _Msg_ConfirmRedeemClaim_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "planetmintgo/dao/tx.proto", @@ -1848,6 +2269,208 @@ func (m *MsgInitPopResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgCreateRedeemClaim) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateRedeemClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateRedeemClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Amount != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Amount)) + i-- + dAtA[i] = 0x18 + } + if len(m.Beneficiary) > 0 { + i -= len(m.Beneficiary) + copy(dAtA[i:], m.Beneficiary) + i = encodeVarintTx(dAtA, i, uint64(len(m.Beneficiary))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateRedeemClaimResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateRedeemClaimResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateRedeemClaimResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateRedeemClaim) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateRedeemClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateRedeemClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.LiquidTxHash) > 0 { + i -= len(m.LiquidTxHash) + copy(dAtA[i:], m.LiquidTxHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.LiquidTxHash))) + i-- + dAtA[i] = 0x22 + } + if len(m.Beneficiary) > 0 { + i -= len(m.Beneficiary) + copy(dAtA[i:], m.Beneficiary) + i = encodeVarintTx(dAtA, i, uint64(len(m.Beneficiary))) + i-- + dAtA[i] = 0x1a + } + if m.Id != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x10 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateRedeemClaimResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateRedeemClaimResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateRedeemClaimResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgConfirmRedeemClaim) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConfirmRedeemClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConfirmRedeemClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Beneficiary) > 0 { + i -= len(m.Beneficiary) + copy(dAtA[i:], m.Beneficiary) + i = encodeVarintTx(dAtA, i, uint64(len(m.Beneficiary))) + i-- + dAtA[i] = 0x1a + } + if m.Id != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x10 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgConfirmRedeemClaimResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConfirmRedeemClaimResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConfirmRedeemClaimResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -2115,6 +2738,97 @@ func (m *MsgInitPopResponse) Size() (n int) { return n } +func (m *MsgCreateRedeemClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Beneficiary) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Amount != 0 { + n += 1 + sovTx(uint64(m.Amount)) + } + return n +} + +func (m *MsgCreateRedeemClaimResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateRedeemClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovTx(uint64(m.Id)) + } + l = len(m.Beneficiary) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.LiquidTxHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateRedeemClaimResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgConfirmRedeemClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovTx(uint64(m.Id)) + } + l = len(m.Beneficiary) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgConfirmRedeemClaimResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3816,6 +4530,587 @@ func (m *MsgInitPopResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgCreateRedeemClaim) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateRedeemClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateRedeemClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Beneficiary", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Beneficiary = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + m.Amount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Amount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateRedeemClaimResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateRedeemClaimResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateRedeemClaimResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateRedeemClaim) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateRedeemClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateRedeemClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Beneficiary", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Beneficiary = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidTxHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LiquidTxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateRedeemClaimResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateRedeemClaimResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateRedeemClaimResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgConfirmRedeemClaim) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConfirmRedeemClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConfirmRedeemClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Beneficiary", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Beneficiary = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgConfirmRedeemClaimResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConfirmRedeemClaimResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConfirmRedeemClaimResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0