From 66852ee4d49b32f161473abb4d83bde4bb9276a5 Mon Sep 17 00:00:00 2001 From: lxgr-linux Date: Mon, 16 Dec 2024 21:37:53 +0100 Subject: [PATCH] feat(#242): First generated txs --- docs/static/openapi.yml | 40 + gen.sh | 6 +- proto/cardchain/cardchain/tx.proto | 44 +- x/cardchain/client/cli/tx.go | 6 +- .../client/cli/tx_card_save_content.go | 57 + x/cardchain/client/cli/tx_card_scheme_buy.go | 46 + x/cardchain/client/cli/tx_card_vote.go | 48 + x/cardchain/client/cli/tx_user_create.go | 44 + .../keeper/msg_server_card_save_content.go | 17 + .../keeper/msg_server_card_scheme_buy.go | 17 + x/cardchain/keeper/msg_server_card_vote.go | 18 + x/cardchain/keeper/msg_server_user_create.go | 17 + x/cardchain/module_simulation.go | 62 +- x/cardchain/simulation/card_save_content.go | 29 + x/cardchain/simulation/card_scheme_buy.go | 29 + x/cardchain/simulation/card_vote.go | 29 + x/cardchain/simulation/user_create.go | 29 + x/cardchain/types/codec.go | 22 +- .../types/message_card_save_content.go | 50 + .../types/message_card_save_content_test.go | 40 + x/cardchain/types/message_card_scheme_buy.go | 46 + .../types/message_card_scheme_buy_test.go | 40 + x/cardchain/types/message_card_vote.go | 47 + x/cardchain/types/message_card_vote_test.go | 40 + x/cardchain/types/message_user_create.go | 47 + x/cardchain/types/message_user_create_test.go | 40 + x/cardchain/types/tx.pb.go | 2026 ++++++++++++++++- x/cardchain/types/voting.pb.go | 1135 +++++++++ 28 files changed, 4049 insertions(+), 22 deletions(-) create mode 100644 x/cardchain/client/cli/tx_card_save_content.go create mode 100644 x/cardchain/client/cli/tx_card_scheme_buy.go create mode 100644 x/cardchain/client/cli/tx_card_vote.go create mode 100644 x/cardchain/client/cli/tx_user_create.go create mode 100644 x/cardchain/keeper/msg_server_card_save_content.go create mode 100644 x/cardchain/keeper/msg_server_card_scheme_buy.go create mode 100644 x/cardchain/keeper/msg_server_card_vote.go create mode 100644 x/cardchain/keeper/msg_server_user_create.go create mode 100644 x/cardchain/simulation/card_save_content.go create mode 100644 x/cardchain/simulation/card_scheme_buy.go create mode 100644 x/cardchain/simulation/card_vote.go create mode 100644 x/cardchain/simulation/user_create.go create mode 100644 x/cardchain/types/message_card_save_content.go create mode 100644 x/cardchain/types/message_card_save_content_test.go create mode 100644 x/cardchain/types/message_card_scheme_buy.go create mode 100644 x/cardchain/types/message_card_scheme_buy_test.go create mode 100644 x/cardchain/types/message_card_vote.go create mode 100644 x/cardchain/types/message_card_vote_test.go create mode 100644 x/cardchain/types/message_user_create.go create mode 100644 x/cardchain/types/message_user_create_test.go create mode 100644 x/cardchain/types/voting.pb.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index e7d0064d..2db5b413 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -66806,6 +66806,24 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. description: Period defines a length of time and amount of coins that will vest. + decentralcardgame.cardchain.cardchain.MsgCardSaveContentResponse: + type: object + properties: + airdropClaimed: + type: boolean + decentralcardgame.cardchain.cardchain.MsgCardSchemeBuyResponse: + type: object + properties: + cardId: + type: string + format: uint64 + decentralcardgame.cardchain.cardchain.MsgCardVoteResponse: + type: object + properties: + airdropClaimed: + type: boolean + decentralcardgame.cardchain.cardchain.MsgUserCreateResponse: + type: object decentralcardgame.cardchain.cardchain.Params: type: object description: Params defines the parameters for the module. @@ -66816,6 +66834,28 @@ definitions: description: params holds all the parameters of this module. type: object description: QueryParamsResponse is response type for the Query/Params RPC method. + decentralcardgame.cardchain.cardchain.SingleVote: + type: object + properties: + cardId: + type: string + format: uint64 + voteType: + type: string + enum: + - fairEnough + - inappropriate + - overpowered + - underpowered + default: fairEnough + decentralcardgame.cardchain.cardchain.VoteType: + type: string + enum: + - fairEnough + - inappropriate + - overpowered + - underpowered + default: fairEnough ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse: type: object properties: diff --git a/gen.sh b/gen.sh index b203a988..ad801a38 100755 --- a/gen.sh +++ b/gen.sh @@ -1,6 +1,6 @@ #!/usr/bin/sh -#ignite scaffold message UserCreate newUser:string alias:string -#ignite scaffold message CardSchemeBuy bid:coin --response cardId:uint -#ignite scaffold message CardSaveContent cardId:uint content:string notes:string artist:string balanceAnchor:bool --response airdropClaimed:bool +ignite scaffold message UserCreate newUser:string alias:string +ignite scaffold message CardSchemeBuy bid:coin --response cardId:uint +ignite scaffold message CardSaveContent cardId:uint content:string notes:string artist:string balanceAnchor:bool --response airdropClaimed:bool ignite scaffold message CardVote vote:SingleVote --response airdropClaimed:bool diff --git a/proto/cardchain/cardchain/tx.proto b/proto/cardchain/cardchain/tx.proto index 63af8c5c..06fccfcc 100644 --- a/proto/cardchain/cardchain/tx.proto +++ b/proto/cardchain/cardchain/tx.proto @@ -1,7 +1,49 @@ syntax = "proto3"; + package decentralcardgame.cardchain.cardchain; option go_package = "github.com/DecentralCardGame/cardchain/x/cardchain/types"; +import "cardchain/cardchain/voting.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + // Msg defines the Msg service. -service Msg {} \ No newline at end of file +service Msg { + rpc UserCreate(MsgUserCreate) returns (MsgUserCreateResponse); + rpc CardSchemeBuy(MsgCardSchemeBuy) returns (MsgCardSchemeBuyResponse); + rpc CardSaveContent(MsgCardSaveContent) returns (MsgCardSaveContentResponse); + rpc CardVote(MsgCardVote) returns (MsgCardVoteResponse); +} +message MsgUserCreate { + string creator = 1; + string newUser = 2; + string alias = 3; +} + +message MsgUserCreateResponse {} + +message MsgCardSchemeBuy { + string creator = 1; + cosmos.base.v1beta1.Coin bid = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgCardSchemeBuyResponse { uint64 cardId = 1; } + +message MsgCardSaveContent { + string creator = 1; + uint64 cardId = 2; + string content = 3; + string notes = 4; + string artist = 5; + bool balanceAnchor = 6; +} + +message MsgCardSaveContentResponse { bool airdropClaimed = 1; } + +message MsgCardVote { + string creator = 1; + SingleVote vote = 2; +} + +message MsgCardVoteResponse { bool airdropClaimed = 1; } diff --git a/x/cardchain/client/cli/tx.go b/x/cardchain/client/cli/tx.go index fd92b849..d7e73bf0 100644 --- a/x/cardchain/client/cli/tx.go +++ b/x/cardchain/client/cli/tx.go @@ -30,7 +30,11 @@ func GetTxCmd() *cobra.Command { RunE: client.ValidateCmd, } - // this line is used by starport scaffolding # 1 + cmd.AddCommand(CmdUserCreate()) + cmd.AddCommand(CmdCardSchemeBuy()) + cmd.AddCommand(CmdCardSaveContent()) + cmd.AddCommand(CmdCardVote()) +// this line is used by starport scaffolding # 1 return cmd } diff --git a/x/cardchain/client/cli/tx_card_save_content.go b/x/cardchain/client/cli/tx_card_save_content.go new file mode 100644 index 00000000..d8ed4f77 --- /dev/null +++ b/x/cardchain/client/cli/tx_card_save_content.go @@ -0,0 +1,57 @@ +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/cast" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdCardSaveContent() *cobra.Command { + cmd := &cobra.Command{ + Use: "card-save-content [card-id] [content] [notes] [artist] [balance-anchor]", + Short: "Broadcast message CardSaveContent", + Args: cobra.ExactArgs(5), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argCardId, err := cast.ToUint64E(args[0]) + if err != nil { + return err + } + argContent := args[1] + argNotes := args[2] + argArtist := args[3] + argBalanceAnchor, err := cast.ToBoolE(args[4]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgCardSaveContent( + clientCtx.GetFromAddress().String(), + argCardId, + argContent, + argNotes, + argArtist, + argBalanceAnchor, + ) + 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_card_scheme_buy.go b/x/cardchain/client/cli/tx_card_scheme_buy.go new file mode 100644 index 00000000..601ef20b --- /dev/null +++ b/x/cardchain/client/cli/tx_card_scheme_buy.go @@ -0,0 +1,46 @@ +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" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdCardSchemeBuy() *cobra.Command { + cmd := &cobra.Command{ + Use: "card-scheme-buy [bid]", + Short: "Broadcast message CardSchemeBuy", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argBid, err := sdk.ParseCoinNormalized(args[0]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgCardSchemeBuy( + clientCtx.GetFromAddress().String(), + argBid, + ) + 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_card_vote.go b/x/cardchain/client/cli/tx_card_vote.go new file mode 100644 index 00000000..b67683d5 --- /dev/null +++ b/x/cardchain/client/cli/tx_card_vote.go @@ -0,0 +1,48 @@ +package cli + +import ( + "strconv" + + "encoding/json" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/DecentralCardGame/cardchain/x/cardchain/types" +) + +var _ = strconv.Itoa(0) + +func CmdCardVote() *cobra.Command { + cmd := &cobra.Command{ + Use: "card-vote [vote]", + Short: "Broadcast message CardVote", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argVote := new(types.SingleVote) + err = json.Unmarshal([]byte(args[0]), argVote) + if err != nil { + return err + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgCardVote( + clientCtx.GetFromAddress().String(), + argVote, + + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} \ No newline at end of file diff --git a/x/cardchain/client/cli/tx_user_create.go b/x/cardchain/client/cli/tx_user_create.go new file mode 100644 index 00000000..2d9bad0e --- /dev/null +++ b/x/cardchain/client/cli/tx_user_create.go @@ -0,0 +1,44 @@ +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 CmdUserCreate() *cobra.Command { + cmd := &cobra.Command{ + Use: "user-create [new-user] [alias]", + Short: "Broadcast message UserCreate", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argNewUser := args[0] + argAlias := args[1] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgUserCreate( + clientCtx.GetFromAddress().String(), + argNewUser, + argAlias, + ) + 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/keeper/msg_server_card_save_content.go b/x/cardchain/keeper/msg_server_card_save_content.go new file mode 100644 index 00000000..77499b72 --- /dev/null +++ b/x/cardchain/keeper/msg_server_card_save_content.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "context" + + "github.com/DecentralCardGame/cardchain/x/cardchain/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) CardSaveContent(goCtx context.Context, msg *types.MsgCardSaveContent) (*types.MsgCardSaveContentResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: Handling the message + _ = ctx + + return &types.MsgCardSaveContentResponse{}, nil +} diff --git a/x/cardchain/keeper/msg_server_card_scheme_buy.go b/x/cardchain/keeper/msg_server_card_scheme_buy.go new file mode 100644 index 00000000..4874750e --- /dev/null +++ b/x/cardchain/keeper/msg_server_card_scheme_buy.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "context" + + "github.com/DecentralCardGame/cardchain/x/cardchain/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) CardSchemeBuy(goCtx context.Context, msg *types.MsgCardSchemeBuy) (*types.MsgCardSchemeBuyResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: Handling the message + _ = ctx + + return &types.MsgCardSchemeBuyResponse{}, nil +} diff --git a/x/cardchain/keeper/msg_server_card_vote.go b/x/cardchain/keeper/msg_server_card_vote.go new file mode 100644 index 00000000..4c4e627a --- /dev/null +++ b/x/cardchain/keeper/msg_server_card_vote.go @@ -0,0 +1,18 @@ +package keeper + +import ( + "context" + + "github.com/DecentralCardGame/cardchain/x/cardchain/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + + +func (k msgServer) CardVote(goCtx context.Context, msg *types.MsgCardVote) (*types.MsgCardVoteResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: Handling the message + _ = ctx + + return &types.MsgCardVoteResponse{}, nil +} diff --git a/x/cardchain/keeper/msg_server_user_create.go b/x/cardchain/keeper/msg_server_user_create.go new file mode 100644 index 00000000..9551a5f8 --- /dev/null +++ b/x/cardchain/keeper/msg_server_user_create.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "context" + + "github.com/DecentralCardGame/cardchain/x/cardchain/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) UserCreate(goCtx context.Context, msg *types.MsgUserCreate) (*types.MsgUserCreateResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: Handling the message + _ = ctx + + return &types.MsgUserCreateResponse{}, nil +} diff --git a/x/cardchain/module_simulation.go b/x/cardchain/module_simulation.go index 075b38f4..ebcfab78 100644 --- a/x/cardchain/module_simulation.go +++ b/x/cardchain/module_simulation.go @@ -24,7 +24,23 @@ var ( ) const ( -// this line is used by starport scaffolding # simapp/module/const + opWeightMsgUserCreate = "op_weight_msg_user_create" + // TODO: Determine the simulation weight value + defaultWeightMsgUserCreate int = 100 + + opWeightMsgCardSchemeBuy = "op_weight_msg_card_scheme_buy" + // TODO: Determine the simulation weight value + defaultWeightMsgCardSchemeBuy int = 100 + + opWeightMsgCardSaveContent = "op_weight_msg_card_save_content" + // TODO: Determine the simulation weight value + defaultWeightMsgCardSaveContent int = 100 + + opWeightMsgCardVote = "op_weight_msg_card_vote" + // TODO: Determine the simulation weight value + defaultWeightMsgCardVote int = 100 + + // this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module @@ -58,6 +74,50 @@ func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) + var weightMsgUserCreate int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUserCreate, &weightMsgUserCreate, nil, + func(_ *rand.Rand) { + weightMsgUserCreate = defaultWeightMsgUserCreate + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgUserCreate, + cardchainsimulation.SimulateMsgUserCreate(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgCardSchemeBuy int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgCardSchemeBuy, &weightMsgCardSchemeBuy, nil, + func(_ *rand.Rand) { + weightMsgCardSchemeBuy = defaultWeightMsgCardSchemeBuy + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgCardSchemeBuy, + cardchainsimulation.SimulateMsgCardSchemeBuy(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgCardSaveContent int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgCardSaveContent, &weightMsgCardSaveContent, nil, + func(_ *rand.Rand) { + weightMsgCardSaveContent = defaultWeightMsgCardSaveContent + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgCardSaveContent, + cardchainsimulation.SimulateMsgCardSaveContent(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgCardVote int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgCardVote, &weightMsgCardVote, nil, + func(_ *rand.Rand) { + weightMsgCardVote = defaultWeightMsgCardVote + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgCardVote, + cardchainsimulation.SimulateMsgCardVote(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations diff --git a/x/cardchain/simulation/card_save_content.go b/x/cardchain/simulation/card_save_content.go new file mode 100644 index 00000000..fcc7f8ce --- /dev/null +++ b/x/cardchain/simulation/card_save_content.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 SimulateMsgCardSaveContent( + 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.MsgCardSaveContent{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the CardSaveContent simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "CardSaveContent simulation not implemented"), nil, nil + } +} diff --git a/x/cardchain/simulation/card_scheme_buy.go b/x/cardchain/simulation/card_scheme_buy.go new file mode 100644 index 00000000..e6439960 --- /dev/null +++ b/x/cardchain/simulation/card_scheme_buy.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 SimulateMsgCardSchemeBuy( + 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.MsgCardSchemeBuy{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the CardSchemeBuy simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "CardSchemeBuy simulation not implemented"), nil, nil + } +} diff --git a/x/cardchain/simulation/card_vote.go b/x/cardchain/simulation/card_vote.go new file mode 100644 index 00000000..b9a54113 --- /dev/null +++ b/x/cardchain/simulation/card_vote.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 SimulateMsgCardVote( + 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.MsgCardVote{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the CardVote simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "CardVote simulation not implemented"), nil, nil + } +} diff --git a/x/cardchain/simulation/user_create.go b/x/cardchain/simulation/user_create.go new file mode 100644 index 00000000..95775fcb --- /dev/null +++ b/x/cardchain/simulation/user_create.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 SimulateMsgUserCreate( + 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.MsgUserCreate{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the UserCreate simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "UserCreate simulation not implemented"), nil, nil + } +} diff --git a/x/cardchain/types/codec.go b/x/cardchain/types/codec.go index 844157a8..33b34792 100644 --- a/x/cardchain/types/codec.go +++ b/x/cardchain/types/codec.go @@ -3,16 +3,32 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - // this line is used by starport scaffolding # 1 + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) func RegisterCodec(cdc *codec.LegacyAmino) { - // this line is used by starport scaffolding # 2 + cdc.RegisterConcrete(&MsgUserCreate{}, "cardchain/UserCreate", nil) + cdc.RegisterConcrete(&MsgCardSchemeBuy{}, "cardchain/CardSchemeBuy", nil) + cdc.RegisterConcrete(&MsgCardSaveContent{}, "cardchain/CardSaveContent", nil) + cdc.RegisterConcrete(&MsgCardVote{}, "cardchain/CardVote", nil) +// this line is used by starport scaffolding # 2 } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - // this line is used by starport scaffolding # 3 + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUserCreate{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgCardSchemeBuy{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgCardSaveContent{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgCardVote{}, +) +// this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/cardchain/types/message_card_save_content.go b/x/cardchain/types/message_card_save_content.go new file mode 100644 index 00000000..6650abf5 --- /dev/null +++ b/x/cardchain/types/message_card_save_content.go @@ -0,0 +1,50 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgCardSaveContent = "card_save_content" + +var _ sdk.Msg = &MsgCardSaveContent{} + +func NewMsgCardSaveContent(creator string, cardId uint64, content string, notes string, artist string, balanceAnchor bool) *MsgCardSaveContent { + return &MsgCardSaveContent{ + Creator: creator, + CardId: cardId, + Content: content, + Notes: notes, + Artist: artist, + BalanceAnchor: balanceAnchor, + } +} + +func (msg *MsgCardSaveContent) Route() string { + return RouterKey +} + +func (msg *MsgCardSaveContent) Type() string { + return TypeMsgCardSaveContent +} + +func (msg *MsgCardSaveContent) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgCardSaveContent) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgCardSaveContent) 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_card_save_content_test.go b/x/cardchain/types/message_card_save_content_test.go new file mode 100644 index 00000000..35bd8c19 --- /dev/null +++ b/x/cardchain/types/message_card_save_content_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 TestMsgCardSaveContent_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgCardSaveContent + err error + }{ + { + name: "invalid address", + msg: MsgCardSaveContent{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgCardSaveContent{ + 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_card_scheme_buy.go b/x/cardchain/types/message_card_scheme_buy.go new file mode 100644 index 00000000..75794aba --- /dev/null +++ b/x/cardchain/types/message_card_scheme_buy.go @@ -0,0 +1,46 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgCardSchemeBuy = "card_scheme_buy" + +var _ sdk.Msg = &MsgCardSchemeBuy{} + +func NewMsgCardSchemeBuy(creator string, bid sdk.Coin) *MsgCardSchemeBuy { + return &MsgCardSchemeBuy{ + Creator: creator, + Bid: bid, + } +} + +func (msg *MsgCardSchemeBuy) Route() string { + return RouterKey +} + +func (msg *MsgCardSchemeBuy) Type() string { + return TypeMsgCardSchemeBuy +} + +func (msg *MsgCardSchemeBuy) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgCardSchemeBuy) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgCardSchemeBuy) 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_card_scheme_buy_test.go b/x/cardchain/types/message_card_scheme_buy_test.go new file mode 100644 index 00000000..cdf8a8f2 --- /dev/null +++ b/x/cardchain/types/message_card_scheme_buy_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 TestMsgCardSchemeBuy_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgCardSchemeBuy + err error + }{ + { + name: "invalid address", + msg: MsgCardSchemeBuy{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgCardSchemeBuy{ + 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_card_vote.go b/x/cardchain/types/message_card_vote.go new file mode 100644 index 00000000..4fb490ef --- /dev/null +++ b/x/cardchain/types/message_card_vote.go @@ -0,0 +1,47 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgCardVote = "card_vote" + +var _ sdk.Msg = &MsgCardVote{} + +func NewMsgCardVote(creator string, vote *SingleVote) *MsgCardVote { + return &MsgCardVote{ + Creator: creator, + Vote: vote, + } +} + +func (msg *MsgCardVote) Route() string { + return RouterKey +} + +func (msg *MsgCardVote) Type() string { + return TypeMsgCardVote +} + +func (msg *MsgCardVote) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgCardVote) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgCardVote) 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_card_vote_test.go b/x/cardchain/types/message_card_vote_test.go new file mode 100644 index 00000000..51172d18 --- /dev/null +++ b/x/cardchain/types/message_card_vote_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" + "github.com/DecentralCardGame/cardchain/testutil/sample" +) + +func TestMsgCardVote_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgCardVote + err error + }{ + { + name: "invalid address", + msg: MsgCardVote{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgCardVote{ + 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_user_create.go b/x/cardchain/types/message_user_create.go new file mode 100644 index 00000000..f9d08386 --- /dev/null +++ b/x/cardchain/types/message_user_create.go @@ -0,0 +1,47 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgUserCreate = "user_create" + +var _ sdk.Msg = &MsgUserCreate{} + +func NewMsgUserCreate(creator string, newUser string, alias string) *MsgUserCreate { + return &MsgUserCreate{ + Creator: creator, + NewUser: newUser, + Alias: alias, + } +} + +func (msg *MsgUserCreate) Route() string { + return RouterKey +} + +func (msg *MsgUserCreate) Type() string { + return TypeMsgUserCreate +} + +func (msg *MsgUserCreate) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgUserCreate) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgUserCreate) 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_user_create_test.go b/x/cardchain/types/message_user_create_test.go new file mode 100644 index 00000000..1b8695e7 --- /dev/null +++ b/x/cardchain/types/message_user_create_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 TestMsgUserCreate_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgUserCreate + err error + }{ + { + name: "invalid address", + msg: MsgUserCreate{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgUserCreate{ + 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/tx.pb.go b/x/cardchain/types/tx.pb.go index 2ef99912..eab6228b 100644 --- a/x/cardchain/types/tx.pb.go +++ b/x/cardchain/types/tx.pb.go @@ -6,10 +6,16 @@ package types import ( context "context" fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -23,19 +29,472 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type MsgUserCreate struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + NewUser string `protobuf:"bytes,2,opt,name=newUser,proto3" json:"newUser,omitempty"` + Alias string `protobuf:"bytes,3,opt,name=alias,proto3" json:"alias,omitempty"` +} + +func (m *MsgUserCreate) Reset() { *m = MsgUserCreate{} } +func (m *MsgUserCreate) String() string { return proto.CompactTextString(m) } +func (*MsgUserCreate) ProtoMessage() {} +func (*MsgUserCreate) Descriptor() ([]byte, []int) { + return fileDescriptor_3b4a3aba0ac94bc8, []int{0} +} +func (m *MsgUserCreate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUserCreate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUserCreate.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 *MsgUserCreate) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUserCreate.Merge(m, src) +} +func (m *MsgUserCreate) XXX_Size() int { + return m.Size() +} +func (m *MsgUserCreate) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUserCreate.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUserCreate proto.InternalMessageInfo + +func (m *MsgUserCreate) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUserCreate) GetNewUser() string { + if m != nil { + return m.NewUser + } + return "" +} + +func (m *MsgUserCreate) GetAlias() string { + if m != nil { + return m.Alias + } + return "" +} + +type MsgUserCreateResponse struct { +} + +func (m *MsgUserCreateResponse) Reset() { *m = MsgUserCreateResponse{} } +func (m *MsgUserCreateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUserCreateResponse) ProtoMessage() {} +func (*MsgUserCreateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3b4a3aba0ac94bc8, []int{1} +} +func (m *MsgUserCreateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUserCreateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUserCreateResponse.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 *MsgUserCreateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUserCreateResponse.Merge(m, src) +} +func (m *MsgUserCreateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUserCreateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUserCreateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUserCreateResponse proto.InternalMessageInfo + +type MsgCardSchemeBuy struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Bid types.Coin `protobuf:"bytes,2,opt,name=bid,proto3" json:"bid"` +} + +func (m *MsgCardSchemeBuy) Reset() { *m = MsgCardSchemeBuy{} } +func (m *MsgCardSchemeBuy) String() string { return proto.CompactTextString(m) } +func (*MsgCardSchemeBuy) ProtoMessage() {} +func (*MsgCardSchemeBuy) Descriptor() ([]byte, []int) { + return fileDescriptor_3b4a3aba0ac94bc8, []int{2} +} +func (m *MsgCardSchemeBuy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCardSchemeBuy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCardSchemeBuy.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 *MsgCardSchemeBuy) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCardSchemeBuy.Merge(m, src) +} +func (m *MsgCardSchemeBuy) XXX_Size() int { + return m.Size() +} +func (m *MsgCardSchemeBuy) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCardSchemeBuy.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCardSchemeBuy proto.InternalMessageInfo + +func (m *MsgCardSchemeBuy) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgCardSchemeBuy) GetBid() types.Coin { + if m != nil { + return m.Bid + } + return types.Coin{} +} + +type MsgCardSchemeBuyResponse struct { + CardId uint64 `protobuf:"varint,1,opt,name=cardId,proto3" json:"cardId,omitempty"` +} + +func (m *MsgCardSchemeBuyResponse) Reset() { *m = MsgCardSchemeBuyResponse{} } +func (m *MsgCardSchemeBuyResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCardSchemeBuyResponse) ProtoMessage() {} +func (*MsgCardSchemeBuyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3b4a3aba0ac94bc8, []int{3} +} +func (m *MsgCardSchemeBuyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCardSchemeBuyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCardSchemeBuyResponse.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 *MsgCardSchemeBuyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCardSchemeBuyResponse.Merge(m, src) +} +func (m *MsgCardSchemeBuyResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCardSchemeBuyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCardSchemeBuyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCardSchemeBuyResponse proto.InternalMessageInfo + +func (m *MsgCardSchemeBuyResponse) GetCardId() uint64 { + if m != nil { + return m.CardId + } + return 0 +} + +type MsgCardSaveContent struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + CardId uint64 `protobuf:"varint,2,opt,name=cardId,proto3" json:"cardId,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` + Notes string `protobuf:"bytes,4,opt,name=notes,proto3" json:"notes,omitempty"` + Artist string `protobuf:"bytes,5,opt,name=artist,proto3" json:"artist,omitempty"` + BalanceAnchor bool `protobuf:"varint,6,opt,name=balanceAnchor,proto3" json:"balanceAnchor,omitempty"` +} + +func (m *MsgCardSaveContent) Reset() { *m = MsgCardSaveContent{} } +func (m *MsgCardSaveContent) String() string { return proto.CompactTextString(m) } +func (*MsgCardSaveContent) ProtoMessage() {} +func (*MsgCardSaveContent) Descriptor() ([]byte, []int) { + return fileDescriptor_3b4a3aba0ac94bc8, []int{4} +} +func (m *MsgCardSaveContent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCardSaveContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCardSaveContent.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 *MsgCardSaveContent) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCardSaveContent.Merge(m, src) +} +func (m *MsgCardSaveContent) XXX_Size() int { + return m.Size() +} +func (m *MsgCardSaveContent) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCardSaveContent.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCardSaveContent proto.InternalMessageInfo + +func (m *MsgCardSaveContent) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgCardSaveContent) GetCardId() uint64 { + if m != nil { + return m.CardId + } + return 0 +} + +func (m *MsgCardSaveContent) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *MsgCardSaveContent) GetNotes() string { + if m != nil { + return m.Notes + } + return "" +} + +func (m *MsgCardSaveContent) GetArtist() string { + if m != nil { + return m.Artist + } + return "" +} + +func (m *MsgCardSaveContent) GetBalanceAnchor() bool { + if m != nil { + return m.BalanceAnchor + } + return false +} + +type MsgCardSaveContentResponse struct { + AirdropClaimed bool `protobuf:"varint,1,opt,name=airdropClaimed,proto3" json:"airdropClaimed,omitempty"` +} + +func (m *MsgCardSaveContentResponse) Reset() { *m = MsgCardSaveContentResponse{} } +func (m *MsgCardSaveContentResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCardSaveContentResponse) ProtoMessage() {} +func (*MsgCardSaveContentResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3b4a3aba0ac94bc8, []int{5} +} +func (m *MsgCardSaveContentResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCardSaveContentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCardSaveContentResponse.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 *MsgCardSaveContentResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCardSaveContentResponse.Merge(m, src) +} +func (m *MsgCardSaveContentResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCardSaveContentResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCardSaveContentResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCardSaveContentResponse proto.InternalMessageInfo + +func (m *MsgCardSaveContentResponse) GetAirdropClaimed() bool { + if m != nil { + return m.AirdropClaimed + } + return false +} + +type MsgCardVote struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Vote *SingleVote `protobuf:"bytes,2,opt,name=vote,proto3" json:"vote,omitempty"` +} + +func (m *MsgCardVote) Reset() { *m = MsgCardVote{} } +func (m *MsgCardVote) String() string { return proto.CompactTextString(m) } +func (*MsgCardVote) ProtoMessage() {} +func (*MsgCardVote) Descriptor() ([]byte, []int) { + return fileDescriptor_3b4a3aba0ac94bc8, []int{6} +} +func (m *MsgCardVote) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCardVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCardVote.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 *MsgCardVote) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCardVote.Merge(m, src) +} +func (m *MsgCardVote) XXX_Size() int { + return m.Size() +} +func (m *MsgCardVote) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCardVote.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCardVote proto.InternalMessageInfo + +func (m *MsgCardVote) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgCardVote) GetVote() *SingleVote { + if m != nil { + return m.Vote + } + return nil +} + +type MsgCardVoteResponse struct { + AirdropClaimed bool `protobuf:"varint,1,opt,name=airdropClaimed,proto3" json:"airdropClaimed,omitempty"` +} + +func (m *MsgCardVoteResponse) Reset() { *m = MsgCardVoteResponse{} } +func (m *MsgCardVoteResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCardVoteResponse) ProtoMessage() {} +func (*MsgCardVoteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3b4a3aba0ac94bc8, []int{7} +} +func (m *MsgCardVoteResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCardVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCardVoteResponse.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 *MsgCardVoteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCardVoteResponse.Merge(m, src) +} +func (m *MsgCardVoteResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCardVoteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCardVoteResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCardVoteResponse proto.InternalMessageInfo + +func (m *MsgCardVoteResponse) GetAirdropClaimed() bool { + if m != nil { + return m.AirdropClaimed + } + return false +} + +func init() { + proto.RegisterType((*MsgUserCreate)(nil), "decentralcardgame.cardchain.cardchain.MsgUserCreate") + proto.RegisterType((*MsgUserCreateResponse)(nil), "decentralcardgame.cardchain.cardchain.MsgUserCreateResponse") + proto.RegisterType((*MsgCardSchemeBuy)(nil), "decentralcardgame.cardchain.cardchain.MsgCardSchemeBuy") + proto.RegisterType((*MsgCardSchemeBuyResponse)(nil), "decentralcardgame.cardchain.cardchain.MsgCardSchemeBuyResponse") + proto.RegisterType((*MsgCardSaveContent)(nil), "decentralcardgame.cardchain.cardchain.MsgCardSaveContent") + proto.RegisterType((*MsgCardSaveContentResponse)(nil), "decentralcardgame.cardchain.cardchain.MsgCardSaveContentResponse") + proto.RegisterType((*MsgCardVote)(nil), "decentralcardgame.cardchain.cardchain.MsgCardVote") + proto.RegisterType((*MsgCardVoteResponse)(nil), "decentralcardgame.cardchain.cardchain.MsgCardVoteResponse") +} + func init() { proto.RegisterFile("cardchain/cardchain/tx.proto", fileDescriptor_3b4a3aba0ac94bc8) } var fileDescriptor_3b4a3aba0ac94bc8 = []byte{ - // 141 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0x4e, 0x2c, 0x4a, - 0x49, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x47, 0xb0, 0x4a, 0x2a, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, - 0x85, 0x54, 0x53, 0x52, 0x93, 0x53, 0xf3, 0x4a, 0x8a, 0x12, 0x73, 0x40, 0x92, 0xe9, 0x89, 0xb9, - 0xa9, 0x7a, 0x70, 0x55, 0x08, 0x96, 0x11, 0x2b, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x53, 0xd0, 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, 0x59, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, - 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xbb, 0xc0, 0x8c, 0x74, 0x4e, 0x2c, 0x4a, 0x71, 0x4f, 0xcc, 0x4d, - 0x45, 0xb2, 0xb8, 0x02, 0xd9, 0x11, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x87, 0x18, 0x03, - 0x02, 0x00, 0x00, 0xff, 0xff, 0x88, 0x30, 0xd7, 0xab, 0xa8, 0x00, 0x00, 0x00, + // 557 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcd, 0x8a, 0xd3, 0x50, + 0x14, 0x6e, 0xa6, 0x9d, 0x5a, 0xcf, 0x50, 0x95, 0x38, 0x6a, 0x0c, 0x12, 0x4b, 0x50, 0x99, 0x55, + 0x42, 0xab, 0xe0, 0x0f, 0x8a, 0x4c, 0x3b, 0x22, 0x2e, 0xba, 0xc9, 0xa0, 0xa0, 0x1b, 0xb9, 0x49, + 0x0e, 0x69, 0xa0, 0xb9, 0xb7, 0xdc, 0x7b, 0xa7, 0xce, 0xb8, 0x72, 0xeb, 0x4a, 0x9f, 0xc1, 0x67, + 0xf0, 0x21, 0x66, 0x39, 0x4b, 0x57, 0x22, 0xed, 0x8b, 0xc8, 0xcd, 0x5f, 0x7f, 0x94, 0xd2, 0x76, + 0x77, 0x7e, 0xf2, 0x7d, 0xe7, 0x3b, 0x27, 0x1f, 0x17, 0xee, 0x04, 0x84, 0x87, 0xc1, 0x80, 0xc4, + 0xd4, 0x9d, 0x45, 0xf2, 0xd4, 0x19, 0x71, 0x26, 0x99, 0x7e, 0x3f, 0xc4, 0x00, 0xa9, 0xe4, 0x64, + 0xa8, 0x9a, 0x11, 0x49, 0xd0, 0x29, 0xbf, 0x9a, 0x45, 0x66, 0xeb, 0x7f, 0x24, 0x63, 0x26, 0x63, + 0x1a, 0x65, 0x44, 0xa6, 0x15, 0x30, 0x91, 0x30, 0xe1, 0xfa, 0x44, 0xa0, 0x3b, 0x6e, 0xfb, 0x28, + 0x49, 0xdb, 0x0d, 0x58, 0x4c, 0xf3, 0xfe, 0x7e, 0xc4, 0x22, 0x96, 0x86, 0xae, 0x8a, 0xb2, 0xaa, + 0xfd, 0x1e, 0x9a, 0x7d, 0x11, 0xbd, 0x15, 0xc8, 0x7b, 0x1c, 0x89, 0x44, 0xdd, 0x80, 0x4b, 0x81, + 0x8a, 0x18, 0x37, 0xb4, 0x96, 0x76, 0x70, 0xd9, 0x2b, 0x52, 0xd5, 0xa1, 0xf8, 0x49, 0x7d, 0x6a, + 0xec, 0x64, 0x9d, 0x3c, 0xd5, 0xf7, 0x61, 0x97, 0x0c, 0x63, 0x22, 0x8c, 0x6a, 0x5a, 0xcf, 0x12, + 0xfb, 0x16, 0xdc, 0x58, 0xa0, 0xf6, 0x50, 0x8c, 0x18, 0x15, 0x68, 0x7f, 0x84, 0x6b, 0x7d, 0x11, + 0xf5, 0x08, 0x0f, 0x8f, 0x83, 0x01, 0x26, 0xd8, 0x3d, 0x39, 0x5b, 0x31, 0xb6, 0x0d, 0x55, 0x3f, + 0x0e, 0xd3, 0x91, 0x7b, 0x9d, 0xdb, 0x4e, 0xb6, 0xa5, 0xa3, 0xb6, 0x74, 0xf2, 0x2d, 0x9d, 0x1e, + 0x8b, 0x69, 0xb7, 0x76, 0xfe, 0xfb, 0x6e, 0xc5, 0x53, 0xdf, 0xda, 0x1d, 0x30, 0x96, 0x07, 0x14, + 0xc3, 0xf5, 0x9b, 0x50, 0x57, 0x07, 0x7c, 0x13, 0xa6, 0x73, 0x6a, 0x5e, 0x9e, 0xd9, 0x3f, 0x35, + 0xd0, 0x0b, 0x10, 0x19, 0x63, 0x8f, 0x51, 0x89, 0x54, 0xae, 0xd0, 0x35, 0x23, 0xda, 0x99, 0x27, + 0x4a, 0x11, 0x19, 0x38, 0x3f, 0x47, 0x91, 0xaa, 0x33, 0x51, 0x26, 0x51, 0x18, 0xb5, 0xec, 0x4c, + 0x69, 0xa2, 0x78, 0x08, 0x97, 0xb1, 0x90, 0xc6, 0x6e, 0x5a, 0xce, 0x33, 0xfd, 0x1e, 0x34, 0x7d, + 0x32, 0x24, 0x34, 0xc0, 0x43, 0x1a, 0x0c, 0x18, 0x37, 0xea, 0x2d, 0xed, 0xa0, 0xe1, 0x2d, 0x16, + 0xed, 0x23, 0x30, 0xff, 0x55, 0x5d, 0x2e, 0xfb, 0x00, 0xae, 0x90, 0x98, 0x87, 0x9c, 0x8d, 0x7a, + 0x43, 0x12, 0x27, 0x98, 0x2d, 0xdd, 0xf0, 0x96, 0xaa, 0x36, 0x85, 0xbd, 0x9c, 0xe5, 0x1d, 0x5b, + 0xe9, 0x81, 0x57, 0x50, 0x1b, 0x33, 0x89, 0xf9, 0xdf, 0x68, 0x3b, 0x6b, 0x99, 0xd7, 0x39, 0x8e, + 0x69, 0x34, 0x44, 0x45, 0xed, 0xa5, 0x70, 0xfb, 0x05, 0x5c, 0x9f, 0x9b, 0xb7, 0xa9, 0xdc, 0xce, + 0x8f, 0x1a, 0x54, 0xfb, 0x22, 0xd2, 0xbf, 0x68, 0x00, 0x73, 0xd6, 0x7d, 0xb4, 0xa6, 0x9c, 0x05, + 0x57, 0x9a, 0xcf, 0xb7, 0x41, 0x95, 0x92, 0xbf, 0x6a, 0xd0, 0x5c, 0x74, 0xf2, 0xe3, 0xf5, 0xf9, + 0x16, 0x80, 0xe6, 0xcb, 0x2d, 0x81, 0xa5, 0x96, 0x6f, 0x1a, 0x5c, 0x5d, 0xf6, 0xef, 0xd3, 0x0d, + 0x49, 0x67, 0x50, 0xf3, 0x70, 0x6b, 0x68, 0xa9, 0xe8, 0x33, 0x34, 0x4a, 0x53, 0x75, 0x36, 0xa3, + 0x53, 0x18, 0xf3, 0xd9, 0xe6, 0x98, 0x62, 0x76, 0xd7, 0x3b, 0x9f, 0x58, 0xda, 0xc5, 0xc4, 0xd2, + 0xfe, 0x4c, 0x2c, 0xed, 0xfb, 0xd4, 0xaa, 0x5c, 0x4c, 0xad, 0xca, 0xaf, 0xa9, 0x55, 0xf9, 0xf0, + 0x24, 0x8a, 0xe5, 0xe0, 0xc4, 0x77, 0x02, 0x96, 0xb8, 0x47, 0x05, 0xbf, 0xc2, 0xbf, 0x26, 0x09, + 0xce, 0x3d, 0xaf, 0xa7, 0xf3, 0xef, 0xf5, 0xd9, 0x08, 0x85, 0x5f, 0x4f, 0x1f, 0xcd, 0x87, 0x7f, + 0x03, 0x00, 0x00, 0xff, 0xff, 0x90, 0xcc, 0x92, 0xef, 0xd3, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -50,6 +509,10 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { + UserCreate(ctx context.Context, in *MsgUserCreate, opts ...grpc.CallOption) (*MsgUserCreateResponse, error) + CardSchemeBuy(ctx context.Context, in *MsgCardSchemeBuy, opts ...grpc.CallOption) (*MsgCardSchemeBuyResponse, error) + CardSaveContent(ctx context.Context, in *MsgCardSaveContent, opts ...grpc.CallOption) (*MsgCardSaveContentResponse, error) + CardVote(ctx context.Context, in *MsgCardVote, opts ...grpc.CallOption) (*MsgCardVoteResponse, error) } type msgClient struct { @@ -60,22 +523,1559 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } +func (c *msgClient) UserCreate(ctx context.Context, in *MsgUserCreate, opts ...grpc.CallOption) (*MsgUserCreateResponse, error) { + out := new(MsgUserCreateResponse) + err := c.cc.Invoke(ctx, "/decentralcardgame.cardchain.cardchain.Msg/UserCreate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CardSchemeBuy(ctx context.Context, in *MsgCardSchemeBuy, opts ...grpc.CallOption) (*MsgCardSchemeBuyResponse, error) { + out := new(MsgCardSchemeBuyResponse) + err := c.cc.Invoke(ctx, "/decentralcardgame.cardchain.cardchain.Msg/CardSchemeBuy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CardSaveContent(ctx context.Context, in *MsgCardSaveContent, opts ...grpc.CallOption) (*MsgCardSaveContentResponse, error) { + out := new(MsgCardSaveContentResponse) + err := c.cc.Invoke(ctx, "/decentralcardgame.cardchain.cardchain.Msg/CardSaveContent", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CardVote(ctx context.Context, in *MsgCardVote, opts ...grpc.CallOption) (*MsgCardVoteResponse, error) { + out := new(MsgCardVoteResponse) + err := c.cc.Invoke(ctx, "/decentralcardgame.cardchain.cardchain.Msg/CardVote", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { + UserCreate(context.Context, *MsgUserCreate) (*MsgUserCreateResponse, error) + CardSchemeBuy(context.Context, *MsgCardSchemeBuy) (*MsgCardSchemeBuyResponse, error) + CardSaveContent(context.Context, *MsgCardSaveContent) (*MsgCardSaveContentResponse, error) + CardVote(context.Context, *MsgCardVote) (*MsgCardVoteResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. type UnimplementedMsgServer struct { } +func (*UnimplementedMsgServer) UserCreate(ctx context.Context, req *MsgUserCreate) (*MsgUserCreateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserCreate not implemented") +} +func (*UnimplementedMsgServer) CardSchemeBuy(ctx context.Context, req *MsgCardSchemeBuy) (*MsgCardSchemeBuyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CardSchemeBuy not implemented") +} +func (*UnimplementedMsgServer) CardSaveContent(ctx context.Context, req *MsgCardSaveContent) (*MsgCardSaveContentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CardSaveContent not implemented") +} +func (*UnimplementedMsgServer) CardVote(ctx context.Context, req *MsgCardVote) (*MsgCardVoteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CardVote not implemented") +} + func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +func _Msg_UserCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUserCreate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UserCreate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/decentralcardgame.cardchain.cardchain.Msg/UserCreate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UserCreate(ctx, req.(*MsgUserCreate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CardSchemeBuy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCardSchemeBuy) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CardSchemeBuy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/decentralcardgame.cardchain.cardchain.Msg/CardSchemeBuy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CardSchemeBuy(ctx, req.(*MsgCardSchemeBuy)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CardSaveContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCardSaveContent) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CardSaveContent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/decentralcardgame.cardchain.cardchain.Msg/CardSaveContent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CardSaveContent(ctx, req.(*MsgCardSaveContent)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CardVote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCardVote) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CardVote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/decentralcardgame.cardchain.cardchain.Msg/CardVote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CardVote(ctx, req.(*MsgCardVote)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "decentralcardgame.cardchain.cardchain.Msg", HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{}, - Metadata: "cardchain/cardchain/tx.proto", + Methods: []grpc.MethodDesc{ + { + MethodName: "UserCreate", + Handler: _Msg_UserCreate_Handler, + }, + { + MethodName: "CardSchemeBuy", + Handler: _Msg_CardSchemeBuy_Handler, + }, + { + MethodName: "CardSaveContent", + Handler: _Msg_CardSaveContent_Handler, + }, + { + MethodName: "CardVote", + Handler: _Msg_CardVote_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cardchain/cardchain/tx.proto", +} + +func (m *MsgUserCreate) 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 *MsgUserCreate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUserCreate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Alias) > 0 { + i -= len(m.Alias) + copy(dAtA[i:], m.Alias) + i = encodeVarintTx(dAtA, i, uint64(len(m.Alias))) + i-- + dAtA[i] = 0x1a + } + if len(m.NewUser) > 0 { + i -= len(m.NewUser) + copy(dAtA[i:], m.NewUser) + i = encodeVarintTx(dAtA, i, uint64(len(m.NewUser))) + 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 *MsgUserCreateResponse) 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 *MsgUserCreateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUserCreateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCardSchemeBuy) 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 *MsgCardSchemeBuy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCardSchemeBuy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Bid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + 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 *MsgCardSchemeBuyResponse) 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 *MsgCardSchemeBuyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCardSchemeBuyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CardId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CardId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgCardSaveContent) 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 *MsgCardSaveContent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCardSaveContent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BalanceAnchor { + i-- + if m.BalanceAnchor { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if len(m.Artist) > 0 { + i -= len(m.Artist) + copy(dAtA[i:], m.Artist) + i = encodeVarintTx(dAtA, i, uint64(len(m.Artist))) + i-- + dAtA[i] = 0x2a + } + if len(m.Notes) > 0 { + i -= len(m.Notes) + copy(dAtA[i:], m.Notes) + i = encodeVarintTx(dAtA, i, uint64(len(m.Notes))) + i-- + dAtA[i] = 0x22 + } + if len(m.Content) > 0 { + i -= len(m.Content) + copy(dAtA[i:], m.Content) + i = encodeVarintTx(dAtA, i, uint64(len(m.Content))) + i-- + dAtA[i] = 0x1a + } + if m.CardId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CardId)) + 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 *MsgCardSaveContentResponse) 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 *MsgCardSaveContentResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCardSaveContentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AirdropClaimed { + i-- + if m.AirdropClaimed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgCardVote) 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 *MsgCardVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCardVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Vote != nil { + { + size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + 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 *MsgCardVoteResponse) 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 *MsgCardVoteResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCardVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AirdropClaimed { + i-- + if m.AirdropClaimed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUserCreate) 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.NewUser) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Alias) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUserCreateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCardSchemeBuy) 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 = m.Bid.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgCardSchemeBuyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CardId != 0 { + n += 1 + sovTx(uint64(m.CardId)) + } + return n +} + +func (m *MsgCardSaveContent) 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.CardId != 0 { + n += 1 + sovTx(uint64(m.CardId)) + } + l = len(m.Content) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Notes) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Artist) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.BalanceAnchor { + n += 2 + } + return n +} + +func (m *MsgCardSaveContentResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AirdropClaimed { + n += 2 + } + return n +} + +func (m *MsgCardVote) 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.Vote != nil { + l = m.Vote.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCardVoteResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AirdropClaimed { + n += 2 + } + 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 *MsgUserCreate) 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: MsgUserCreate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUserCreate: 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 NewUser", 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.NewUser = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Alias", 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.Alias = 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 *MsgUserCreateResponse) 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: MsgUserCreateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUserCreateResponse: 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 *MsgCardSchemeBuy) 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: MsgCardSchemeBuy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCardSchemeBuy: 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 Bid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Bid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 *MsgCardSchemeBuyResponse) 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: MsgCardSchemeBuyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCardSchemeBuyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CardId", wireType) + } + m.CardId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CardId |= 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 *MsgCardSaveContent) 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: MsgCardSaveContent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCardSaveContent: 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 CardId", wireType) + } + m.CardId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CardId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", 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.Content = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Notes", 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.Notes = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Artist", 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.Artist = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BalanceAnchor", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BalanceAnchor = bool(v != 0) + 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 *MsgCardSaveContentResponse) 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: MsgCardSaveContentResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCardSaveContentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AirdropClaimed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AirdropClaimed = bool(v != 0) + 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 *MsgCardVote) 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: MsgCardVote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCardVote: 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 Vote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Vote == nil { + m.Vote = &SingleVote{} + } + if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 *MsgCardVoteResponse) 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: MsgCardVoteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCardVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AirdropClaimed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AirdropClaimed = bool(v != 0) + 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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/cardchain/types/voting.pb.go b/x/cardchain/types/voting.pb.go new file mode 100644 index 00000000..7c25ac9e --- /dev/null +++ b/x/cardchain/types/voting.pb.go @@ -0,0 +1,1135 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cardchain/cardchain/voting.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/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 VoteType int32 + +const ( + VoteType_fairEnough VoteType = 0 + VoteType_inappropriate VoteType = 1 + VoteType_overpowered VoteType = 2 + VoteType_underpowered VoteType = 3 +) + +var VoteType_name = map[int32]string{ + 0: "fairEnough", + 1: "inappropriate", + 2: "overpowered", + 3: "underpowered", +} + +var VoteType_value = map[string]int32{ + "fairEnough": 0, + "inappropriate": 1, + "overpowered": 2, + "underpowered": 3, +} + +func (x VoteType) String() string { + return proto.EnumName(VoteType_name, int32(x)) +} + +func (VoteType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_39c6bcdea6f40fbf, []int{0} +} + +type VotingResults struct { + TotalVotes uint64 `protobuf:"varint,1,opt,name=totalVotes,proto3" json:"totalVotes,omitempty"` + TotalFairEnoughVotes uint64 `protobuf:"varint,2,opt,name=totalFairEnoughVotes,proto3" json:"totalFairEnoughVotes,omitempty"` + TotalOverpoweredVotes uint64 `protobuf:"varint,3,opt,name=totalOverpoweredVotes,proto3" json:"totalOverpoweredVotes,omitempty"` + TotalUnderpoweredVotes uint64 `protobuf:"varint,4,opt,name=totalUnderpoweredVotes,proto3" json:"totalUnderpoweredVotes,omitempty"` + TotalInappropriateVotes uint64 `protobuf:"varint,5,opt,name=totalInappropriateVotes,proto3" json:"totalInappropriateVotes,omitempty"` + CardResults []*VotingResult `protobuf:"bytes,6,rep,name=cardResults,proto3" json:"cardResults,omitempty"` + Notes string `protobuf:"bytes,7,opt,name=notes,proto3" json:"notes,omitempty"` +} + +func (m *VotingResults) Reset() { *m = VotingResults{} } +func (m *VotingResults) String() string { return proto.CompactTextString(m) } +func (*VotingResults) ProtoMessage() {} +func (*VotingResults) Descriptor() ([]byte, []int) { + return fileDescriptor_39c6bcdea6f40fbf, []int{0} +} +func (m *VotingResults) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VotingResults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VotingResults.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 *VotingResults) XXX_Merge(src proto.Message) { + xxx_messageInfo_VotingResults.Merge(m, src) +} +func (m *VotingResults) XXX_Size() int { + return m.Size() +} +func (m *VotingResults) XXX_DiscardUnknown() { + xxx_messageInfo_VotingResults.DiscardUnknown(m) +} + +var xxx_messageInfo_VotingResults proto.InternalMessageInfo + +func (m *VotingResults) GetTotalVotes() uint64 { + if m != nil { + return m.TotalVotes + } + return 0 +} + +func (m *VotingResults) GetTotalFairEnoughVotes() uint64 { + if m != nil { + return m.TotalFairEnoughVotes + } + return 0 +} + +func (m *VotingResults) GetTotalOverpoweredVotes() uint64 { + if m != nil { + return m.TotalOverpoweredVotes + } + return 0 +} + +func (m *VotingResults) GetTotalUnderpoweredVotes() uint64 { + if m != nil { + return m.TotalUnderpoweredVotes + } + return 0 +} + +func (m *VotingResults) GetTotalInappropriateVotes() uint64 { + if m != nil { + return m.TotalInappropriateVotes + } + return 0 +} + +func (m *VotingResults) GetCardResults() []*VotingResult { + if m != nil { + return m.CardResults + } + return nil +} + +func (m *VotingResults) GetNotes() string { + if m != nil { + return m.Notes + } + return "" +} + +type VotingResult struct { + CardId uint64 `protobuf:"varint,1,opt,name=cardId,proto3" json:"cardId,omitempty"` + FairEnoughVotes uint64 `protobuf:"varint,2,opt,name=fairEnoughVotes,proto3" json:"fairEnoughVotes,omitempty"` + OverpoweredVotes uint64 `protobuf:"varint,3,opt,name=overpoweredVotes,proto3" json:"overpoweredVotes,omitempty"` + UnderpoweredVotes uint64 `protobuf:"varint,4,opt,name=underpoweredVotes,proto3" json:"underpoweredVotes,omitempty"` + InappropriateVotes uint64 `protobuf:"varint,5,opt,name=inappropriateVotes,proto3" json:"inappropriateVotes,omitempty"` + Result string `protobuf:"bytes,6,opt,name=result,proto3" json:"result,omitempty"` +} + +func (m *VotingResult) Reset() { *m = VotingResult{} } +func (m *VotingResult) String() string { return proto.CompactTextString(m) } +func (*VotingResult) ProtoMessage() {} +func (*VotingResult) Descriptor() ([]byte, []int) { + return fileDescriptor_39c6bcdea6f40fbf, []int{1} +} +func (m *VotingResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VotingResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VotingResult.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 *VotingResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_VotingResult.Merge(m, src) +} +func (m *VotingResult) XXX_Size() int { + return m.Size() +} +func (m *VotingResult) XXX_DiscardUnknown() { + xxx_messageInfo_VotingResult.DiscardUnknown(m) +} + +var xxx_messageInfo_VotingResult proto.InternalMessageInfo + +func (m *VotingResult) GetCardId() uint64 { + if m != nil { + return m.CardId + } + return 0 +} + +func (m *VotingResult) GetFairEnoughVotes() uint64 { + if m != nil { + return m.FairEnoughVotes + } + return 0 +} + +func (m *VotingResult) GetOverpoweredVotes() uint64 { + if m != nil { + return m.OverpoweredVotes + } + return 0 +} + +func (m *VotingResult) GetUnderpoweredVotes() uint64 { + if m != nil { + return m.UnderpoweredVotes + } + return 0 +} + +func (m *VotingResult) GetInappropriateVotes() uint64 { + if m != nil { + return m.InappropriateVotes + } + return 0 +} + +func (m *VotingResult) GetResult() string { + if m != nil { + return m.Result + } + return "" +} + +type SingleVote struct { + CardId uint64 `protobuf:"varint,1,opt,name=cardId,proto3" json:"cardId,omitempty"` + VoteType VoteType `protobuf:"varint,2,opt,name=voteType,proto3,enum=decentralcardgame.cardchain.cardchain.VoteType" json:"voteType,omitempty"` +} + +func (m *SingleVote) Reset() { *m = SingleVote{} } +func (m *SingleVote) String() string { return proto.CompactTextString(m) } +func (*SingleVote) ProtoMessage() {} +func (*SingleVote) Descriptor() ([]byte, []int) { + return fileDescriptor_39c6bcdea6f40fbf, []int{2} +} +func (m *SingleVote) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SingleVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SingleVote.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 *SingleVote) XXX_Merge(src proto.Message) { + xxx_messageInfo_SingleVote.Merge(m, src) +} +func (m *SingleVote) XXX_Size() int { + return m.Size() +} +func (m *SingleVote) XXX_DiscardUnknown() { + xxx_messageInfo_SingleVote.DiscardUnknown(m) +} + +var xxx_messageInfo_SingleVote proto.InternalMessageInfo + +func (m *SingleVote) GetCardId() uint64 { + if m != nil { + return m.CardId + } + return 0 +} + +func (m *SingleVote) GetVoteType() VoteType { + if m != nil { + return m.VoteType + } + return VoteType_fairEnough +} + +func init() { + proto.RegisterEnum("decentralcardgame.cardchain.cardchain.VoteType", VoteType_name, VoteType_value) + proto.RegisterType((*VotingResults)(nil), "decentralcardgame.cardchain.cardchain.VotingResults") + proto.RegisterType((*VotingResult)(nil), "decentralcardgame.cardchain.cardchain.VotingResult") + proto.RegisterType((*SingleVote)(nil), "decentralcardgame.cardchain.cardchain.SingleVote") +} + +func init() { proto.RegisterFile("cardchain/cardchain/voting.proto", fileDescriptor_39c6bcdea6f40fbf) } + +var fileDescriptor_39c6bcdea6f40fbf = []byte{ + // 438 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xcf, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0xb3, 0x49, 0x1b, 0xca, 0xa4, 0x7f, 0xdc, 0x51, 0x29, 0x39, 0x59, 0x51, 0x24, 0x24, + 0xab, 0x42, 0x8e, 0x94, 0x22, 0xd4, 0x33, 0x7f, 0x55, 0x71, 0x00, 0x19, 0xda, 0x03, 0xb7, 0xad, + 0xbd, 0x38, 0x96, 0x9c, 0x5d, 0xb3, 0x5e, 0x07, 0xfa, 0x16, 0x3c, 0x16, 0xc7, 0x1e, 0x39, 0xa2, + 0xe4, 0x0d, 0x38, 0x71, 0x44, 0x1e, 0xbb, 0xcd, 0xd2, 0xda, 0x52, 0x6f, 0x33, 0xf3, 0xcd, 0xb7, + 0xde, 0xef, 0x67, 0x2d, 0x8c, 0x42, 0xae, 0xa3, 0x70, 0xc6, 0x13, 0x39, 0x59, 0x57, 0x0b, 0x65, + 0x12, 0x19, 0xfb, 0x99, 0x56, 0x46, 0xe1, 0x93, 0x48, 0x84, 0x42, 0x1a, 0xcd, 0xd3, 0x72, 0x21, + 0xe6, 0x73, 0xe1, 0xdf, 0x6c, 0xae, 0xab, 0xf1, 0xdf, 0x2e, 0xec, 0x9c, 0x93, 0x2f, 0x10, 0x79, + 0x91, 0x9a, 0x1c, 0x5d, 0x00, 0xa3, 0x0c, 0x4f, 0xcf, 0x95, 0x11, 0xf9, 0x90, 0x8d, 0x98, 0xb7, + 0x11, 0x58, 0x13, 0x9c, 0xc2, 0x01, 0x75, 0x6f, 0x78, 0xa2, 0x5f, 0x4b, 0x55, 0xc4, 0xb3, 0x6a, + 0xb3, 0x4b, 0x9b, 0x8d, 0x1a, 0x3e, 0x83, 0x47, 0x34, 0x7f, 0xbf, 0x10, 0x3a, 0x53, 0xdf, 0x84, + 0x16, 0x51, 0x65, 0xea, 0x91, 0xa9, 0x59, 0xc4, 0xe7, 0x70, 0x48, 0xc2, 0x99, 0x8c, 0x6e, 0xd9, + 0x36, 0xc8, 0xd6, 0xa2, 0xe2, 0x09, 0x3c, 0x26, 0xe5, 0x54, 0xf2, 0x2c, 0xd3, 0x2a, 0xd3, 0x09, + 0x37, 0xa2, 0x32, 0x6e, 0x92, 0xb1, 0x4d, 0xc6, 0x33, 0x18, 0x94, 0x68, 0x6a, 0x14, 0xc3, 0xfe, + 0xa8, 0xe7, 0x0d, 0xa6, 0xc7, 0xfe, 0xbd, 0x50, 0xfa, 0x36, 0xc6, 0xc0, 0x3e, 0x07, 0x0f, 0x60, + 0x53, 0xd2, 0xe7, 0x1f, 0x8c, 0x98, 0xf7, 0x30, 0xa8, 0x9a, 0xf1, 0x1f, 0x06, 0xdb, 0xb6, 0x07, + 0x0f, 0xa1, 0x5f, 0xba, 0x4e, 0xa3, 0x9a, 0x7a, 0xdd, 0xa1, 0x07, 0x7b, 0x5f, 0x1a, 0x61, 0xdf, + 0x1e, 0xe3, 0x11, 0x38, 0xaa, 0x19, 0xf1, 0x9d, 0x39, 0x3e, 0x85, 0xfd, 0xa2, 0x05, 0xec, 0x5d, + 0x01, 0x7d, 0xc0, 0xa4, 0x0d, 0x67, 0x83, 0x52, 0x66, 0xd1, 0x94, 0x6a, 0xd8, 0xa7, 0xcc, 0x75, + 0x37, 0xfe, 0x0a, 0xf0, 0x31, 0x91, 0x71, 0x4a, 0x6b, 0xad, 0x89, 0xdf, 0xc1, 0xd6, 0x42, 0x19, + 0xf1, 0xe9, 0x32, 0x13, 0x14, 0x75, 0x77, 0x3a, 0xb9, 0xff, 0x4f, 0x20, 0x5b, 0x70, 0x73, 0xc0, + 0xd1, 0x07, 0xd8, 0xba, 0x9e, 0xe2, 0x2e, 0xc0, 0x9a, 0x99, 0xd3, 0xc1, 0x7d, 0xd8, 0xf9, 0xef, + 0xf2, 0x0e, 0xc3, 0x3d, 0x18, 0x58, 0xac, 0x9c, 0x2e, 0x3a, 0xb0, 0x6d, 0xf3, 0x70, 0x7a, 0x2f, + 0x82, 0x9f, 0x4b, 0x97, 0x5d, 0x2d, 0x5d, 0xf6, 0x7b, 0xe9, 0xb2, 0x1f, 0x2b, 0xb7, 0x73, 0xb5, + 0x72, 0x3b, 0xbf, 0x56, 0x6e, 0xe7, 0xf3, 0x49, 0x9c, 0x98, 0x59, 0x71, 0xe1, 0x87, 0x6a, 0x3e, + 0x79, 0x75, 0x7d, 0xe1, 0x97, 0x5c, 0x47, 0x6f, 0xf9, 0x5c, 0x58, 0x4f, 0xf5, 0xbb, 0x55, 0x9b, + 0xcb, 0x4c, 0xe4, 0x17, 0x7d, 0x7a, 0xb6, 0xc7, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x03, + 0xd1, 0xa2, 0xda, 0x03, 0x00, 0x00, +} + +func (m *VotingResults) 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 *VotingResults) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VotingResults) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Notes) > 0 { + i -= len(m.Notes) + copy(dAtA[i:], m.Notes) + i = encodeVarintVoting(dAtA, i, uint64(len(m.Notes))) + i-- + dAtA[i] = 0x3a + } + if len(m.CardResults) > 0 { + for iNdEx := len(m.CardResults) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CardResults[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVoting(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.TotalInappropriateVotes != 0 { + i = encodeVarintVoting(dAtA, i, uint64(m.TotalInappropriateVotes)) + i-- + dAtA[i] = 0x28 + } + if m.TotalUnderpoweredVotes != 0 { + i = encodeVarintVoting(dAtA, i, uint64(m.TotalUnderpoweredVotes)) + i-- + dAtA[i] = 0x20 + } + if m.TotalOverpoweredVotes != 0 { + i = encodeVarintVoting(dAtA, i, uint64(m.TotalOverpoweredVotes)) + i-- + dAtA[i] = 0x18 + } + if m.TotalFairEnoughVotes != 0 { + i = encodeVarintVoting(dAtA, i, uint64(m.TotalFairEnoughVotes)) + i-- + dAtA[i] = 0x10 + } + if m.TotalVotes != 0 { + i = encodeVarintVoting(dAtA, i, uint64(m.TotalVotes)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *VotingResult) 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 *VotingResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VotingResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Result) > 0 { + i -= len(m.Result) + copy(dAtA[i:], m.Result) + i = encodeVarintVoting(dAtA, i, uint64(len(m.Result))) + i-- + dAtA[i] = 0x32 + } + if m.InappropriateVotes != 0 { + i = encodeVarintVoting(dAtA, i, uint64(m.InappropriateVotes)) + i-- + dAtA[i] = 0x28 + } + if m.UnderpoweredVotes != 0 { + i = encodeVarintVoting(dAtA, i, uint64(m.UnderpoweredVotes)) + i-- + dAtA[i] = 0x20 + } + if m.OverpoweredVotes != 0 { + i = encodeVarintVoting(dAtA, i, uint64(m.OverpoweredVotes)) + i-- + dAtA[i] = 0x18 + } + if m.FairEnoughVotes != 0 { + i = encodeVarintVoting(dAtA, i, uint64(m.FairEnoughVotes)) + i-- + dAtA[i] = 0x10 + } + if m.CardId != 0 { + i = encodeVarintVoting(dAtA, i, uint64(m.CardId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SingleVote) 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 *SingleVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SingleVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.VoteType != 0 { + i = encodeVarintVoting(dAtA, i, uint64(m.VoteType)) + i-- + dAtA[i] = 0x10 + } + if m.CardId != 0 { + i = encodeVarintVoting(dAtA, i, uint64(m.CardId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintVoting(dAtA []byte, offset int, v uint64) int { + offset -= sovVoting(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *VotingResults) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TotalVotes != 0 { + n += 1 + sovVoting(uint64(m.TotalVotes)) + } + if m.TotalFairEnoughVotes != 0 { + n += 1 + sovVoting(uint64(m.TotalFairEnoughVotes)) + } + if m.TotalOverpoweredVotes != 0 { + n += 1 + sovVoting(uint64(m.TotalOverpoweredVotes)) + } + if m.TotalUnderpoweredVotes != 0 { + n += 1 + sovVoting(uint64(m.TotalUnderpoweredVotes)) + } + if m.TotalInappropriateVotes != 0 { + n += 1 + sovVoting(uint64(m.TotalInappropriateVotes)) + } + if len(m.CardResults) > 0 { + for _, e := range m.CardResults { + l = e.Size() + n += 1 + l + sovVoting(uint64(l)) + } + } + l = len(m.Notes) + if l > 0 { + n += 1 + l + sovVoting(uint64(l)) + } + return n +} + +func (m *VotingResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CardId != 0 { + n += 1 + sovVoting(uint64(m.CardId)) + } + if m.FairEnoughVotes != 0 { + n += 1 + sovVoting(uint64(m.FairEnoughVotes)) + } + if m.OverpoweredVotes != 0 { + n += 1 + sovVoting(uint64(m.OverpoweredVotes)) + } + if m.UnderpoweredVotes != 0 { + n += 1 + sovVoting(uint64(m.UnderpoweredVotes)) + } + if m.InappropriateVotes != 0 { + n += 1 + sovVoting(uint64(m.InappropriateVotes)) + } + l = len(m.Result) + if l > 0 { + n += 1 + l + sovVoting(uint64(l)) + } + return n +} + +func (m *SingleVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CardId != 0 { + n += 1 + sovVoting(uint64(m.CardId)) + } + if m.VoteType != 0 { + n += 1 + sovVoting(uint64(m.VoteType)) + } + return n +} + +func sovVoting(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozVoting(x uint64) (n int) { + return sovVoting(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *VotingResults) 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 ErrIntOverflowVoting + } + 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: VotingResults: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VotingResults: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalVotes", wireType) + } + m.TotalVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalFairEnoughVotes", wireType) + } + m.TotalFairEnoughVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalFairEnoughVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalOverpoweredVotes", wireType) + } + m.TotalOverpoweredVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalOverpoweredVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalUnderpoweredVotes", wireType) + } + m.TotalUnderpoweredVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalUnderpoweredVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalInappropriateVotes", wireType) + } + m.TotalInappropriateVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalInappropriateVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CardResults", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVoting + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVoting + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CardResults = append(m.CardResults, &VotingResult{}) + if err := m.CardResults[len(m.CardResults)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Notes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + 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 ErrInvalidLengthVoting + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVoting + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Notes = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVoting(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthVoting + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VotingResult) 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 ErrIntOverflowVoting + } + 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: VotingResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VotingResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CardId", wireType) + } + m.CardId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CardId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FairEnoughVotes", wireType) + } + m.FairEnoughVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FairEnoughVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OverpoweredVotes", wireType) + } + m.OverpoweredVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OverpoweredVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnderpoweredVotes", wireType) + } + m.UnderpoweredVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnderpoweredVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InappropriateVotes", wireType) + } + m.InappropriateVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.InappropriateVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + 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 ErrInvalidLengthVoting + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVoting + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Result = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVoting(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthVoting + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SingleVote) 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 ErrIntOverflowVoting + } + 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: SingleVote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SingleVote: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CardId", wireType) + } + m.CardId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CardId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VoteType", wireType) + } + m.VoteType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VoteType |= VoteType(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipVoting(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthVoting + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipVoting(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, ErrIntOverflowVoting + } + 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, ErrIntOverflowVoting + } + 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, ErrIntOverflowVoting + } + 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, ErrInvalidLengthVoting + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupVoting + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthVoting + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthVoting = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowVoting = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupVoting = fmt.Errorf("proto: unexpected end of group") +)