From 76160fd2850dec90dc0052b830b62093e2da6178 Mon Sep 17 00:00:00 2001 From: lxgr-linux Date: Fri, 18 Aug 2023 20:07:56 +0200 Subject: [PATCH] Updated routes and added OpenMatch --- docs/static/openapi.yml | 96 ++ proto/cardchain/cardchain/match.proto | 2 + proto/cardchain/cardchain/tx.proto | 46 +- x/cardchain/client/cli/tx.go | 1 + x/cardchain/client/cli/tx_msg_open_match.go | 40 + x/cardchain/client/cli/tx_report_match.go | 18 +- x/cardchain/genesis.go | 10 +- x/cardchain/keeper/card.go | 18 +- x/cardchain/keeper/council.go | 2 +- x/cardchain/keeper/grpc_query_q_card.go | 2 +- .../keeper/grpc_query_q_cardchain_info.go | 2 +- x/cardchain/keeper/grpc_query_q_cards.go | 2 +- x/cardchain/keeper/keeper.go | 10 +- .../keeper/msg_server_confirm_match.go | 39 +- .../keeper/msg_server_msg_open_match.go | 37 + x/cardchain/keeper/msg_server_report_match.go | 49 +- x/cardchain/keeper/voting.go | 2 +- x/cardchain/module_simulation.go | 15 + x/cardchain/simulation/msg_open_match.go | 29 + x/cardchain/types/codec.go | 4 + x/cardchain/types/errors.go | 1 + x/cardchain/types/match.pb.go | 283 +++- x/cardchain/types/message_msg_open_match.go | 45 + .../types/message_msg_open_match_test.go | 40 + x/cardchain/types/message_report_match.go | 13 +- x/cardchain/types/tx.pb.go | 1299 +++++++++++++---- x/cardchain/types/types.go | 3 +- 27 files changed, 1688 insertions(+), 420 deletions(-) create mode 100644 x/cardchain/client/cli/tx_msg_open_match.go create mode 100644 x/cardchain/keeper/msg_server_msg_open_match.go create mode 100644 x/cardchain/simulation/msg_open_match.go create mode 100644 x/cardchain/types/message_msg_open_match.go create mode 100644 x/cardchain/types/message_msg_open_match_test.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 81a2f4e3..2c7e20a5 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -33513,6 +33513,16 @@ paths: - Draw - Aborted default: AWon + deck: + type: array + items: + type: string + format: uint64 + votedCards: + type: array + items: + type: string + format: uint64 playerB: type: object properties: @@ -33533,6 +33543,16 @@ paths: - Draw - Aborted default: AWon + deck: + type: array + items: + type: string + format: uint64 + votedCards: + type: array + items: + type: string + format: uint64 outcome: type: string enum: @@ -33614,6 +33634,16 @@ paths: - Draw - Aborted default: AWon + deck: + type: array + items: + type: string + format: uint64 + votedCards: + type: array + items: + type: string + format: uint64 playerB: type: object properties: @@ -33634,6 +33664,16 @@ paths: - Draw - Aborted default: AWon + deck: + type: array + items: + type: string + format: uint64 + votedCards: + type: array + items: + type: string + format: uint64 outcome: type: string enum: @@ -68522,6 +68562,16 @@ definitions: - Draw - Aborted default: AWon + deck: + type: array + items: + type: string + format: uint64 + votedCards: + type: array + items: + type: string + format: uint64 playerB: type: object properties: @@ -68542,6 +68592,16 @@ definitions: - Draw - Aborted default: AWon + deck: + type: array + items: + type: string + format: uint64 + votedCards: + type: array + items: + type: string + format: uint64 outcome: type: string enum: @@ -68572,6 +68632,16 @@ definitions: - Draw - Aborted default: AWon + deck: + type: array + items: + type: string + format: uint64 + votedCards: + type: array + items: + type: string + format: uint64 DecentralCardGame.cardchain.cardchain.MsgAddArtworkResponse: type: object DecentralCardGame.cardchain.cardchain.MsgAddArtworkToCollectionResponse: @@ -68615,6 +68685,12 @@ definitions: type: object DecentralCardGame.cardchain.cardchain.MsgFinalizeCollectionResponse: type: object + DecentralCardGame.cardchain.cardchain.MsgMsgOpenMatchResponse: + type: object + properties: + matchId: + type: string + format: uint64 DecentralCardGame.cardchain.cardchain.MsgMultiVoteCardResponse: type: object DecentralCardGame.cardchain.cardchain.MsgOpenBoosterPackResponse: @@ -68990,6 +69066,16 @@ definitions: - Draw - Aborted default: AWon + deck: + type: array + items: + type: string + format: uint64 + votedCards: + type: array + items: + type: string + format: uint64 playerB: type: object properties: @@ -69010,6 +69096,16 @@ definitions: - Draw - Aborted default: AWon + deck: + type: array + items: + type: string + format: uint64 + votedCards: + type: array + items: + type: string + format: uint64 outcome: type: string enum: diff --git a/proto/cardchain/cardchain/match.proto b/proto/cardchain/cardchain/match.proto index be90154b..75952a5d 100644 --- a/proto/cardchain/cardchain/match.proto +++ b/proto/cardchain/cardchain/match.proto @@ -19,4 +19,6 @@ message MatchPlayer { repeated uint64 playedCards = 2; bool confirmed = 3; Outcome outcome = 4; + repeated uint64 deck = 5; + repeated uint64 votedCards = 6; } diff --git a/proto/cardchain/cardchain/tx.proto b/proto/cardchain/cardchain/tx.proto index 27e1614e..916e54c8 100644 --- a/proto/cardchain/cardchain/tx.proto +++ b/proto/cardchain/cardchain/tx.proto @@ -55,6 +55,7 @@ service Msg { // this line is used by starport scaffolding # proto/tx/rpc rpc MultiVoteCard (MsgMultiVoteCard) returns (MsgMultiVoteCardResponse); + rpc MsgOpenMatch (MsgMsgOpenMatch ) returns (MsgMsgOpenMatchResponse ); } message MsgCreateuser { string creator = 1; @@ -71,11 +72,11 @@ message MsgBuyCardScheme { cosmos.base.v1beta1.Coin bid = 2 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; /* - string bid = 2; + string bid = 2; */} message MsgBuyCardSchemeResponse { - uint64 cardId = 1; + uint64 cardId = 1; } message MsgVoteCard { @@ -95,9 +96,9 @@ message MsgSaveCardContent { // bytes image = 4; // string fullArt = 5; - string notes = 4; - string artist = 5; - bool balanceAnchor = 6; + string notes = 4; + string artist = 5; + bool balanceAnchor = 6; } message MsgSaveCardContentResponse { @@ -153,12 +154,11 @@ message MsgRegisterForCouncil { message MsgRegisterForCouncilResponse {} message MsgReportMatch { - string creator = 1; - string playerA = 2; - string playerB = 3; - repeated uint64 cardsA = 5; - repeated uint64 cardsB = 6; - Outcome outcome = 7; + string creator = 1; + uint64 matchId = 2; + repeated uint64 playedCardsA = 3; + repeated uint64 playedCardsB = 4; + Outcome outcome = 5; } enum Outcome { @@ -339,9 +339,10 @@ message MsgRewokeCouncilRegistration { message MsgRewokeCouncilRegistrationResponse {} message MsgConfirmMatch { - string creator = 1; - uint64 matchId = 2; - Outcome outcome = 3; + string creator = 1; + uint64 matchId = 2; + Outcome outcome = 3; + repeated uint64 votedCards = 4; } message MsgConfirmMatchResponse {} @@ -400,7 +401,6 @@ message MsgSetUserBiography { message MsgSetUserBiographyResponse {} - message SingleVote { uint64 cardId = 1; string voteType = 2; @@ -408,9 +408,21 @@ message SingleVote { // this line is used by starport scaffolding # proto/tx/message message MsgMultiVoteCard { - string creator = 1; - repeated SingleVote votes = 2; + string creator = 1; + repeated SingleVote votes = 2; } message MsgMultiVoteCardResponse {} +message MsgMsgOpenMatch { + string creator = 1; + string playerA = 2; + string playerB = 3; + repeated uint64 playerADeck = 4; + repeated uint64 playerBDeck = 5; +} + +message MsgMsgOpenMatchResponse { + uint64 matchId = 1; +} + diff --git a/x/cardchain/client/cli/tx.go b/x/cardchain/client/cli/tx.go index 63665004..7e9ec4c3 100644 --- a/x/cardchain/client/cli/tx.go +++ b/x/cardchain/client/cli/tx.go @@ -70,6 +70,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdSetUserWebsite()) cmd.AddCommand(CmdSetUserBiography()) cmd.AddCommand(CmdMultiVoteCard()) + cmd.AddCommand(CmdMsgOpenMatch()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/cardchain/client/cli/tx_msg_open_match.go b/x/cardchain/client/cli/tx_msg_open_match.go new file mode 100644 index 00000000..73da4182 --- /dev/null +++ b/x/cardchain/client/cli/tx_msg_open_match.go @@ -0,0 +1,40 @@ +package cli + +import ( + "strconv" + + "github.com/DecentralCardGame/Cardchain/x/cardchain/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdMsgOpenMatch() *cobra.Command { + cmd := &cobra.Command{ + Use: "msg-open-match", + Short: "Broadcast message MsgOpenMatch", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgMsgOpenMatch( + clientCtx.GetFromAddress().String(), + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/cardchain/client/cli/tx_report_match.go b/x/cardchain/client/cli/tx_report_match.go index 4bf7b047..69599a29 100644 --- a/x/cardchain/client/cli/tx_report_match.go +++ b/x/cardchain/client/cli/tx_report_match.go @@ -15,20 +15,23 @@ var _ = strconv.Itoa(0) func CmdReportMatch() *cobra.Command { cmd := &cobra.Command{ - Use: "report-match [player-a] [player-b] [cards-a] [cards-b] [outcome]", + Use: "report-match [match-id] [cards-a] [cards-b] [outcome]", Short: "Broadcast message ReportMatch", - Args: cobra.ExactArgs(5), + Args: cobra.ExactArgs(4), RunE: func(cmd *cobra.Command, args []string) (err error) { - argPlayerA := args[0] - argPlayerB := args[1] + argMatchId, err := strconv.Atoi(args[0]) + if err != nil { + return err + } + var argCardsA []uint64 var argCardsB []uint64 - err = json.Unmarshal([]byte(args[2]), &argCardsA) + err = json.Unmarshal([]byte(args[1]), &argCardsA) if err != nil { return err } - err = json.Unmarshal([]byte(args[3]), &argCardsB) + err = json.Unmarshal([]byte(args[2]), &argCardsB) if err != nil { return err } @@ -42,8 +45,7 @@ func CmdReportMatch() *cobra.Command { msg := types.NewMsgReportMatch( clientCtx.GetFromAddress().String(), - argPlayerA, - argPlayerB, + uint64(argMatchId), argCardsA, argCardsB, argOutcome, diff --git a/x/cardchain/genesis.go b/x/cardchain/genesis.go index d8afb8f6..4c4e3b8d 100644 --- a/x/cardchain/genesis.go +++ b/x/cardchain/genesis.go @@ -44,9 +44,9 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) if genState.CardAuctionPrice.Denom != "" { k.SetCardAuctionPrice(ctx, genState.CardAuctionPrice) } - if genState.LastCardModified != nil { - k.SetLastCardModified(ctx, *genState.LastCardModified) - } + if genState.LastCardModified != nil { + k.SetLastCardModified(ctx, *genState.LastCardModified) + } k.Logger(ctx).Info("reading cards with id:") for currId, record := range genState.CardRecords { _, err := keywords.Unmarshal(record.Content) @@ -71,7 +71,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { params := k.GetParams(ctx) // params := types.DefaultParams() cardAuctionPrice := k.GetCardAuctionPrice(ctx) - lastCardModified := k.GetLastCardModified(ctx) + lastCardModified := k.GetLastCardModified(ctx) sellOffers := k.SellOffers.GetAll(ctx) pools := k.Pools.GetAll(ctx) records := k.Cards.GetAll(ctx) @@ -100,6 +100,6 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { Images: images, RunningAverages: runningAverages, Servers: servers, - LastCardModified: &lastCardModified, + LastCardModified: &lastCardModified, } } diff --git a/x/cardchain/keeper/card.go b/x/cardchain/keeper/card.go index d30a23d7..8d8d730f 100644 --- a/x/cardchain/keeper/card.go +++ b/x/cardchain/keeper/card.go @@ -21,22 +21,22 @@ func (k Keeper) SetCardAuctionPrice(ctx sdk.Context, price sdk.Coin) { // GetLastCardModified Returns the block height the last card was modified at func (k Keeper) GetLastCardModified(ctx sdk.Context) (timeStamp types.TimeStamp) { - store := ctx.KVStore(k.InternalStoreKey) - bz := store.Get([]byte("lastCardModified")) - k.cdc.MustUnmarshal(bz, &timeStamp) - return + store := ctx.KVStore(k.InternalStoreKey) + bz := store.Get([]byte("lastCardModified")) + k.cdc.MustUnmarshal(bz, &timeStamp) + return } // SetLastCardModified Sets the block height the last card was modified at func (k Keeper) SetLastCardModified(ctx sdk.Context, timeStamp types.TimeStamp) { - store := ctx.KVStore(k.InternalStoreKey) - store.Set([]byte("lastCardModified"), k.cdc.MustMarshal(&timeStamp)) + store := ctx.KVStore(k.InternalStoreKey) + store.Set([]byte("lastCardModified"), k.cdc.MustMarshal(&timeStamp)) } // SetLastCardModifiedNow Sets the block height the last card was modified at, to now func (k Keeper) SetLastCardModifiedNow(ctx sdk.Context) { - timeStamp := types.TimeStamp{TimeStamp: uint64(ctx.BlockHeight())} - k.SetLastCardModified(ctx, timeStamp) + timeStamp := types.TimeStamp{TimeStamp: uint64(ctx.BlockHeight())} + k.SetLastCardModified(ctx, timeStamp) } // AddOwnedCardScheme Adds a cardscheme to a user @@ -53,5 +53,5 @@ func (k Keeper) SetCardToTrial(ctx sdk.Context, cardId uint64, votePool sdk.Coin card.VotePool = card.VotePool.Add(votePool) card.Status = types.Status_trial k.Cards.Set(ctx, cardId, card) - k.SetLastCardModifiedNow(ctx) + k.SetLastCardModifiedNow(ctx) } diff --git a/x/cardchain/keeper/council.go b/x/cardchain/keeper/council.go index 61a9960b..4e8f3c86 100644 --- a/x/cardchain/keeper/council.go +++ b/x/cardchain/keeper/council.go @@ -104,7 +104,7 @@ func (k Keeper) CheckTrial(ctx sdk.Context) error { card.Status = types.Status_permanent group = approvers amt = 2 - k.SetLastCardModifiedNow(ctx) + k.SetLastCardModifiedNow(ctx) } else { card.Status = types.Status_prototype group = deniers diff --git a/x/cardchain/keeper/grpc_query_q_card.go b/x/cardchain/keeper/grpc_query_q_card.go index ebe6e7d2..cd13afae 100644 --- a/x/cardchain/keeper/grpc_query_q_card.go +++ b/x/cardchain/keeper/grpc_query_q_card.go @@ -50,7 +50,7 @@ func (k Keeper) QCard(goCtx context.Context, req *types.QueryQCardRequest) (*typ UnderpoweredVotes: card.UnderpoweredVotes, InappropriateVotes: card.InappropriateVotes, Nerflevel: card.Nerflevel, - BalanceAnchor: card.BalanceAnchor, + BalanceAnchor: card.BalanceAnchor, Hash: hash, } diff --git a/x/cardchain/keeper/grpc_query_q_cardchain_info.go b/x/cardchain/keeper/grpc_query_q_cardchain_info.go index 91b1a5a9..b344e2cc 100644 --- a/x/cardchain/keeper/grpc_query_q_cardchain_info.go +++ b/x/cardchain/keeper/grpc_query_q_cardchain_info.go @@ -25,6 +25,6 @@ func (k Keeper) QCardchainInfo(goCtx context.Context, req *types.QueryQCardchain MatchesNumber: k.Matches.GetNum(ctx), SellOffersNumber: k.SellOffers.GetNum(ctx), CouncilsNumber: k.Councils.GetNum(ctx), - LastCardModified: k.GetLastCardModified(ctx).TimeStamp, + LastCardModified: k.GetLastCardModified(ctx).TimeStamp, }, nil } diff --git a/x/cardchain/keeper/grpc_query_q_cards.go b/x/cardchain/keeper/grpc_query_q_cards.go index 0c5f09f8..f72afb6e 100644 --- a/x/cardchain/keeper/grpc_query_q_cards.go +++ b/x/cardchain/keeper/grpc_query_q_cards.go @@ -4,8 +4,8 @@ import ( "context" "encoding/json" "sort" - "strings" "strconv" + "strings" "github.com/DecentralCardGame/Cardchain/x/cardchain/types" "github.com/DecentralCardGame/cardobject/cardobject" diff --git a/x/cardchain/keeper/keeper.go b/x/cardchain/keeper/keeper.go index 27b91510..0c444457 100644 --- a/x/cardchain/keeper/keeper.go +++ b/x/cardchain/keeper/keeper.go @@ -118,10 +118,10 @@ func (k Keeper) GetLastVotingResults(ctx sdk.Context) (results types.VotingResul // NerfBuffCards Nerfes or buffs certain cards // TODO maybe the whole auto balancing stuff should be moved into its own file func (k Keeper) NerfBuffCards(ctx sdk.Context, cardIds []uint64, buff bool) { - if len(cardIds) > 0 { - k.SetLastCardModifiedNow(ctx) + if len(cardIds) > 0 { + k.SetLastCardModifiedNow(ctx) } - + for _, val := range cardIds { buffCard := k.Cards.Get(ctx, val) @@ -221,8 +221,8 @@ func (k Keeper) UpdateBanStatus(ctx sdk.Context, newBannedIds []uint64) { k.Cards.Set(ctx, id, banCard) } - if len(newBannedIds) > 0 { - k.SetLastCardModifiedNow(ctx) + if len(newBannedIds) > 0 { + k.SetLastCardModifiedNow(ctx) } } diff --git a/x/cardchain/keeper/msg_server_confirm_match.go b/x/cardchain/keeper/msg_server_confirm_match.go index 51f0c662..975cecc7 100644 --- a/x/cardchain/keeper/msg_server_confirm_match.go +++ b/x/cardchain/keeper/msg_server_confirm_match.go @@ -3,17 +3,19 @@ package keeper import ( "context" + "golang.org/x/exp/slices" + "github.com/DecentralCardGame/Cardchain/x/cardchain/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "golang.org/x/exp/slices" ) func (k msgServer) ConfirmMatch(goCtx context.Context, msg *types.MsgConfirmMatch) (*types.MsgConfirmMatchResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) var ( - player *types.MatchPlayer + player *types.MatchPlayer + otherPlayer *types.MatchPlayer ) match := k.Matches.Get(ctx, msg.MatchId) @@ -21,8 +23,10 @@ func (k msgServer) ConfirmMatch(goCtx context.Context, msg *types.MsgConfirmMatc switch msg.Creator { case match.PlayerA.Addr: player = match.PlayerA + otherPlayer = match.PlayerB case match.PlayerB.Addr: player = match.PlayerB + otherPlayer = match.PlayerA default: return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Didn't participate in match") } @@ -35,34 +39,17 @@ func (k msgServer) ConfirmMatch(goCtx context.Context, msg *types.MsgConfirmMatc } player.Outcome = msg.Outcome - player.Confirmed = true - k.Matches.Set(ctx, msg.MatchId, match) - // Report bulshit servers - if match.PlayerA.Confirmed && match.PlayerB.Confirmed { - outcomes := []types.Outcome{match.Outcome, match.PlayerA.Outcome, match.PlayerB.Outcome} - slices.Sort(outcomes) - outcomes = slices.Compact(outcomes) - switch i := uint64(len(outcomes)); i { - case 1: - k.ReportServerMatch(ctx, match.Reporter, 1, true) - default: - k.ReportServerMatch(ctx, match.Reporter, i-1, false) + // Prefilter voted cards cards + var votedCards []uint64 + for _, card := range msg.VotedCards { + if slices.Contains(otherPlayer.Deck, card) { + votedCards = append(votedCards, card) } } - outcome, err := k.GetOutcome(ctx, *match) - - // Distribute coins - if match.CoinsDistributed || err != nil { // Ensures that money isn't dropped twice - return &types.MsgConfirmMatchResponse{}, nil - } - - err = k.DistributeCoins(ctx, match, outcome) - if err != nil { - return nil, err - } - + player.VotedCards = votedCards + player.Confirmed = true k.Matches.Set(ctx, msg.MatchId, match) return &types.MsgConfirmMatchResponse{}, nil diff --git a/x/cardchain/keeper/msg_server_msg_open_match.go b/x/cardchain/keeper/msg_server_msg_open_match.go new file mode 100644 index 00000000..69c30e0d --- /dev/null +++ b/x/cardchain/keeper/msg_server_msg_open_match.go @@ -0,0 +1,37 @@ +package keeper + +import ( + "context" + "time" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/DecentralCardGame/Cardchain/x/cardchain/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) MsgOpenMatch(goCtx context.Context, msg *types.MsgMsgOpenMatch) (*types.MsgMsgOpenMatchResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + creator, err := k.GetUserFromString(ctx, msg.Creator) + if err != nil { + return nil, sdkerrors.Wrap(types.ErrUserDoesNotExist, err.Error()) + } + if creator.ReportMatches == false { + return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Incorrect Reporter") + } + + matchId := k.Matches.GetNum(ctx) + + match := types.Match{ + Timestamp: uint64(time.Now().Unix()), + Reporter: msg.Creator, + PlayerA: types.NewMatchPlayer(msg.PlayerA, []uint64{}, msg.PlayerADeck), + PlayerB: types.NewMatchPlayer(msg.PlayerB, []uint64{}, msg.PlayerBDeck), + CoinsDistributed: false, + } + + k.Matches.Set(ctx, matchId, &match) + + return &types.MsgMsgOpenMatchResponse{MatchId: matchId}, nil +} diff --git a/x/cardchain/keeper/msg_server_report_match.go b/x/cardchain/keeper/msg_server_report_match.go index fce997ed..7424d359 100644 --- a/x/cardchain/keeper/msg_server_report_match.go +++ b/x/cardchain/keeper/msg_server_report_match.go @@ -2,7 +2,8 @@ package keeper import ( "context" - "time" + + "golang.org/x/exp/slices" "github.com/DecentralCardGame/Cardchain/x/cardchain/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -12,6 +13,8 @@ import ( func (k msgServer) ReportMatch(goCtx context.Context, msg *types.MsgReportMatch) (*types.MsgReportMatchResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + match := k.Matches.Get(ctx, msg.MatchId) + creator, err := k.GetUserFromString(ctx, msg.Creator) if err != nil { return nil, sdkerrors.Wrap(types.ErrUserDoesNotExist, err.Error()) @@ -19,32 +22,40 @@ func (k msgServer) ReportMatch(goCtx context.Context, msg *types.MsgReportMatch) if creator.ReportMatches == false { return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Incorrect Reporter") } + if msg.Creator != match.Reporter { + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "Wrong Reporter, reporter is %s", match.Reporter) + } + if !match.PlayerA.Confirmed && !match.PlayerB.Confirmed { + return nil, sdkerrors.Wrapf(types.ErrWaitingForPlayers, "Waiting for players to report") + } + if !match.CoinsDistributed { + return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Match already reported") + } - matchId := k.Matches.GetNum(ctx) - - match := types.Match{ - Timestamp: uint64(time.Now().Unix()), - Reporter: msg.Creator, - PlayerA: types.NewMatchPlayer(msg.PlayerA, msg.CardsA), - PlayerB: types.NewMatchPlayer(msg.PlayerB, msg.CardsB), - Outcome: msg.Outcome, - CoinsDistributed: false, + match.Outcome = msg.Outcome + + // Evaluate Outcome + outcomes := []types.Outcome{msg.Outcome, match.PlayerA.Outcome, match.PlayerB.Outcome} + slices.Sort(outcomes) + outcomes = slices.Compact(outcomes) + switch i := uint64(len(outcomes)); i { + case 1: + k.ReportServerMatch(ctx, match.Reporter, 1, true) + default: + k.ReportServerMatch(ctx, match.Reporter, i-1, false) } - _, err = k.GetMatchAddresses(ctx, match) + outcome, err := k.GetOutcome(ctx, *match) + match.Outcome = outcome + + err = k.DistributeCoins(ctx, match, outcome) if err != nil { return nil, err } - if msg.Outcome == types.Outcome_Aborted { - err = k.DistributeCoins(ctx, &match, msg.Outcome) - if err != nil { - return nil, err - } - k.ReportServerMatch(ctx, msg.Creator, 1, true) - } + // TODO: Votes - k.Matches.Set(ctx, matchId, &match) + k.Matches.Set(ctx, msg.MatchId, match) return &types.MsgReportMatchResponse{}, nil } diff --git a/x/cardchain/keeper/voting.go b/x/cardchain/keeper/voting.go index 1a3acfef..c44678e7 100644 --- a/x/cardchain/keeper/voting.go +++ b/x/cardchain/keeper/voting.go @@ -65,7 +65,7 @@ func (k msgServer) voteCard( k.MintCoinsToAddr(ctx, voter.Addr, sdk.Coins{amount}) k.SubPoolCredits(ctx, BalancersPoolKey, amount) k.RemoveVoteRight(ctx, voter, rightsIndex) - + k.Cards.Set(ctx, cardId, card) return nil diff --git a/x/cardchain/module_simulation.go b/x/cardchain/module_simulation.go index 1bd2b4e8..6d1222c6 100644 --- a/x/cardchain/module_simulation.go +++ b/x/cardchain/module_simulation.go @@ -188,6 +188,10 @@ const ( // TODO: Determine the simulation weight value defaultWeightMsgMultiVoteCard int = 100 + opWeightMsgMsgOpenMatch = "op_weight_msg_msg_open_match" + // TODO: Determine the simulation weight value + defaultWeightMsgMsgOpenMatch int = 100 + // this line is used by starport scaffolding # simapp/module/const ) @@ -672,6 +676,17 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp cardchainsimulation.SimulateMsgMultiVoteCard(am.accountKeeper, am.bankKeeper, am.keeper), )) + var weightMsgMsgOpenMatch int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgMsgOpenMatch, &weightMsgMsgOpenMatch, nil, + func(_ *rand.Rand) { + weightMsgMsgOpenMatch = defaultWeightMsgMsgOpenMatch + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgMsgOpenMatch, + cardchainsimulation.SimulateMsgMsgOpenMatch(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations diff --git a/x/cardchain/simulation/msg_open_match.go b/x/cardchain/simulation/msg_open_match.go new file mode 100644 index 00000000..41870fbe --- /dev/null +++ b/x/cardchain/simulation/msg_open_match.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/DecentralCardGame/Cardchain/x/cardchain/keeper" + "github.com/DecentralCardGame/Cardchain/x/cardchain/types" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +func SimulateMsgMsgOpenMatch( + 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) + msg := &types.MsgMsgOpenMatch{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the MsgOpenMatch simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "MsgOpenMatch simulation not implemented"), nil, nil + } +} diff --git a/x/cardchain/types/codec.go b/x/cardchain/types/codec.go index 7bbddfba..e156875d 100644 --- a/x/cardchain/types/codec.go +++ b/x/cardchain/types/codec.go @@ -53,6 +53,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgSetUserWebsite{}, "cardchain/SetUserWebsite", nil) cdc.RegisterConcrete(&MsgSetUserBiography{}, "cardchain/SetUserBiography", nil) cdc.RegisterConcrete(&MsgMultiVoteCard{}, "cardchain/MultiVoteCard", nil) + cdc.RegisterConcrete(&MsgMsgOpenMatch{}, "cardchain/MsgOpenMatch", nil) // this line is used by starport scaffolding # 2 } @@ -189,6 +190,9 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgMultiVoteCard{}, ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgMsgOpenMatch{}, + ) // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/cardchain/types/errors.go b/x/cardchain/types/errors.go index 709793db..96829a2a 100644 --- a/x/cardchain/types/errors.go +++ b/x/cardchain/types/errors.go @@ -30,4 +30,5 @@ var ( ErrBoosterPack = sdkerrors.Register(ModuleName, 20, "Unable to open Boosterpack") ErrStringLength = sdkerrors.Register(ModuleName, 21, "String literal too long") ErrUserAlreadyExists = sdkerrors.Register(ModuleName, 22, "User already exists") + ErrWaitingForPlayers = sdkerrors.Register(ModuleName, 23, "Waiting for players") ) diff --git a/x/cardchain/types/match.pb.go b/x/cardchain/types/match.pb.go index c66361b5..5392641d 100644 --- a/x/cardchain/types/match.pb.go +++ b/x/cardchain/types/match.pb.go @@ -111,6 +111,8 @@ type MatchPlayer struct { PlayedCards []uint64 `protobuf:"varint,2,rep,packed,name=playedCards,proto3" json:"playedCards,omitempty"` Confirmed bool `protobuf:"varint,3,opt,name=confirmed,proto3" json:"confirmed,omitempty"` Outcome Outcome `protobuf:"varint,4,opt,name=outcome,proto3,enum=DecentralCardGame.cardchain.cardchain.Outcome" json:"outcome,omitempty"` + Deck []uint64 `protobuf:"varint,5,rep,packed,name=deck,proto3" json:"deck,omitempty"` + VotedCards []uint64 `protobuf:"varint,6,rep,packed,name=votedCards,proto3" json:"votedCards,omitempty"` } func (m *MatchPlayer) Reset() { *m = MatchPlayer{} } @@ -174,6 +176,20 @@ func (m *MatchPlayer) GetOutcome() Outcome { return Outcome_AWon } +func (m *MatchPlayer) GetDeck() []uint64 { + if m != nil { + return m.Deck + } + return nil +} + +func (m *MatchPlayer) GetVotedCards() []uint64 { + if m != nil { + return m.VotedCards + } + return nil +} + func init() { proto.RegisterType((*Match)(nil), "DecentralCardGame.cardchain.cardchain.Match") proto.RegisterType((*MatchPlayer)(nil), "DecentralCardGame.cardchain.cardchain.MatchPlayer") @@ -182,29 +198,30 @@ func init() { func init() { proto.RegisterFile("cardchain/cardchain/match.proto", fileDescriptor_f49b609716516c9f) } var fileDescriptor_f49b609716516c9f = []byte{ - // 344 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff,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 0x76, 0xe6, 0x85, 0x35, 0x0a, 0xd7, 0x09, 0x48, 0xce, 0xfa, 0xf4, 0x48, 0xda, 0xd3, 0xb6, - 0x8b, 0xed, 0xda, 0xd1, 0x15, 0x3c, 0x17, 0x56, 0xa7, 0xf9, 0x48, 0xe7, 0xde, 0xe9, 0xf1, 0xcc, - 0x2b, 0x89, 0x21, 0x01, 0x49, 0x83, 0x1d, 0xe8, 0xdd, 0x0f, 0x00, 0x5b, 0x25, 0x3b, 0x08, 0xc1, - 0x88, 0x4b, 0xe9, 0xc2, 0x5a, 0x9b, 0x2c, 0xd4, 0x88, 0xc0, 0x56, 0x30, 0x29, 0x37, 0x36, 0x72, - 0x5c, 0x25, 0xb5, 0x24, 0x62, 0x65, 0x69, 0xf3, 0x23, 0xc2, 0xa6, 0xaf, 0xda, 0x19, 0x25, 0xc3, - 0x66, 0x1b, 0xac, 0x10, 0xca, 0x93, 0x45, 0x27, 0x4d, 0x36, 0x60, 0x9f, 0xab, 0x18, 0x2c, 0x57, - 0x31, 0xf8, 0x59, 0xc5, 0xe0, 0x7d, 0x1d, 0x57, 0x96, 0xeb, 0xb8, 0xf2, 0xbd, 0x8e, 0x2b, 0x2f, - 0x37, 0x6f, 0xda, 0x4f, 0x66, 0x63, 0x2a, 0xac, 0xe9, 0x1d, 0xc0, 0x7b, 0xc3, 0x7d, 0x9c, 0xe6, - 0xe5, 0x68, 0x2d, 0x32, 0x95, 0x8f, 0xff, 0x87, 0x78, 0x5d, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, - 0xb4, 0x35, 0xe3, 0xdb, 0xc6, 0x02, 0x00, 0x00, + // 365 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xcf, 0x6a, 0x32, 0x31, + 0x14, 0xc5, 0x8d, 0x8e, 0xff, 0xae, 0xf0, 0xf1, 0x91, 0x55, 0x10, 0x99, 0x0e, 0x42,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x77, 0xe5, 0xf8, 0x02, 0xfe, 0x73, 0x1d, 0x27, 0xd9, 0x28, 0xce, 0xac, 0x89, 0xc7, + 0x33, 0x2b, 0x05, 0x81, 0x00, 0x85, 0x0d, 0x7a, 0xe0, 0x77, 0xbf, 0x11, 0xb4, 0x0a, 0x38, 0x18, + 0x83, 0xc7, 0x84, 0x30, 0x6e, 0xac, 0x4d, 0xea, 0x34, 0x0e, 0xa0, 0xe5, 0x20, 0xc5, 0x06, 0x23, + 0x23, 0xe5, 0xa0, 0x12, 0x7a, 0xb4, 0x68, 0x6d, 0x5e, 0x84, 0xeb, 0xe4, 0x39, 0x36, 0x4a, 0x0a, + 0x37, 0xd9, 0x06, 0xcd, 0x8d, 0x62, 0x67, 0xde, 0x69, 0x9d, 0x61, 0xf0, 0x84, 0xe4, 0xaf, 0xa4, + 0xea, 0x10, 0x9c, 0xc6, 0x3e, 0xc0, 0x9b, 0xb6, 0x3b, 0xb8, 0x9a, 0xfb, 0x53, 0x70, 0x06, 0xf4, + 0x63, 0xe5, 0xa3, 0xe5, 0xca, 0x47, 0x3f, 0x2b, 0x1f, 0xbd, 0xaf, 0xfd, 0xd2, 0x72, 0xed, 0x97, + 0xbe, 0xd6, 0x7e, 0xe9, 0xe9, 0xea, 0x25, 0xb6, 0x93, 0xd9, 0x38, 0xe2, 0x5a, 0xf5, 0x0e, 0x80, + 0x7a, 0xc3, 0xfd, 0x0a, 0xce, 0x8b, 0xeb, 0xb8, 0x48, 0x65, 0x36, 0xae, 0xb9, 0x95, 0xbc, 0xfc, + 0x0d, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x83, 0x56, 0x1b, 0xfa, 0x02, 0x00, 0x00, } func (m *Match) Marshal() (dAtA []byte, err error) { @@ -301,6 +318,42 @@ func (m *MatchPlayer) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.VotedCards) > 0 { + dAtA4 := make([]byte, len(m.VotedCards)*10) + var j3 int + for _, num := range m.VotedCards { + for num >= 1<<7 { + dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j3++ + } + dAtA4[j3] = uint8(num) + j3++ + } + i -= j3 + copy(dAtA[i:], dAtA4[:j3]) + i = encodeVarintMatch(dAtA, i, uint64(j3)) + i-- + dAtA[i] = 0x32 + } + if len(m.Deck) > 0 { + dAtA6 := make([]byte, len(m.Deck)*10) + var j5 int + for _, num := range m.Deck { + for num >= 1<<7 { + dAtA6[j5] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j5++ + } + dAtA6[j5] = uint8(num) + j5++ + } + i -= j5 + copy(dAtA[i:], dAtA6[:j5]) + i = encodeVarintMatch(dAtA, i, uint64(j5)) + i-- + dAtA[i] = 0x2a + } if m.Outcome != 0 { i = encodeVarintMatch(dAtA, i, uint64(m.Outcome)) i-- @@ -317,20 +370,20 @@ func (m *MatchPlayer) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x18 } if len(m.PlayedCards) > 0 { - dAtA4 := make([]byte, len(m.PlayedCards)*10) - var j3 int + dAtA8 := make([]byte, len(m.PlayedCards)*10) + var j7 int for _, num := range m.PlayedCards { for num >= 1<<7 { - dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) + dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j3++ + j7++ } - dAtA4[j3] = uint8(num) - j3++ + dAtA8[j7] = uint8(num) + j7++ } - i -= j3 - copy(dAtA[i:], dAtA4[:j3]) - i = encodeVarintMatch(dAtA, i, uint64(j3)) + i -= j7 + copy(dAtA[i:], dAtA8[:j7]) + i = encodeVarintMatch(dAtA, i, uint64(j7)) i-- dAtA[i] = 0x12 } @@ -408,6 +461,20 @@ func (m *MatchPlayer) Size() (n int) { if m.Outcome != 0 { n += 1 + sovMatch(uint64(m.Outcome)) } + if len(m.Deck) > 0 { + l = 0 + for _, e := range m.Deck { + l += sovMatch(uint64(e)) + } + n += 1 + sovMatch(uint64(l)) + l + } + if len(m.VotedCards) > 0 { + l = 0 + for _, e := range m.VotedCards { + l += sovMatch(uint64(e)) + } + n += 1 + sovMatch(uint64(l)) + l + } return n } @@ -805,6 +872,158 @@ func (m *MatchPlayer) Unmarshal(dAtA []byte) error { break } } + case 5: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMatch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Deck = append(m.Deck, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMatch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthMatch + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthMatch + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Deck) == 0 { + m.Deck = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMatch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Deck = append(m.Deck, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Deck", wireType) + } + case 6: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMatch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.VotedCards = append(m.VotedCards, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMatch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthMatch + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthMatch + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.VotedCards) == 0 { + m.VotedCards = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMatch + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.VotedCards = append(m.VotedCards, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field VotedCards", wireType) + } default: iNdEx = preIndex skippy, err := skipMatch(dAtA[iNdEx:]) diff --git a/x/cardchain/types/message_msg_open_match.go b/x/cardchain/types/message_msg_open_match.go new file mode 100644 index 00000000..3fa52797 --- /dev/null +++ b/x/cardchain/types/message_msg_open_match.go @@ -0,0 +1,45 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgMsgOpenMatch = "msg_open_match" + +var _ sdk.Msg = &MsgMsgOpenMatch{} + +func NewMsgMsgOpenMatch(creator string) *MsgMsgOpenMatch { + return &MsgMsgOpenMatch{ + Creator: creator, + } +} + +func (msg *MsgMsgOpenMatch) Route() string { + return RouterKey +} + +func (msg *MsgMsgOpenMatch) Type() string { + return TypeMsgMsgOpenMatch +} + +func (msg *MsgMsgOpenMatch) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgMsgOpenMatch) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgMsgOpenMatch) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + return nil +} diff --git a/x/cardchain/types/message_msg_open_match_test.go b/x/cardchain/types/message_msg_open_match_test.go new file mode 100644 index 00000000..3cb57694 --- /dev/null +++ b/x/cardchain/types/message_msg_open_match_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + "github.com/DecentralCardGame/Cardchain/testutil/sample" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgMsgOpenMatch_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgMsgOpenMatch + err error + }{ + { + name: "invalid address", + msg: MsgMsgOpenMatch{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgMsgOpenMatch{ + Creator: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/cardchain/types/message_report_match.go b/x/cardchain/types/message_report_match.go index 75d88028..ecf42e32 100644 --- a/x/cardchain/types/message_report_match.go +++ b/x/cardchain/types/message_report_match.go @@ -9,14 +9,13 @@ const TypeMsgReportMatch = "report_match" var _ sdk.Msg = &MsgReportMatch{} -func NewMsgReportMatch(creator string, playerA string, playerB string, cardsA []uint64, cardsB []uint64, outcome Outcome) *MsgReportMatch { +func NewMsgReportMatch(creator string, matchId uint64, cardsA []uint64, cardsB []uint64, outcome Outcome) *MsgReportMatch { return &MsgReportMatch{ - Creator: creator, - PlayerA: playerA, - PlayerB: playerB, - CardsA: cardsA, - CardsB: cardsB, - Outcome: outcome, + Creator: creator, + MatchId: matchId, + PlayedCardsA: cardsA, + PlayedCardsB: cardsB, + Outcome: outcome, } } diff --git a/x/cardchain/types/tx.pb.go b/x/cardchain/types/tx.pb.go index 35891b12..e2da2cb4 100644 --- a/x/cardchain/types/tx.pb.go +++ b/x/cardchain/types/tx.pb.go @@ -1043,12 +1043,11 @@ func (m *MsgRegisterForCouncilResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRegisterForCouncilResponse proto.InternalMessageInfo type MsgReportMatch struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - PlayerA string `protobuf:"bytes,2,opt,name=playerA,proto3" json:"playerA,omitempty"` - PlayerB string `protobuf:"bytes,3,opt,name=playerB,proto3" json:"playerB,omitempty"` - CardsA []uint64 `protobuf:"varint,5,rep,packed,name=cardsA,proto3" json:"cardsA,omitempty"` - CardsB []uint64 `protobuf:"varint,6,rep,packed,name=cardsB,proto3" json:"cardsB,omitempty"` - Outcome Outcome `protobuf:"varint,7,opt,name=outcome,proto3,enum=DecentralCardGame.cardchain.cardchain.Outcome" json:"outcome,omitempty"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + MatchId uint64 `protobuf:"varint,2,opt,name=matchId,proto3" json:"matchId,omitempty"` + PlayedCardsA []uint64 `protobuf:"varint,3,rep,packed,name=playedCardsA,proto3" json:"playedCardsA,omitempty"` + PlayedCardsB []uint64 `protobuf:"varint,4,rep,packed,name=playedCardsB,proto3" json:"playedCardsB,omitempty"` + Outcome Outcome `protobuf:"varint,5,opt,name=outcome,proto3,enum=DecentralCardGame.cardchain.cardchain.Outcome" json:"outcome,omitempty"` } func (m *MsgReportMatch) Reset() { *m = MsgReportMatch{} } @@ -1091,30 +1090,23 @@ func (m *MsgReportMatch) GetCreator() string { return "" } -func (m *MsgReportMatch) GetPlayerA() string { - if m != nil { - return m.PlayerA - } - return "" -} - -func (m *MsgReportMatch) GetPlayerB() string { +func (m *MsgReportMatch) GetMatchId() uint64 { if m != nil { - return m.PlayerB + return m.MatchId } - return "" + return 0 } -func (m *MsgReportMatch) GetCardsA() []uint64 { +func (m *MsgReportMatch) GetPlayedCardsA() []uint64 { if m != nil { - return m.CardsA + return m.PlayedCardsA } return nil } -func (m *MsgReportMatch) GetCardsB() []uint64 { +func (m *MsgReportMatch) GetPlayedCardsB() []uint64 { if m != nil { - return m.CardsB + return m.PlayedCardsB } return nil } @@ -3163,9 +3155,10 @@ func (m *MsgRewokeCouncilRegistrationResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRewokeCouncilRegistrationResponse proto.InternalMessageInfo type MsgConfirmMatch struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - MatchId uint64 `protobuf:"varint,2,opt,name=matchId,proto3" json:"matchId,omitempty"` - Outcome Outcome `protobuf:"varint,3,opt,name=outcome,proto3,enum=DecentralCardGame.cardchain.cardchain.Outcome" json:"outcome,omitempty"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + MatchId uint64 `protobuf:"varint,2,opt,name=matchId,proto3" json:"matchId,omitempty"` + Outcome Outcome `protobuf:"varint,3,opt,name=outcome,proto3,enum=DecentralCardGame.cardchain.cardchain.Outcome" json:"outcome,omitempty"` + VotedCards []uint64 `protobuf:"varint,4,rep,packed,name=votedCards,proto3" json:"votedCards,omitempty"` } func (m *MsgConfirmMatch) Reset() { *m = MsgConfirmMatch{} } @@ -3222,6 +3215,13 @@ func (m *MsgConfirmMatch) GetOutcome() Outcome { return Outcome_AWon } +func (m *MsgConfirmMatch) GetVotedCards() []uint64 { + if m != nil { + return m.VotedCards + } + return nil +} + type MsgConfirmMatchResponse struct { } @@ -4047,6 +4047,126 @@ func (m *MsgMultiVoteCardResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgMultiVoteCardResponse proto.InternalMessageInfo +type MsgMsgOpenMatch struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + PlayerA string `protobuf:"bytes,2,opt,name=playerA,proto3" json:"playerA,omitempty"` + PlayerB string `protobuf:"bytes,3,opt,name=playerB,proto3" json:"playerB,omitempty"` + PlayerADeck []uint64 `protobuf:"varint,4,rep,packed,name=playerADeck,proto3" json:"playerADeck,omitempty"` + PlayerBDeck []uint64 `protobuf:"varint,5,rep,packed,name=playerBDeck,proto3" json:"playerBDeck,omitempty"` +} + +func (m *MsgMsgOpenMatch) Reset() { *m = MsgMsgOpenMatch{} } +func (m *MsgMsgOpenMatch) String() string { return proto.CompactTextString(m) } +func (*MsgMsgOpenMatch) ProtoMessage() {} +func (*MsgMsgOpenMatch) Descriptor() ([]byte, []int) { + return fileDescriptor_3b4a3aba0ac94bc8, []int{83} +} +func (m *MsgMsgOpenMatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMsgOpenMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMsgOpenMatch.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 *MsgMsgOpenMatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMsgOpenMatch.Merge(m, src) +} +func (m *MsgMsgOpenMatch) XXX_Size() int { + return m.Size() +} +func (m *MsgMsgOpenMatch) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMsgOpenMatch.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMsgOpenMatch proto.InternalMessageInfo + +func (m *MsgMsgOpenMatch) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgMsgOpenMatch) GetPlayerA() string { + if m != nil { + return m.PlayerA + } + return "" +} + +func (m *MsgMsgOpenMatch) GetPlayerB() string { + if m != nil { + return m.PlayerB + } + return "" +} + +func (m *MsgMsgOpenMatch) GetPlayerADeck() []uint64 { + if m != nil { + return m.PlayerADeck + } + return nil +} + +func (m *MsgMsgOpenMatch) GetPlayerBDeck() []uint64 { + if m != nil { + return m.PlayerBDeck + } + return nil +} + +type MsgMsgOpenMatchResponse struct { + MatchId uint64 `protobuf:"varint,1,opt,name=matchId,proto3" json:"matchId,omitempty"` +} + +func (m *MsgMsgOpenMatchResponse) Reset() { *m = MsgMsgOpenMatchResponse{} } +func (m *MsgMsgOpenMatchResponse) String() string { return proto.CompactTextString(m) } +func (*MsgMsgOpenMatchResponse) ProtoMessage() {} +func (*MsgMsgOpenMatchResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3b4a3aba0ac94bc8, []int{84} +} +func (m *MsgMsgOpenMatchResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMsgOpenMatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMsgOpenMatchResponse.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 *MsgMsgOpenMatchResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMsgOpenMatchResponse.Merge(m, src) +} +func (m *MsgMsgOpenMatchResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgMsgOpenMatchResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMsgOpenMatchResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMsgOpenMatchResponse proto.InternalMessageInfo + +func (m *MsgMsgOpenMatchResponse) GetMatchId() uint64 { + if m != nil { + return m.MatchId + } + return 0 +} + func init() { proto.RegisterEnum("DecentralCardGame.cardchain.cardchain.Outcome", Outcome_name, Outcome_value) proto.RegisterType((*MsgCreateuser)(nil), "DecentralCardGame.cardchain.cardchain.MsgCreateuser") @@ -4132,165 +4252,172 @@ func init() { proto.RegisterType((*SingleVote)(nil), "DecentralCardGame.cardchain.cardchain.SingleVote") proto.RegisterType((*MsgMultiVoteCard)(nil), "DecentralCardGame.cardchain.cardchain.MsgMultiVoteCard") proto.RegisterType((*MsgMultiVoteCardResponse)(nil), "DecentralCardGame.cardchain.cardchain.MsgMultiVoteCardResponse") + proto.RegisterType((*MsgMsgOpenMatch)(nil), "DecentralCardGame.cardchain.cardchain.MsgMsgOpenMatch") + proto.RegisterType((*MsgMsgOpenMatchResponse)(nil), "DecentralCardGame.cardchain.cardchain.MsgMsgOpenMatchResponse") } func init() { proto.RegisterFile("cardchain/cardchain/tx.proto", fileDescriptor_3b4a3aba0ac94bc8) } var fileDescriptor_3b4a3aba0ac94bc8 = []byte{ - // 2445 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x5b, 0xcf, 0x8f, 0x1c, 0x47, - 0x15, 0xde, 0xde, 0xd9, 0x5f, 0x7e, 0x6b, 0x1b, 0xd3, 0x71, 0xec, 0x71, 0xdb, 0xde, 0x5d, 0x77, - 0x6c, 0xc7, 0x8a, 0x60, 0x86, 0x5d, 0x42, 0x62, 0x5b, 0x6c, 0xec, 0x99, 0xd9, 0xf5, 0xda, 0x98, - 0xc1, 0x66, 0x76, 0x1d, 0x0b, 0x82, 0x84, 0x7a, 0x7a, 0x6a, 0x67, 0x5b, 0xee, 0xe9, 0x1a, 0xaa, - 0x7b, 0x76, 0xb3, 0x91, 0x90, 0x22, 0x81, 0x10, 0x91, 0x22, 0x40, 0x11, 0x07, 0x24, 0x24, 0x94, - 0x48, 0x48, 0x48, 0x91, 0x90, 0x90, 0x40, 0xe2, 0xc8, 0x35, 0x37, 0x72, 0x8c, 0x38, 0x04, 0x64, - 0x5f, 0xf8, 0x33, 0x50, 0x57, 0x57, 0x57, 0x77, 0xf5, 0x74, 0xcf, 0x74, 0xf5, 0x0c, 0x27, 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x11, 0xac, 0x5b, 0x8a, - 0x3e, 0xce, 0x68, 0x27, 0xb4, 0xe0, 0x27, 0x2e, 0x22, 0x4f, 0x51, 0xdb, 0xb5, 0x3c, 0x34, 0xfa, - 0xbc, 0x1d, 0x05, 0x83, 0xc2, 0xbc, 0x03, 0x6b, 0x46, 0x36, 0x1c, 0x13, 0xc4, 0xb5, 0x34, 0xe9, - 0xd3, 0x94, 0xfd, 0x58, 0xb7, 0x70, 0x97, 0x18, 0xfd, 0x83, 0xe3, 0xd1, 0x57, 0x54, 0x3b, 0x1c, - 0xc6, 0x34, 0x45, 0x1d, 0xec, 0x19, 0x99, 0x14, 0xc7, 0xb5, 0xdd, 0x05, 0xd8, 0xb5, 0x9c, 0xae, - 0x8d, 0xde, 0xc6, 0x5e, 0x66, 0xce, 0x58, 0x48, 0xf9, 0xce, 0x26, 0x52, 0xbe, 0x03, 0xea, 0x45, - 0x9b, 0x03, 0xdb, 0xb3, 0x72, 0x24, 0x95, 0x77, 0x60, 0xfe, 0x90, 0xa6, 0x5f, 0x67, 0xd7, 0x4a, - 0x37, 0x96, 0x37, 0xd6, 0x73, 0x5e, 0x34, 0x11, 0xc7, 0x56, 0x80, 0x67, 0x6e, 0x57, 0x50, 0x1b, - 0x4e, 0xea, 0xb5, 0xd7, 0x61, 0x91, 0xdd, 0x4c, 0xea, 0x12, 0xcc, 0xd5, 0x9e, 0x62, 0xe7, 0xcc, - 0x8c, 0xff, 0x55, 0xf7, 0xbf, 0x14, 0xff, 0x6b, 0x8b, 0x18, 0x47, 0x67, 0x66, 0xd5, 0x65, 0x58, - 0xac, 0xb5, 0x31, 0xf1, 0x50, 0xe7, 0x4c, 0x69, 0xe3, 0x9f, 0xdf, 0x80, 0x52, 0xd3, 0xed, 0xaa, - 0xef, 0x2b, 0x00, 0xb1, 0xea, 0xc2, 0xeb, 0x39, 0x29, 0x0a, 0x85, 0x03, 0xed, 0xdb, 0x45, 0x50, - 0xfc, 0x4e, 0xf9, 0x40, 0x81, 0x53, 0x62, 0xad, 0xe1, 0xcd, 0xfc, 0xf2, 0x04, 0xa0, 0x76, 0xa7, - 0x20, 0x90, 0x73, 0x79, 0x0f, 0x96, 0xf8, 0xbe, 0x6e, 0xe4, 0x17, 0x16, 0x62, 0xb4, 0xdb, 0xf2, - 0x18, 0xae, 0xdb, 0x77, 0x70, 0xc9, 0x62, 0xc0, 0xad, 0xfc, 0xf2, 0x12, 0x50, 0xad, 0x56, 0x18, - 0xca, 0x19, 0xfd, 0x42, 0x81, 0x93, 0x42, 0x8a, 0xfe, 0x8d, 0xfc, 0x32, 0xe3, 0x38, 0xed, 0xad, - 0x62, 0x38, 0x81, 0x88, 0x90, 0xae, 0x97, 0x20, 0x12, 0xc7, 0xc9, 0x10, 0x49, 0x4b, 0xc8, 0xd3, - 0xe3, 0x12, 0x4b, 0xc7, 0x4b, 0x1c, 0x97, 0x08, 0x25, 0x73, 0x5c, 0x86, 0xf3, 0xf0, 0xea, 0x9f, - 0x14, 0x38, 0x9f, 0x95, 0x84, 0x97, 0xd9, 0xf3, 0x74, 0x11, 0xda, 0x83, 0x89, 0x45, 0x08, 0xbb, - 0x26, 0xa4, 0xe0, 0x25, 0x76, 0x2d, 0x8e, 0x93, 0xd9, 0xb5, 0xb4, 0xac, 0xbc, 0xfa, 0x3b, 0x05, - 0xd4, 0x94, 0x9c, 0xbc, 0xc4, 0x3e, 0x0c, 0xa3, 0xb5, 0xad, 0x49, 0xd0, 0x9c, 0xda, 0xcf, 0x14, - 0x58, 0x8e, 0x67, 0xf6, 0xbf, 0x25, 0x23, 0x95, 0xc3, 0xb4, 0xcd, 0x42, 0x30, 0xce, 0xe2, 0xaf, - 0x0a, 0x5c, 0x1c, 0x95, 0x50, 0xdf, 0x96, 0x35, 0x8a, 0x54, 0x31, 0x5a, 0x73, 0x2a, 0x62, 0x38, - 0xeb, 0xdf, 0x2b, 0xf0, 0x52, 0x5a, 0x22, 0x5d, 0x62, 0x31, 0x52, 0xe0, 0xda, 0xf6, 0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0xdc, 0xff, 0xdd, 0x22, 0x61, 0xac, 0x60, 0xf4, 0xf7, 0x27, 0x95, - 0xc0, 0x69, 0xfe, 0x41, 0x81, 0xb3, 0xa9, 0xc5, 0x80, 0xb7, 0xa4, 0x54, 0x0c, 0xe1, 0xb5, 0x7b, - 0x93, 0xe1, 0x05, 0xff, 0x21, 0x96, 0x06, 0x24, 0xfc, 0x87, 0x00, 0x94, 0xf1, 0x1f, 0xa9, 0xa5, - 0x00, 0xca, 0x45, 0x2c, 0x04, 0xbc, 0x29, 0x1f, 0x5a, 0x04, 0x41, 0xf0, 0x9d, 0x82, 0x40, 0xce, - 0xe5, 0x13, 0x05, 0x5e, 0x4e, 0xaf, 0x18, 0xc8, 0x88, 0x4e, 0x13, 0xa0, 0xed, 0x4c, 0x28, 0x40, - 0xe0, 0x98, 0x5e, 0x20, 0xb8, 0x23, 0x73, 0xc0, 0x52, 0x04, 0xc8, 0x70, 0x1c, 0x99, 0xe9, 0x57, - 0x3f, 0x54, 0xe0, 0x74, 0x22, 0xcf, 0x7f, 0x53, 0x46, 0x76, 0x1c, 0xa9, 0xdd, 0x2d, 0x8a, 0xe4, - 0x74, 0xfe, 0xac, 0xc0, 0x85, 0xec, 0x62, 0x40, 0x43, 0x46, 0x7e, 0x86, 0x10, 0xed, 0xe1, 0x14, - 0x84, 0x88, 0x4f, 0xd5, 0x78, 0x65, 0x41, 0xe6, 0xa9, 0x1a, 0xc3, 0x49, 0x3d, 0x55, 0x53, 0x0a, - 0x07, 0x74, 0x1f, 0x13, 0x65, 0x83, 0x9b, 0x52, 0xe7, 0x3d, 0x86, 0x94, 0xd9, 0xc7, 0xf4, 0x1a, - 0x03, 0x75, 0x48, 0xc9, 0x0a, 0x83, 0x84, 0x43, 0x4a, 0x40, 0x65, 0x1c, 0x52, 0x56, 0x05, 0xc2, - 0x7f, 0xc1, 0xa4, 0x55, 0x19, 0x36, 0xe5, 0x53, 0x4c, 0x71, 0x66, 0xdb, 0x13, 0xc1, 0xc5, 0xc0, - 0x2b, 0xab, 0xd6, 0x50, 0x97, 0xbb, 0xb8, 0xd3, 0x64, 0x48, 0x05, 0x5e, 0x63, 0x8a, 0x0e, 0x74, - 0x29, 0xd3, 0x4a, 0x0e, 0x9b, 0x05, 0x75, 0xb0, 0x6c, 0xcd, 0xf6, 0x44, 0xf0, 0xe4, 0x49, 0x88, - 0x97, 0x1f, 0xe4, 0x4e, 0x42, 0x0c, 0x29, 0x79, 0x12, 0x52, 0x2a, 0x15, 0xf4, 0x39, 0x3f, 0x54, - 0xa7, 0xb8, 0x2d, 0x2d, 0x96, 0x63, 0xb5, 0x7a, 0x71, 0xac, 0xe0, 0xc9, 0xc5, 0x62, 0x84, 0x84, - 0x27, 0x17, 0x80, 0x32, 0x9e, 0x3c, 0xb5, 0x0e, 0x51, 0x6f, 0x7d, 0xf6, 0x7c, 0x45, 0xf9, 0xfc, - 0xf9, 0x8a, 0xf2, 0x9f, 0xe7, 0x2b, 0xca, 0x6f, 0x5e, 0xac, 0xcc, 0x7c, 0xfe, 0x62, 0x65, 0xe6, - 0x8b, 0x17, 0x2b, 0x33, 0x3f, 0xbc, 0x19, 0xfb, 0xff, 0x35, 0x43, 0x4a, 0xaa, 0x0d, 0xfe, 0x97, - 0x11, 0xef, 0xc6, 0xff, 0x00, 0xe3, 0xb8, 0x8f, 0xdc, 0xf6, 0x02, 0xfd, 0x23, 0x88, 0x6f, 0xfe, - 0x2f, 0x00, 0x00, 0xff, 0xff, 0x79, 0xb6, 0x91, 0xb4, 0xa4, 0x31, 0x00, 0x00, + // 2514 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x5b, 0xcd, 0x8b, 0x1c, 0xc7, + 0x15, 0xdf, 0xde, 0x99, 0x95, 0x56, 0x6f, 0x25, 0x59, 0x69, 0xcb, 0xd2, 0xa8, 0x25, 0xed, 0xae, + 0xda, 0x92, 0x2c, 0x4c, 0x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0xcd, 0xd7, 0x42, 0xb4, 0x79, 0x8e, 0xa6, 0x41, 0x09, 0x2a, + 0x9c, 0xe9, 0x5d, 0x80, 0xf8, 0x92, 0x32, 0x86, 0x60, 0xe0, 0x38, 0x23, 0x30, 0x5f, 0x1b, 0xb1, + 0xcb, 0x3c, 0x49, 0xa7, 0xcc, 0x24, 0x09, 0x1e, 0x40, 0xe7, 0x76, 0x35, 0xcd, 0x42, 0x4c, 0xd6, + 0x13, 0xce, 0x27, 0x21, 0x91, 0xeb, 0xc3, 0x70, 0x46, 0x4a, 0x07, 0xe7, 0x68, 0x95, 0xa9, 0x99, + 0xa9, 0xf9, 0x32, 0x5c, 0xc8, 0x54, 0xc8, 0x59, 0xf5, 0x69, 0x06, 0x56, 0xed, 0x74, 0xb6, 0x83, + 0x48, 0x33, 0x5f, 0x4e, 0x34, 0x78, 0x45, 0x37, 0x65, 0xda, 0x30, 0x2f, 0xc0, 0x5a, 0x86, 0x3a, + 0xce, 0xe8, 0xfd, 0xf0, 0xce, 0xbc, 0x8d, 0x7c, 0xba, 0x5d, 0x16, 0x71, 0xfc, 0x83, 0x1c, 0x39, + 0x71, 0x92, 0x63, 0x21, 0xdd, 0x23, 0x12, 0x2a, 0x9f, 0x85, 0x5b, 0xd6, 0x32, 0x0d, 0xea, 0xca, + 0x25, 0x06, 0x9c, 0x5e, 0x83, 0xb2, 0x8b, 0x22, 0xec, 0x84, 0x94, 0x34, 0x8b, 0x1d, 0xd3, 0x20, + 0x49, 0xe1, 0x1a, 0x7e, 0xa9, 0x85, 0x3f, 0xe2, 0x3e, 0x3d, 0xca, 0xd2, 0x8f, 0x93, 0x92, 0x9b, + 0x70, 0x54, 0x9c, 0xdc, 0x30, 0xd4, 0x39, 0x38, 0xc2, 0x1e, 0x4b, 0xf8, 0x4a, 0xc4, 0x1d, 0xfa, + 0x2a, 0x80, 0x37, 0xec, 0x76, 0x91, 0x27, 0x64, 0x65, 0x42, 0x8f, 0x69, 0xc2, 0x7a, 0x16,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x4f, 0x2d, + 0xc2, 0x24, 0xf8, 0x66, 0x4e, 0x20, 0xe7, 0xf2, 0x89, 0x06, 0x2f, 0xa5, 0x17, 0x4b, 0x54, 0x44, + 0xa7, 0x09, 0x30, 0xee, 0xcc, 0x28, 0x40, 0xe2, 0x98, 0x5e, 0x1b, 0xb9, 0xa9, 0x72, 0xc0, 0x52, + 0x04, 0xa8, 0x70, 0x1c, 0x5b, 0xe4, 0xd0, 0x3f, 0xd4, 0xe0, 0x78, 0xa2, 0xc4, 0x71, 0x55, 0x45, + 0xb6, 0x88, 0x34, 0x6e, 0xe5, 0x45, 0x72, 0x3a, 0x7f, 0xd6, 0xe0, 0x4c, 0x76, 0x1d, 0xa4, 0xae, + 0x22, 0x3f, 0x43, 0x88, 0x71, 0x7f, 0x0e, 0x42, 0xe4, 0xab, 0xaa, 0x58, 0x54, 0x51, 0xb9, 0xaa, + 0x0a, 0x38, 0xa5, 0xab, 0x6a, 0x4a, 0x4d, 0x84, 0xee, 0x63, 0xa2, 0x22, 0x72, 0x55, 0xe9, 0xbc, + 0x0b, 0x48, 0x95, 0x7d, 0x4c, 0x2f, 0x9f, 0xd0, 0x80, 0x94, 0x2c, 0x9e, 0x28, 0x04, 0xa4, 0x04, + 0x54, 0x25, 0x20, 0x65, 0x15, 0x57, 0x82, 0x1b, 0x4c, 0x5a, 0x01, 0xe5, 0x86, 0xfa, 0x13, 0x93, + 0xc8, 0x6c, 0x6b, 0x26, 0xb8, 0x9c, 0x78, 0x65, 0x95, 0x51, 0x6a, 0x6a, 0x8e, 0x3b, 0x4d, 0x86, + 0x52, 0xe2, 0x35, 0xa1, 0x9e, 0x42, 0x97, 0x32, 0xad, 0x9a, 0x72, 0x23, 0xa7, 0x0e, 0xf6, 0x5a, + 0xb3, 0x35, 0x13, 0x3c, 0x79, 0x12, 0xc4, 0xca, 0x8a, 0xda, 0x49, 0x10, 0x90, 0x8a, 0x27, 0x21, + 0xa5, 0x08, 0x43, 0xaf, 0xf3, 0x23, 0x25, 0x98, 0xeb, 0xca, 0x62, 0x39, 0xd6, 0xa8, 0xe5, 0xc7, + 0x4a, 0x91, 0x5c, 0xae, 0xb3, 0x28, 0x44, 0x72, 0x09, 0xa8, 0x12, 0xc9, 0x53, 0x4b, 0x2c, 0xd4, + 0x85, 0x4a, 0xf5, 0x15, 0x05, 0x17, 0x2a, 0xe2, 0x54, 0x5c, 0x68, 0x5a, 0xa9, 0xa4, 0xd6, 0xfa, + 0xec, 0xd9, 0xaa, 0xf6, 0xf9, 0xb3, 0x55, 0xed, 0xbf, 0xcf, 0x56, 0xb5, 0x5f, 0x3f, 0x5f, 0x5d, + 0xf8, 0xfc, 0xf9, 0xea, 0xc2, 0x17, 0xcf, 0x57, 0x17, 0x7e, 0x70, 0x55, 0xf8, 0x3f, 0x4e, 0x23, + 0x3a, 0x2a, 0x75, 0xfe, 0xb7, 0x29, 0xef, 0x8a, 0x7f, 0x02, 0x73, 0x30, 0x40, 0x5e, 0xfb, 0x10, + 0xfd, 0x33, 0x94, 0xd7, 0xfe, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xf1, 0x9f, 0xdf, 0x12, 0x26, 0x33, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -4347,6 +4474,7 @@ type MsgClient interface { SetUserBiography(ctx context.Context, in *MsgSetUserBiography, opts ...grpc.CallOption) (*MsgSetUserBiographyResponse, error) // this line is used by starport scaffolding # proto/tx/rpc MultiVoteCard(ctx context.Context, in *MsgMultiVoteCard, opts ...grpc.CallOption) (*MsgMultiVoteCardResponse, error) + MsgOpenMatch(ctx context.Context, in *MsgMsgOpenMatch, opts ...grpc.CallOption) (*MsgMsgOpenMatchResponse, error) } type msgClient struct { @@ -4726,6 +4854,15 @@ func (c *msgClient) MultiVoteCard(ctx context.Context, in *MsgMultiVoteCard, opt return out, nil } +func (c *msgClient) MsgOpenMatch(ctx context.Context, in *MsgMsgOpenMatch, opts ...grpc.CallOption) (*MsgMsgOpenMatchResponse, error) { + out := new(MsgMsgOpenMatchResponse) + err := c.cc.Invoke(ctx, "/DecentralCardGame.cardchain.cardchain.Msg/MsgOpenMatch", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { Createuser(context.Context, *MsgCreateuser) (*MsgCreateuserResponse, error) @@ -4770,6 +4907,7 @@ type MsgServer interface { SetUserBiography(context.Context, *MsgSetUserBiography) (*MsgSetUserBiographyResponse, error) // this line is used by starport scaffolding # proto/tx/rpc MultiVoteCard(context.Context, *MsgMultiVoteCard) (*MsgMultiVoteCardResponse, error) + MsgOpenMatch(context.Context, *MsgMsgOpenMatch) (*MsgMsgOpenMatchResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -4899,6 +5037,9 @@ func (*UnimplementedMsgServer) SetUserBiography(ctx context.Context, req *MsgSet func (*UnimplementedMsgServer) MultiVoteCard(ctx context.Context, req *MsgMultiVoteCard) (*MsgMultiVoteCardResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiVoteCard not implemented") } +func (*UnimplementedMsgServer) MsgOpenMatch(ctx context.Context, req *MsgMsgOpenMatch) (*MsgMsgOpenMatchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgOpenMatch not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -5642,6 +5783,24 @@ func _Msg_MultiVoteCard_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Msg_MsgOpenMatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgMsgOpenMatch) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgOpenMatch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/DecentralCardGame.cardchain.cardchain.Msg/MsgOpenMatch", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgOpenMatch(ctx, req.(*MsgMsgOpenMatch)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "DecentralCardGame.cardchain.cardchain.Msg", HandlerType: (*MsgServer)(nil), @@ -5810,6 +5969,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MultiVoteCard", Handler: _Msg_MultiVoteCard_Handler, }, + { + MethodName: "MsgOpenMatch", + Handler: _Msg_MsgOpenMatch_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cardchain/cardchain/tx.proto", @@ -6545,12 +6708,12 @@ func (m *MsgReportMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.Outcome != 0 { i = encodeVarintTx(dAtA, i, uint64(m.Outcome)) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x28 } - if len(m.CardsB) > 0 { - dAtA3 := make([]byte, len(m.CardsB)*10) + if len(m.PlayedCardsB) > 0 { + dAtA3 := make([]byte, len(m.PlayedCardsB)*10) var j2 int - for _, num := range m.CardsB { + for _, num := range m.PlayedCardsB { for num >= 1<<7 { dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 @@ -6563,12 +6726,12 @@ func (m *MsgReportMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], dAtA3[:j2]) i = encodeVarintTx(dAtA, i, uint64(j2)) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x22 } - if len(m.CardsA) > 0 { - dAtA5 := make([]byte, len(m.CardsA)*10) + if len(m.PlayedCardsA) > 0 { + dAtA5 := make([]byte, len(m.PlayedCardsA)*10) var j4 int - for _, num := range m.CardsA { + for _, num := range m.PlayedCardsA { for num >= 1<<7 { dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 @@ -6581,21 +6744,12 @@ func (m *MsgReportMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], dAtA5[:j4]) i = encodeVarintTx(dAtA, i, uint64(j4)) i-- - dAtA[i] = 0x2a - } - if len(m.PlayerB) > 0 { - i -= len(m.PlayerB) - copy(dAtA[i:], m.PlayerB) - i = encodeVarintTx(dAtA, i, uint64(len(m.PlayerB))) - i-- dAtA[i] = 0x1a } - if len(m.PlayerA) > 0 { - i -= len(m.PlayerA) - copy(dAtA[i:], m.PlayerA) - i = encodeVarintTx(dAtA, i, uint64(len(m.PlayerA))) + if m.MatchId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.MatchId)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } if len(m.Creator) > 0 { i -= len(m.Creator) @@ -8007,6 +8161,24 @@ func (m *MsgConfirmMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.VotedCards) > 0 { + dAtA7 := make([]byte, len(m.VotedCards)*10) + var j6 int + for _, num := range m.VotedCards { + for num >= 1<<7 { + dAtA7[j6] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j6++ + } + dAtA7[j6] = uint8(num) + j6++ + } + i -= j6 + copy(dAtA[i:], dAtA7[:j6]) + i = encodeVarintTx(dAtA, i, uint64(j6)) + i-- + dAtA[i] = 0x22 + } if m.Outcome != 0 { i = encodeVarintTx(dAtA, i, uint64(m.Outcome)) i-- @@ -8164,20 +8336,20 @@ func (m *MsgOpenBoosterPackResponse) MarshalToSizedBuffer(dAtA []byte) (int, err var l int _ = l if len(m.CardIds) > 0 { - dAtA7 := make([]byte, len(m.CardIds)*10) - var j6 int + dAtA9 := make([]byte, len(m.CardIds)*10) + var j8 int for _, num := range m.CardIds { for num >= 1<<7 { - dAtA7[j6] = uint8(uint64(num)&0x7f | 0x80) + dAtA9[j8] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j6++ + j8++ } - dAtA7[j6] = uint8(num) - j6++ + dAtA9[j8] = uint8(num) + j8++ } - i -= j6 - copy(dAtA[i:], dAtA7[:j6]) - i = encodeVarintTx(dAtA, i, uint64(j6)) + i -= j8 + copy(dAtA[i:], dAtA9[:j8]) + i = encodeVarintTx(dAtA, i, uint64(j8)) i-- dAtA[i] = 0xa } @@ -8601,6 +8773,114 @@ func (m *MsgMultiVoteCardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *MsgMsgOpenMatch) 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 *MsgMsgOpenMatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMsgOpenMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PlayerBDeck) > 0 { + dAtA11 := make([]byte, len(m.PlayerBDeck)*10) + var j10 int + for _, num := range m.PlayerBDeck { + for num >= 1<<7 { + dAtA11[j10] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j10++ + } + dAtA11[j10] = uint8(num) + j10++ + } + i -= j10 + copy(dAtA[i:], dAtA11[:j10]) + i = encodeVarintTx(dAtA, i, uint64(j10)) + i-- + dAtA[i] = 0x2a + } + if len(m.PlayerADeck) > 0 { + dAtA13 := make([]byte, len(m.PlayerADeck)*10) + var j12 int + for _, num := range m.PlayerADeck { + for num >= 1<<7 { + dAtA13[j12] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j12++ + } + dAtA13[j12] = uint8(num) + j12++ + } + i -= j12 + copy(dAtA[i:], dAtA13[:j12]) + i = encodeVarintTx(dAtA, i, uint64(j12)) + i-- + dAtA[i] = 0x22 + } + if len(m.PlayerB) > 0 { + i -= len(m.PlayerB) + copy(dAtA[i:], m.PlayerB) + i = encodeVarintTx(dAtA, i, uint64(len(m.PlayerB))) + i-- + dAtA[i] = 0x1a + } + if len(m.PlayerA) > 0 { + i -= len(m.PlayerA) + copy(dAtA[i:], m.PlayerA) + i = encodeVarintTx(dAtA, i, uint64(len(m.PlayerA))) + 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 *MsgMsgOpenMatchResponse) 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 *MsgMsgOpenMatchResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMsgOpenMatchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MatchId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.MatchId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -8926,24 +9206,19 @@ func (m *MsgReportMatch) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.PlayerA) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.PlayerB) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.MatchId != 0 { + n += 1 + sovTx(uint64(m.MatchId)) } - if len(m.CardsA) > 0 { + if len(m.PlayedCardsA) > 0 { l = 0 - for _, e := range m.CardsA { + for _, e := range m.PlayedCardsA { l += sovTx(uint64(e)) } n += 1 + sovTx(uint64(l)) + l } - if len(m.CardsB) > 0 { + if len(m.PlayedCardsB) > 0 { l = 0 - for _, e := range m.CardsB { + for _, e := range m.PlayedCardsB { l += sovTx(uint64(e)) } n += 1 + sovTx(uint64(l)) + l @@ -9578,6 +9853,13 @@ func (m *MsgConfirmMatch) Size() (n int) { if m.Outcome != 0 { n += 1 + sovTx(uint64(m.Outcome)) } + if len(m.VotedCards) > 0 { + l = 0 + for _, e := range m.VotedCards { + l += sovTx(uint64(e)) + } + n += 1 + sovTx(uint64(l)) + l + } return n } @@ -9830,14 +10112,61 @@ func (m *MsgMultiVoteCardResponse) Size() (n int) { return n } -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgCreateuser) Unmarshal(dAtA []byte) error { - l := len(dAtA) +func (m *MsgMsgOpenMatch) 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.PlayerA) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.PlayerB) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.PlayerADeck) > 0 { + l = 0 + for _, e := range m.PlayerADeck { + l += sovTx(uint64(e)) + } + n += 1 + sovTx(uint64(l)) + l + } + if len(m.PlayerBDeck) > 0 { + l = 0 + for _, e := range m.PlayerBDeck { + l += sovTx(uint64(e)) + } + n += 1 + sovTx(uint64(l)) + l + } + return n +} + +func (m *MsgMsgOpenMatchResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MatchId != 0 { + n += 1 + sovTx(uint64(m.MatchId)) + } + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgCreateuser) Unmarshal(dAtA []byte) error { + l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx @@ -11873,10 +12202,10 @@ func (m *MsgReportMatch) Unmarshal(dAtA []byte) error { m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlayerA", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MatchId", wireType) } - var stringLen uint64 + m.MatchId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -11886,57 +12215,12 @@ func (m *MsgReportMatch) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.MatchId |= 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.PlayerA = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlayerB", 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.PlayerB = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: if wireType == 0 { var v uint64 for shift := uint(0); ; shift += 7 { @@ -11953,7 +12237,7 @@ func (m *MsgReportMatch) Unmarshal(dAtA []byte) error { break } } - m.CardsA = append(m.CardsA, v) + m.PlayedCardsA = append(m.PlayedCardsA, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { @@ -11988,8 +12272,8 @@ func (m *MsgReportMatch) Unmarshal(dAtA []byte) error { } } elementCount = count - if elementCount != 0 && len(m.CardsA) == 0 { - m.CardsA = make([]uint64, 0, elementCount) + if elementCount != 0 && len(m.PlayedCardsA) == 0 { + m.PlayedCardsA = make([]uint64, 0, elementCount) } for iNdEx < postIndex { var v uint64 @@ -12007,12 +12291,12 @@ func (m *MsgReportMatch) Unmarshal(dAtA []byte) error { break } } - m.CardsA = append(m.CardsA, v) + m.PlayedCardsA = append(m.PlayedCardsA, v) } } else { - return fmt.Errorf("proto: wrong wireType = %d for field CardsA", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PlayedCardsA", wireType) } - case 6: + case 4: if wireType == 0 { var v uint64 for shift := uint(0); ; shift += 7 { @@ -12029,7 +12313,7 @@ func (m *MsgReportMatch) Unmarshal(dAtA []byte) error { break } } - m.CardsB = append(m.CardsB, v) + m.PlayedCardsB = append(m.PlayedCardsB, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { @@ -12064,8 +12348,8 @@ func (m *MsgReportMatch) Unmarshal(dAtA []byte) error { } } elementCount = count - if elementCount != 0 && len(m.CardsB) == 0 { - m.CardsB = make([]uint64, 0, elementCount) + if elementCount != 0 && len(m.PlayedCardsB) == 0 { + m.PlayedCardsB = make([]uint64, 0, elementCount) } for iNdEx < postIndex { var v uint64 @@ -12083,12 +12367,12 @@ func (m *MsgReportMatch) Unmarshal(dAtA []byte) error { break } } - m.CardsB = append(m.CardsB, v) + m.PlayedCardsB = append(m.PlayedCardsB, v) } } else { - return fmt.Errorf("proto: wrong wireType = %d for field CardsB", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PlayedCardsB", wireType) } - case 7: + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Outcome", wireType) } @@ -16035,6 +16319,82 @@ func (m *MsgConfirmMatch) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.VotedCards = append(m.VotedCards, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.VotedCards) == 0 { + m.VotedCards = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.VotedCards = append(m.VotedCards, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field VotedCards", wireType) + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -17628,6 +17988,373 @@ func (m *MsgMultiVoteCardResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgMsgOpenMatch) 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: MsgMsgOpenMatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMsgOpenMatch: 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 PlayerA", 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.PlayerA = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PlayerB", 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.PlayerB = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PlayerADeck = append(m.PlayerADeck, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.PlayerADeck) == 0 { + m.PlayerADeck = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PlayerADeck = append(m.PlayerADeck, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field PlayerADeck", wireType) + } + case 5: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PlayerBDeck = append(m.PlayerBDeck, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.PlayerBDeck) == 0 { + m.PlayerBDeck = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PlayerBDeck = append(m.PlayerBDeck, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field PlayerBDeck", wireType) + } + 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 *MsgMsgOpenMatchResponse) 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: MsgMsgOpenMatchResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMsgOpenMatchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MatchId", wireType) + } + m.MatchId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MatchId |= 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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/cardchain/types/types.go b/x/cardchain/types/types.go index 9946f2b5..e8336e46 100644 --- a/x/cardchain/types/types.go +++ b/x/cardchain/types/types.go @@ -4,10 +4,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func NewMatchPlayer(addr string, cards []uint64) *MatchPlayer { +func NewMatchPlayer(addr string, cards []uint64, deck []uint64) *MatchPlayer { return &MatchPlayer{ Addr: addr, PlayedCards: cards, + Deck: deck, Confirmed: false, Outcome: Outcome_Aborted, }