diff --git a/proto/campaign/tx.proto b/proto/campaign/tx.proto index feda81fc9..0f515803f 100644 --- a/proto/campaign/tx.proto +++ b/proto/campaign/tx.proto @@ -16,7 +16,6 @@ service Msg { rpc UpdateTotalSupply(MsgUpdateTotalSupply) returns (MsgUpdateTotalSupplyResponse); rpc UpdateSpecialAllocations(MsgUpdateSpecialAllocations) returns (MsgUpdateSpecialAllocationsResponse); rpc InitializeMainnet(MsgInitializeMainnet) returns (MsgInitializeMainnetResponse); - rpc AddShares(MsgAddShares) returns (MsgAddSharesResponse); rpc AddVestingOptions(MsgAddVestingOptions) returns (MsgAddVestingOptionsResponse); rpc MintVouchers(MsgMintVouchers) returns (MsgMintVouchersResponse); rpc BurnVouchers(MsgBurnVouchers) returns (MsgBurnVouchersResponse); @@ -81,19 +80,6 @@ message MsgInitializeMainnetResponse { uint64 mainnetID = 1; } -message MsgAddShares { - string coordinator = 1; - uint64 campaignID = 2; - string address = 3; - repeated cosmos.base.v1beta1.Coin shares = 4 [ - (gogoproto.nullable) = false, - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.castrepeated) = "Shares" - ]; -} - -message MsgAddSharesResponse {} - message MsgAddVestingOptions { string coordinator = 1; uint64 campaignID = 2; diff --git a/x/campaign/client/cli/tx.go b/x/campaign/client/cli/tx.go index 480132aa4..3c0592019 100644 --- a/x/campaign/client/cli/tx.go +++ b/x/campaign/client/cli/tx.go @@ -25,7 +25,6 @@ func GetTxCmd() *cobra.Command { CmdUpdateTotalSupply(), CmdUpdateSpecialAllocations(), CmdInitializeMainnet(), - CmdAddShares(), CmdAddVestingOptions(), CmdMintVouchers(), CmdBurnVouchers(), diff --git a/x/campaign/client/cli/tx_add_shares.go b/x/campaign/client/cli/tx_add_shares.go deleted file mode 100644 index 1781c8d55..000000000 --- a/x/campaign/client/cli/tx_add_shares.go +++ /dev/null @@ -1,51 +0,0 @@ -package cli - -import ( - "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" - - "github.com/tendermint/spn/x/campaign/types" -) - -func CmdAddShares() *cobra.Command { - cmd := &cobra.Command{ - Use: "add-shares [campaign-id] [address] [shares]", - Short: "Add shares to an account", - Args: cobra.ExactArgs(3), - RunE: func(cmd *cobra.Command, args []string) error { - argCampaignID, err := cast.ToUint64E(args[0]) - if err != nil { - return err - } - - argAddress := args[1] - shares, err := types.NewShares(args[2]) - if err != nil { - return err - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgAddShares( - argCampaignID, - clientCtx.GetFromAddress().String(), - argAddress, - shares, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/campaign/handler.go b/x/campaign/handler.go index 11658a745..8231fffc4 100644 --- a/x/campaign/handler.go +++ b/x/campaign/handler.go @@ -33,9 +33,6 @@ func NewHandler(k keeper.Keeper) sdk.Handler { case *types.MsgInitializeMainnet: res, err := msgServer.InitializeMainnet(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgAddShares: - res, err := msgServer.AddShares(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) case *types.MsgMintVouchers: res, err := msgServer.MintVouchers(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) @@ -49,12 +46,6 @@ func NewHandler(k keeper.Keeper) sdk.Handler { res, err := msgServer.UnredeemVouchers(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) // this line is used by starport scaffolding # 1 - - // disabled: https://github.com/tendermint/spn/issues/774 - // case *types.MsgAddVestingOptions: - // res, err := msgServer.AddVestingOptions(sdk.WrapSDKContext(ctx), msg) - // return sdk.WrapServiceResult(ctx, res, err) - default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) diff --git a/x/campaign/keeper/msg_add_shares.go b/x/campaign/keeper/msg_add_shares.go deleted file mode 100644 index 6a8b86db9..000000000 --- a/x/campaign/keeper/msg_add_shares.go +++ /dev/null @@ -1,95 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - spnerrors "github.com/tendermint/spn/pkg/errors" - "github.com/tendermint/spn/x/campaign/types" - profiletypes "github.com/tendermint/spn/x/profile/types" -) - -func (k msgServer) AddShares(goCtx context.Context, msg *types.MsgAddShares) (*types.MsgAddSharesResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - campaign, found := k.GetCampaign(ctx, msg.CampaignID) - if !found { - return nil, sdkerrors.Wrapf(types.ErrCampaignNotFound, "%d", msg.CampaignID) - } - - mainnetLaunched, err := k.IsCampaignMainnetLaunchTriggered(ctx, campaign.CampaignID) - if err != nil { - return nil, spnerrors.Critical(err.Error()) - } - if mainnetLaunched { - return nil, sdkerrors.Wrap(types.ErrMainnetLaunchTriggered, fmt.Sprintf( - "mainnet %d launch is already triggered", - campaign.MainnetID, - )) - } - - coordID, err := k.profileKeeper.CoordinatorIDFromAddress(ctx, msg.Coordinator) - if err != nil { - return nil, err - } - - if campaign.CoordinatorID != coordID { - return nil, sdkerrors.Wrap(profiletypes.ErrCoordInvalid, fmt.Sprintf( - "coordinator of the campaign is %d", - campaign.CoordinatorID, - )) - } - - // check if the account already exists - account, accountFound := k.GetMainnetAccount(ctx, campaign.CampaignID, msg.Address) - if !accountFound { - // if not, create the account - account = types.MainnetAccount{ - CampaignID: campaign.CampaignID, - Address: msg.Address, - Shares: types.EmptyShares(), - } - } - // increase the account shares - account.Shares = types.IncreaseShares(account.Shares, msg.Shares) - - // increase the campaign shares - campaign.AllocatedShares = types.IncreaseShares(campaign.AllocatedShares, msg.Shares) - if types.IsTotalSharesReached(campaign.AllocatedShares, k.GetTotalShares(ctx)) { - return nil, sdkerrors.Wrapf(types.ErrTotalSharesLimit, "%d", msg.CampaignID) - } - - k.SetCampaign(ctx, campaign) - k.SetMainnetAccount(ctx, account) - - if !accountFound { - err = ctx.EventManager().EmitTypedEvents( - &types.EventCampaignSharesUpdated{ - CampaignID: campaign.CampaignID, - CoordinatorAddress: msg.Coordinator, - AllocatedShares: campaign.AllocatedShares, - }, &types.EventMainnetAccountCreated{ - CampaignID: campaign.CampaignID, - Address: msg.Address, - Shares: msg.Shares, - }, - ) - } else { - err = ctx.EventManager().EmitTypedEvents( - &types.EventCampaignSharesUpdated{ - CampaignID: campaign.CampaignID, - CoordinatorAddress: msg.Coordinator, - AllocatedShares: campaign.AllocatedShares, - }, &types.EventMainnetAccountUpdated{ - CampaignID: campaign.CampaignID, - Address: msg.Address, - Shares: msg.Shares, - }, - ) - } - - return &types.MsgAddSharesResponse{}, err -} diff --git a/x/campaign/keeper/msg_add_shares_test.go b/x/campaign/keeper/msg_add_shares_test.go deleted file mode 100644 index 8f229e691..000000000 --- a/x/campaign/keeper/msg_add_shares_test.go +++ /dev/null @@ -1,215 +0,0 @@ -package keeper_test - -import ( - "fmt" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - - spntypes "github.com/tendermint/spn/pkg/types" - tc "github.com/tendermint/spn/testutil/constructor" - testkeeper "github.com/tendermint/spn/testutil/keeper" - "github.com/tendermint/spn/testutil/sample" - "github.com/tendermint/spn/x/campaign/types" - profiletypes "github.com/tendermint/spn/x/profile/types" -) - -func TestMsgAddShares(t *testing.T) { - var ( - addr1 = sample.Address(r) - addr2 = sample.Address(r) - coordAddr1 = sample.Address(r) - coordAddr2 = sample.Address(r) - coordAddrMainnetInitialized = sample.Address(r) - coordAddrMainnetLaunched = sample.Address(r) - campaign = sample.Campaign(r, 0) - campaignInvalidAllocatedShares = sample.Campaign(r, 2) - campaignMainnetInitialized = sample.Campaign(r, 1) - campaignMainnetLaunched = sample.Campaign(r, 3) - - sdkCtx, tk, ts = testkeeper.NewTestSetup(t) - ctx = sdk.WrapSDKContext(sdkCtx) - ) - - // create shares - allocatedShares := tc.Shares(t, "91token") - invalidAllocatedShares := tc.Shares(t, fmt.Sprintf("%dtoken", spntypes.TotalShareNumber)) - highShare := tc.Shares(t, "1000token") - lowShare := tc.Shares(t, "8token") - - tk.CampaignKeeper.SetMainnetAccount(sdkCtx, sample.MainnetAccount(r, campaign.CampaignID, addr2)) - res, err := ts.ProfileSrv.CreateCoordinator(ctx, &profiletypes.MsgCreateCoordinator{ - Address: coordAddrMainnetInitialized, - Description: sample.CoordinatorDescription(r), - }) - require.NoError(t, err) - campaignMainnetInitialized.CoordinatorID = res.CoordinatorID - campaignMainnetInitialized.MainnetInitialized = true - campaignMainnetInitialized.AllocatedShares = allocatedShares - chain := sample.Chain(r, 0, res.CoordinatorID) - chain.LaunchTriggered = false - chain.IsMainnet = true - campaignMainnetInitialized.MainnetID = tk.LaunchKeeper.AppendChain(sdkCtx, chain) - campaignMainnetInitialized.CampaignID = tk.CampaignKeeper.AppendCampaign(sdkCtx, campaignMainnetInitialized) - - res, err = ts.ProfileSrv.CreateCoordinator(ctx, &profiletypes.MsgCreateCoordinator{ - Address: coordAddrMainnetLaunched, - Description: sample.CoordinatorDescription(r), - }) - require.NoError(t, err) - campaignMainnetLaunched.CoordinatorID = res.CoordinatorID - campaignMainnetLaunched.MainnetInitialized = true - campaignMainnetLaunched.AllocatedShares = allocatedShares - chainLaunched := sample.Chain(r, 1, res.CoordinatorID) - chainLaunched.LaunchTriggered = true - chainLaunched.IsMainnet = true - campaignMainnetLaunched.MainnetID = tk.LaunchKeeper.AppendChain(sdkCtx, chainLaunched) - campaignMainnetLaunched.CampaignID = tk.CampaignKeeper.AppendCampaign(sdkCtx, campaignMainnetLaunched) - - res, err = ts.ProfileSrv.CreateCoordinator(ctx, &profiletypes.MsgCreateCoordinator{ - Address: coordAddr1, - Description: sample.CoordinatorDescription(r), - }) - require.NoError(t, err) - campaign.CoordinatorID = res.CoordinatorID - campaign.CampaignID = tk.CampaignKeeper.AppendCampaign(sdkCtx, campaign) - campaign.AllocatedShares = allocatedShares - - res, err = ts.ProfileSrv.CreateCoordinator(ctx, &profiletypes.MsgCreateCoordinator{ - Address: coordAddr2, - Description: sample.CoordinatorDescription(r), - }) - require.NoError(t, err) - campaignInvalidAllocatedShares.CoordinatorID = res.CoordinatorID - campaignInvalidAllocatedShares.AllocatedShares = invalidAllocatedShares - campaignInvalidAllocatedShares.CampaignID = tk.CampaignKeeper.AppendCampaign(sdkCtx, campaignInvalidAllocatedShares) - - for _, tc := range []struct { - name string - msg types.MsgAddShares - expectedID uint64 - err error - }{ - { - name: "invalid campaign id", - msg: types.MsgAddShares{ - Coordinator: coordAddr1, - CampaignID: 100, - Address: addr1, - Shares: sample.Shares(r), - }, - err: types.ErrCampaignNotFound, - }, - { - name: "coordinator address not found", - msg: types.MsgAddShares{ - Coordinator: addr1, - CampaignID: campaign.CampaignID, - Address: addr1, - Shares: sample.Shares(r), - }, - err: profiletypes.ErrCoordAddressNotFound, - }, - { - name: "invalid coordinator id", - msg: types.MsgAddShares{ - Coordinator: coordAddrMainnetInitialized, - CampaignID: campaign.CampaignID, - Address: addr1, - Shares: sample.Shares(r), - }, - err: profiletypes.ErrCoordInvalid, - }, - { - name: "campaign with initialized mainnet", - msg: types.MsgAddShares{ - Coordinator: coordAddrMainnetInitialized, - CampaignID: campaignMainnetInitialized.CampaignID, - Address: addr1, - Shares: sample.Shares(r), - }, - }, - { - name: "campaign with launched mainnet", - msg: types.MsgAddShares{ - Coordinator: coordAddrMainnetLaunched, - CampaignID: campaignMainnetLaunched.CampaignID, - Address: addr1, - Shares: sample.Shares(r), - }, - err: types.ErrMainnetLaunchTriggered, - }, - { - name: "allocated shares greater than total shares", - msg: types.MsgAddShares{ - Coordinator: coordAddr2, - CampaignID: campaignInvalidAllocatedShares.CampaignID, - Address: addr1, - Shares: highShare, - }, - err: types.ErrTotalSharesLimit, - }, - { - name: "create new account with shares", - msg: types.MsgAddShares{ - Coordinator: coordAddr1, - CampaignID: campaign.CampaignID, - Address: addr1, - Shares: lowShare, - }, - }, - { - name: "update existing account shares", - msg: types.MsgAddShares{ - Coordinator: coordAddr1, - CampaignID: campaign.CampaignID, - Address: addr2, - Shares: highShare, - }, - }, - } { - t.Run(tc.name, func(t *testing.T) { - var ( - accountExists bool - previousAccount types.MainnetAccount - previousCampaign types.Campaign - ) - if tc.err == nil { - var found bool - previousCampaign, found = tk.CampaignKeeper.GetCampaign(sdkCtx, tc.msg.CampaignID) - require.True(t, found) - - previousAccount, accountExists = tk.CampaignKeeper.GetMainnetAccount( - sdkCtx, - tc.msg.CampaignID, - tc.msg.Address, - ) - } - _, err := ts.CampaignSrv.AddShares(ctx, &tc.msg) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - return - } - require.NoError(t, err) - - account, found := tk.CampaignKeeper.GetMainnetAccount(sdkCtx, tc.msg.CampaignID, tc.msg.Address) - require.True(t, found) - - campaign, found := tk.CampaignKeeper.GetCampaign(sdkCtx, tc.msg.CampaignID) - require.True(t, found) - - if accountExists { - shares, err := types.DecreaseShares(account.Shares, previousAccount.Shares) - require.NoError(t, err) - equal := types.IsEqualShares(shares, tc.msg.Shares) - require.True(t, equal) - } else { - tmpShare, err := types.DecreaseShares(campaign.AllocatedShares, account.Shares) - require.NoError(t, err) - equal := types.IsEqualShares(previousCampaign.AllocatedShares, tmpShare) - require.True(t, equal) - } - }) - } -} diff --git a/x/campaign/module_simulation.go b/x/campaign/module_simulation.go index 8a7bcefdc..009e2631c 100644 --- a/x/campaign/module_simulation.go +++ b/x/campaign/module_simulation.go @@ -19,8 +19,6 @@ const ( defaultWeightMsgUpdateTotalSupply = 20 defaultWeightMsgInitializeMainnet = 15 defaultWeightMsgUpdateSpecialAllocations = 20 - defaultWeightMsgAddShares = 20 - defaultWeightMsgAddVestingOptions = 20 defaultWeightMsgMintVouchers = 20 defaultWeightMsgBurnVouchers = 20 defaultWeightMsgRedeemVouchers = 20 @@ -31,8 +29,6 @@ const ( opWeightMsgUpdateTotalSupply = "op_weight_msg_update_total_supply" opWeightMsgInitializeMainnet = "op_weight_msg_initialize_mainnet" opWeightMsgUpdateSpecialAllocations = "op_weight_msg_update_special_allocations" - opWeightMsgAddShares = "op_weight_msg_add_shares" - opWeightMsgAddVestingOptions = "op_weight_msg_add_vesting_options" opWeightMsgMintVouchers = "op_weight_msg_mint_vouchers" opWeightMsgBurnVouchers = "op_weight_msg_burn_vouchers" opWeightMsgRedeemVouchers = "op_weight_msg_redeem_vouchers" @@ -76,8 +72,6 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp weightMsgUpdateTotalSupply int weightMsgInitializeMainnet int weightMsgUpdateSpecialAllocations int - weightMsgAddShares int - weightMsgAddVestingOptions int weightMsgMintVouchers int weightMsgBurnVouchers int weightMsgRedeemVouchers int @@ -111,16 +105,6 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp weightMsgInitializeMainnet = defaultWeightMsgUpdateSpecialAllocations }, ) - appParams.GetOrGenerate(cdc, opWeightMsgAddShares, &weightMsgAddShares, nil, - func(_ *rand.Rand) { - weightMsgAddShares = defaultWeightMsgAddShares - }, - ) - appParams.GetOrGenerate(cdc, opWeightMsgAddVestingOptions, &weightMsgAddVestingOptions, nil, - func(_ *rand.Rand) { - weightMsgAddVestingOptions = defaultWeightMsgAddVestingOptions - }, - ) appParams.GetOrGenerate(cdc, opWeightMsgMintVouchers, &weightMsgMintVouchers, nil, func(_ *rand.Rand) { weightMsgMintVouchers = defaultWeightMsgMintVouchers @@ -160,11 +144,7 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp campaignsim.SimulateMsgInitializeMainnet(am.accountKeeper, am.bankKeeper, am.profileKeeper, am.keeper), ), simulation.NewWeightedOperation( - weightMsgAddShares, - campaignsim.SimulateMsgAddShares(am.accountKeeper, am.bankKeeper, am.profileKeeper, am.keeper), - ), - simulation.NewWeightedOperation( - weightMsgAddShares, + weightMsgUpdateSpecialAllocations, campaignsim.SimulateMsgUpdateSpecialAllocations(am.accountKeeper, am.bankKeeper, am.profileKeeper, am.keeper), ), simulation.NewWeightedOperation( diff --git a/x/campaign/simulation/simulation.go b/x/campaign/simulation/simulation.go index 713768406..86818cb21 100644 --- a/x/campaign/simulation/simulation.go +++ b/x/campaign/simulation/simulation.go @@ -210,39 +210,6 @@ func SimulateMsgUpdateSpecialAllocations(ak types.AccountKeeper, } } -// SimulateMsgAddShares simulates a MsgAddShares message -func SimulateMsgAddShares( - ak types.AccountKeeper, - bk types.BankKeeper, - pk types.ProfileKeeper, - 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, campID, found := GetCoordSimAccountWithCampaignID(r, ctx, pk, k, accs, false, true) - if !found { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgAddShares, "skip add shares"), nil, nil - } - - shares, getShares := GetSharesFromCampaign(r, ctx, k, campID) - if !getShares { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgAddShares, "skip add shares"), nil, nil - } - - // Select a random account to give shares - accountNb := r.Intn(len(accs)) - - msg := types.NewMsgAddShares( - campID, - simAccount.Address.String(), - accs[accountNb].Address.String(), - shares, - ) - return deliverSimTx(r, app, ctx, ak, bk, simAccount, msg, sdk.NewCoins()) - } -} - // SimulateMsgAddVestingOptions simulates a MsgAddVestingOptions message func SimulateMsgAddVestingOptions( ak types.AccountKeeper, diff --git a/x/campaign/types/codec.go b/x/campaign/types/codec.go index 64ec1c0b2..d42004ef3 100644 --- a/x/campaign/types/codec.go +++ b/x/campaign/types/codec.go @@ -13,7 +13,6 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgUpdateTotalSupply{}, "campaign/UpdateTotalSupply", nil) cdc.RegisterConcrete(&MsgUpdateSpecialAllocations{}, "campaign/UpdateSpecialAllocations", nil) cdc.RegisterConcrete(&MsgInitializeMainnet{}, "campaign/InitializeMainnet", nil) - cdc.RegisterConcrete(&MsgAddShares{}, "campaign/AddShares", nil) cdc.RegisterConcrete(&MsgAddVestingOptions{}, "campaign/AddVestingOptions", nil) cdc.RegisterConcrete(&MsgMintVouchers{}, "campaign/MintVouchers", nil) cdc.RegisterConcrete(&MsgBurnVouchers{}, "campaign/BurnVouchers", nil) @@ -30,7 +29,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgUpdateTotalSupply{}, &MsgUpdateSpecialAllocations{}, &MsgInitializeMainnet{}, - &MsgAddShares{}, &MsgAddVestingOptions{}, &MsgMintVouchers{}, &MsgBurnVouchers{}, diff --git a/x/campaign/types/msg_add_shares.go b/x/campaign/types/msg_add_shares.go deleted file mode 100644 index 1d820c802..000000000 --- a/x/campaign/types/msg_add_shares.go +++ /dev/null @@ -1,57 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const TypeMsgAddShares = "add_shares" - -var _ sdk.Msg = &MsgAddShares{} - -func NewMsgAddShares(campaignID uint64, coordinator, address string, shares Shares) *MsgAddShares { - return &MsgAddShares{ - CampaignID: campaignID, - Coordinator: coordinator, - Address: address, - Shares: shares, - } -} - -func (msg *MsgAddShares) Route() string { - return RouterKey -} - -func (msg *MsgAddShares) Type() string { - return TypeMsgAddShares -} - -func (msg *MsgAddShares) GetSigners() []sdk.AccAddress { - coordinator, err := sdk.AccAddressFromBech32(msg.Coordinator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{coordinator} -} - -func (msg *MsgAddShares) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgAddShares) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Coordinator) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid coordinator address (%s)", err) - } - - if !sdk.Coins(msg.Shares).IsValid() { - return sdkerrors.Wrap(ErrInvalidShares, sdk.Coins(msg.Shares).String()) - } - - if sdk.Coins(msg.Shares).Empty() { - return sdkerrors.Wrap(ErrInvalidShares, "shares is empty") - } - - return nil -} diff --git a/x/campaign/types/msg_add_shares_test.go b/x/campaign/types/msg_add_shares_test.go deleted file mode 100644 index d537d625e..000000000 --- a/x/campaign/types/msg_add_shares_test.go +++ /dev/null @@ -1,65 +0,0 @@ -package types_test - -import ( - "testing" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/stretchr/testify/require" - - "github.com/tendermint/spn/testutil/sample" - "github.com/tendermint/spn/x/campaign/types" -) - -func TestMsgAddShares_ValidateBasic(t *testing.T) { - tests := []struct { - name string - msg types.MsgAddShares - err error - }{ - { - name: "valid address", - msg: types.MsgAddShares{ - Coordinator: sample.Address(r), - CampaignID: 0, - Shares: sample.Shares(r), - }, - }, - { - name: "invalid address", - msg: types.MsgAddShares{ - Coordinator: "invalid_address", - CampaignID: 0, - Shares: sample.Shares(r), - }, - err: sdkerrors.ErrInvalidAddress, - }, - { - name: "invalid shates", - msg: types.MsgAddShares{ - Coordinator: sample.Address(r), - CampaignID: 0, - Shares: invalidShares, - }, - err: types.ErrInvalidShares, - }, - { - name: "empty shares", - msg: types.MsgAddShares{ - Coordinator: sample.Address(r), - CampaignID: 0, - Shares: types.Shares{}, - }, - err: types.ErrInvalidShares, - }, - } - 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/campaign/types/tx.pb.go b/x/campaign/types/tx.pb.go index 96b2f5a24..cda4ac225 100644 --- a/x/campaign/types/tx.pb.go +++ b/x/campaign/types/tx.pb.go @@ -558,110 +558,6 @@ func (m *MsgInitializeMainnetResponse) GetMainnetID() uint64 { return 0 } -type MsgAddShares struct { - Coordinator string `protobuf:"bytes,1,opt,name=coordinator,proto3" json:"coordinator,omitempty"` - CampaignID uint64 `protobuf:"varint,2,opt,name=campaignID,proto3" json:"campaignID,omitempty"` - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - Shares Shares `protobuf:"bytes,4,rep,name=shares,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin,castrepeated=Shares" json:"shares"` -} - -func (m *MsgAddShares) Reset() { *m = MsgAddShares{} } -func (m *MsgAddShares) String() string { return proto.CompactTextString(m) } -func (*MsgAddShares) ProtoMessage() {} -func (*MsgAddShares) Descriptor() ([]byte, []int) { - return fileDescriptor_fb6bf904ffc53c1f, []int{10} -} -func (m *MsgAddShares) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgAddShares) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgAddShares.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 *MsgAddShares) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAddShares.Merge(m, src) -} -func (m *MsgAddShares) XXX_Size() int { - return m.Size() -} -func (m *MsgAddShares) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAddShares.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgAddShares proto.InternalMessageInfo - -func (m *MsgAddShares) GetCoordinator() string { - if m != nil { - return m.Coordinator - } - return "" -} - -func (m *MsgAddShares) GetCampaignID() uint64 { - if m != nil { - return m.CampaignID - } - return 0 -} - -func (m *MsgAddShares) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *MsgAddShares) GetShares() Shares { - if m != nil { - return m.Shares - } - return nil -} - -type MsgAddSharesResponse struct { -} - -func (m *MsgAddSharesResponse) Reset() { *m = MsgAddSharesResponse{} } -func (m *MsgAddSharesResponse) String() string { return proto.CompactTextString(m) } -func (*MsgAddSharesResponse) ProtoMessage() {} -func (*MsgAddSharesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fb6bf904ffc53c1f, []int{11} -} -func (m *MsgAddSharesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgAddSharesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgAddSharesResponse.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 *MsgAddSharesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAddSharesResponse.Merge(m, src) -} -func (m *MsgAddSharesResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgAddSharesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAddSharesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgAddSharesResponse proto.InternalMessageInfo - type MsgAddVestingOptions struct { Coordinator string `protobuf:"bytes,1,opt,name=coordinator,proto3" json:"coordinator,omitempty"` CampaignID uint64 `protobuf:"varint,2,opt,name=campaignID,proto3" json:"campaignID,omitempty"` @@ -673,7 +569,7 @@ func (m *MsgAddVestingOptions) Reset() { *m = MsgAddVestingOptions{} } func (m *MsgAddVestingOptions) String() string { return proto.CompactTextString(m) } func (*MsgAddVestingOptions) ProtoMessage() {} func (*MsgAddVestingOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_fb6bf904ffc53c1f, []int{12} + return fileDescriptor_fb6bf904ffc53c1f, []int{10} } func (m *MsgAddVestingOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -737,7 +633,7 @@ func (m *MsgAddVestingOptionsResponse) Reset() { *m = MsgAddVestingOptio func (m *MsgAddVestingOptionsResponse) String() string { return proto.CompactTextString(m) } func (*MsgAddVestingOptionsResponse) ProtoMessage() {} func (*MsgAddVestingOptionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fb6bf904ffc53c1f, []int{13} + return fileDescriptor_fb6bf904ffc53c1f, []int{11} } func (m *MsgAddVestingOptionsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -776,7 +672,7 @@ func (m *MsgMintVouchers) Reset() { *m = MsgMintVouchers{} } func (m *MsgMintVouchers) String() string { return proto.CompactTextString(m) } func (*MsgMintVouchers) ProtoMessage() {} func (*MsgMintVouchers) Descriptor() ([]byte, []int) { - return fileDescriptor_fb6bf904ffc53c1f, []int{14} + return fileDescriptor_fb6bf904ffc53c1f, []int{12} } func (m *MsgMintVouchers) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -833,7 +729,7 @@ func (m *MsgMintVouchersResponse) Reset() { *m = MsgMintVouchersResponse func (m *MsgMintVouchersResponse) String() string { return proto.CompactTextString(m) } func (*MsgMintVouchersResponse) ProtoMessage() {} func (*MsgMintVouchersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fb6bf904ffc53c1f, []int{15} + return fileDescriptor_fb6bf904ffc53c1f, []int{13} } func (m *MsgMintVouchersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -872,7 +768,7 @@ func (m *MsgBurnVouchers) Reset() { *m = MsgBurnVouchers{} } func (m *MsgBurnVouchers) String() string { return proto.CompactTextString(m) } func (*MsgBurnVouchers) ProtoMessage() {} func (*MsgBurnVouchers) Descriptor() ([]byte, []int) { - return fileDescriptor_fb6bf904ffc53c1f, []int{16} + return fileDescriptor_fb6bf904ffc53c1f, []int{14} } func (m *MsgBurnVouchers) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -929,7 +825,7 @@ func (m *MsgBurnVouchersResponse) Reset() { *m = MsgBurnVouchersResponse func (m *MsgBurnVouchersResponse) String() string { return proto.CompactTextString(m) } func (*MsgBurnVouchersResponse) ProtoMessage() {} func (*MsgBurnVouchersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fb6bf904ffc53c1f, []int{17} + return fileDescriptor_fb6bf904ffc53c1f, []int{15} } func (m *MsgBurnVouchersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -969,7 +865,7 @@ func (m *MsgRedeemVouchers) Reset() { *m = MsgRedeemVouchers{} } func (m *MsgRedeemVouchers) String() string { return proto.CompactTextString(m) } func (*MsgRedeemVouchers) ProtoMessage() {} func (*MsgRedeemVouchers) Descriptor() ([]byte, []int) { - return fileDescriptor_fb6bf904ffc53c1f, []int{18} + return fileDescriptor_fb6bf904ffc53c1f, []int{16} } func (m *MsgRedeemVouchers) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1033,7 +929,7 @@ func (m *MsgRedeemVouchersResponse) Reset() { *m = MsgRedeemVouchersResp func (m *MsgRedeemVouchersResponse) String() string { return proto.CompactTextString(m) } func (*MsgRedeemVouchersResponse) ProtoMessage() {} func (*MsgRedeemVouchersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fb6bf904ffc53c1f, []int{19} + return fileDescriptor_fb6bf904ffc53c1f, []int{17} } func (m *MsgRedeemVouchersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1072,7 +968,7 @@ func (m *MsgUnredeemVouchers) Reset() { *m = MsgUnredeemVouchers{} } func (m *MsgUnredeemVouchers) String() string { return proto.CompactTextString(m) } func (*MsgUnredeemVouchers) ProtoMessage() {} func (*MsgUnredeemVouchers) Descriptor() ([]byte, []int) { - return fileDescriptor_fb6bf904ffc53c1f, []int{20} + return fileDescriptor_fb6bf904ffc53c1f, []int{18} } func (m *MsgUnredeemVouchers) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1129,7 +1025,7 @@ func (m *MsgUnredeemVouchersResponse) Reset() { *m = MsgUnredeemVouchers func (m *MsgUnredeemVouchersResponse) String() string { return proto.CompactTextString(m) } func (*MsgUnredeemVouchersResponse) ProtoMessage() {} func (*MsgUnredeemVouchersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fb6bf904ffc53c1f, []int{21} + return fileDescriptor_fb6bf904ffc53c1f, []int{19} } func (m *MsgUnredeemVouchersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1169,8 +1065,6 @@ func init() { proto.RegisterType((*MsgUpdateSpecialAllocationsResponse)(nil), "tendermint.spn.campaign.MsgUpdateSpecialAllocationsResponse") proto.RegisterType((*MsgInitializeMainnet)(nil), "tendermint.spn.campaign.MsgInitializeMainnet") proto.RegisterType((*MsgInitializeMainnetResponse)(nil), "tendermint.spn.campaign.MsgInitializeMainnetResponse") - proto.RegisterType((*MsgAddShares)(nil), "tendermint.spn.campaign.MsgAddShares") - proto.RegisterType((*MsgAddSharesResponse)(nil), "tendermint.spn.campaign.MsgAddSharesResponse") proto.RegisterType((*MsgAddVestingOptions)(nil), "tendermint.spn.campaign.MsgAddVestingOptions") proto.RegisterType((*MsgAddVestingOptionsResponse)(nil), "tendermint.spn.campaign.MsgAddVestingOptionsResponse") proto.RegisterType((*MsgMintVouchers)(nil), "tendermint.spn.campaign.MsgMintVouchers") @@ -1186,70 +1080,68 @@ func init() { func init() { proto.RegisterFile("campaign/tx.proto", fileDescriptor_fb6bf904ffc53c1f) } var fileDescriptor_fb6bf904ffc53c1f = []byte{ - // 1007 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0x24, 0x26, 0xd4, 0xcf, 0x51, 0x20, 0x4b, 0xd5, 0x3a, 0xdb, 0xb0, 0x89, 0x16, 0xb5, - 0x58, 0xa5, 0xd9, 0xa5, 0xa6, 0x1c, 0x10, 0xbd, 0x34, 0x29, 0x12, 0x95, 0x30, 0x48, 0x1b, 0xda, - 0x43, 0x39, 0x44, 0x93, 0xdd, 0xd1,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0x13, - 0x6b, 0xe1, 0xe9, 0x89, 0xb5, 0xf0, 0xec, 0xc4, 0x5a, 0x78, 0x78, 0x3d, 0x57, 0x80, 0xc7, 0x96, - 0x5d, 0x1e, 0x53, 0xf7, 0x91, 0x3b, 0xfe, 0x93, 0x22, 0x2d, 0xc4, 0x07, 0xcb, 0xf2, 0xdf, 0x80, - 0x0f, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xce, 0x02, 0xeb, 0x19, 0xbd, 0x10, 0x00, 0x00, + // 965 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x26, 0x26, 0xd4, 0xcf, 0x51, 0xc0, 0x4b, 0x45, 0x1d, 0x37, 0x6c, 0xa2, 0x45, 0x14, + 0xab, 0xb4, 0xbb, 0xd4, 0x94, 0x03, 0xa2, 0x97, 0x26, 0x45, 0xa2, 0x12, 0x06, 0x69, 0x4b, 0x7b, + 0x28, 0x87, 0x68, 0xb2, 0x3b, 0x5a, 0x2f, 0xd8, 0x33, 0xab, 0x9d, 0xb1, 0xd5, 0x70, 0xe5, 0x8e, + 0x2a, 0x4e, 0x7c, 0x00, 0x24, 0x24, 0xbe, 0x02, 0x12, 0x12, 0x9c, 0x7a, 0x42, 0x3d, 0x72, 0x0a, + 0x28, 0xf9, 0x16, 0xbd, 0x80, 0x76, 0x66, 0x3c, 0xde, 0x3f, 0xf6, 0x26, 0xa6, 0x16, 0xe5, 0x14, + 0xcf, 0xe4, 0x37, 0xef, 0xbd, 0xdf, 0x6f, 0xde, 0x9f, 0x59, 0x68, 0xfa, 0x68, 0x18, 0xa3, 0x28, + 0x24, 0x2e, 0x7f, 0xe4, 0xc4, 0x09, 0xe5, 0xd4, 0xbc, 0xc4, 0x31, 0x09, 0x70, 0x32, 0x8c, 0x08, + 0x77, 0x58, 0x4c, 0x9c, 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0x52, 0xe9, + 0x2b, 0x8b, 0xac, 0xf6, 0x35, 0xab, 0x6d, 0xa7, 0x75, 0x5b, 0x68, 0xd9, 0x95, 0x75, 0x9b, 0xc7, + 0x56, 0xd7, 0xed, 0xec, 0x76, 0x68, 0x8e, 0xe1, 0xd5, 0x52, 0x2b, 0xbc, 0x56, 0x99, 0x91, 0x05, + 0x74, 0xfb, 0xe6, 0x22, 0xe8, 0x89, 0xdf, 0xbd, 0x3b, 0x4f, 0x4e, 0x2c, 0xe3, 0xe9, 0x89, 0x65, + 0xfc, 0x75, 0x62, 0x19, 0x8f, 0x4f, 0xad, 0x95, 0xa7, 0xa7, 0xd6, 0xca, 0x1f, 0xa7, 0xd6, 0xca, + 0xc3, 0xab, 0x99, 0xee, 0x38, 0xb5, 0xec, 0xb2, 0x98, 0xb8, 0x8f, 0xdc, 0xe9, 0xe7, 0x74, 0xda, + 0x25, 0x0f, 0xd7, 0xc5, 0x77, 0xeb, 0x7b, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xf3, 0x15, 0x24, + 0xa6, 0x67, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1269,7 +1161,6 @@ type MsgClient interface { UpdateTotalSupply(ctx context.Context, in *MsgUpdateTotalSupply, opts ...grpc.CallOption) (*MsgUpdateTotalSupplyResponse, error) UpdateSpecialAllocations(ctx context.Context, in *MsgUpdateSpecialAllocations, opts ...grpc.CallOption) (*MsgUpdateSpecialAllocationsResponse, error) InitializeMainnet(ctx context.Context, in *MsgInitializeMainnet, opts ...grpc.CallOption) (*MsgInitializeMainnetResponse, error) - AddShares(ctx context.Context, in *MsgAddShares, opts ...grpc.CallOption) (*MsgAddSharesResponse, error) AddVestingOptions(ctx context.Context, in *MsgAddVestingOptions, opts ...grpc.CallOption) (*MsgAddVestingOptionsResponse, error) MintVouchers(ctx context.Context, in *MsgMintVouchers, opts ...grpc.CallOption) (*MsgMintVouchersResponse, error) BurnVouchers(ctx context.Context, in *MsgBurnVouchers, opts ...grpc.CallOption) (*MsgBurnVouchersResponse, error) @@ -1330,15 +1221,6 @@ func (c *msgClient) InitializeMainnet(ctx context.Context, in *MsgInitializeMain return out, nil } -func (c *msgClient) AddShares(ctx context.Context, in *MsgAddShares, opts ...grpc.CallOption) (*MsgAddSharesResponse, error) { - out := new(MsgAddSharesResponse) - err := c.cc.Invoke(ctx, "/tendermint.spn.campaign.Msg/AddShares", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) AddVestingOptions(ctx context.Context, in *MsgAddVestingOptions, opts ...grpc.CallOption) (*MsgAddVestingOptionsResponse, error) { out := new(MsgAddVestingOptionsResponse) err := c.cc.Invoke(ctx, "/tendermint.spn.campaign.Msg/AddVestingOptions", in, out, opts...) @@ -1391,7 +1273,6 @@ type MsgServer interface { UpdateTotalSupply(context.Context, *MsgUpdateTotalSupply) (*MsgUpdateTotalSupplyResponse, error) UpdateSpecialAllocations(context.Context, *MsgUpdateSpecialAllocations) (*MsgUpdateSpecialAllocationsResponse, error) InitializeMainnet(context.Context, *MsgInitializeMainnet) (*MsgInitializeMainnetResponse, error) - AddShares(context.Context, *MsgAddShares) (*MsgAddSharesResponse, error) AddVestingOptions(context.Context, *MsgAddVestingOptions) (*MsgAddVestingOptionsResponse, error) MintVouchers(context.Context, *MsgMintVouchers) (*MsgMintVouchersResponse, error) BurnVouchers(context.Context, *MsgBurnVouchers) (*MsgBurnVouchersResponse, error) @@ -1418,9 +1299,6 @@ func (*UnimplementedMsgServer) UpdateSpecialAllocations(ctx context.Context, req func (*UnimplementedMsgServer) InitializeMainnet(ctx context.Context, req *MsgInitializeMainnet) (*MsgInitializeMainnetResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InitializeMainnet not implemented") } -func (*UnimplementedMsgServer) AddShares(ctx context.Context, req *MsgAddShares) (*MsgAddSharesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddShares not implemented") -} func (*UnimplementedMsgServer) AddVestingOptions(ctx context.Context, req *MsgAddVestingOptions) (*MsgAddVestingOptionsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddVestingOptions not implemented") } @@ -1531,24 +1409,6 @@ func _Msg_InitializeMainnet_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } -func _Msg_AddShares_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAddShares) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).AddShares(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/tendermint.spn.campaign.Msg/AddShares", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AddShares(ctx, req.(*MsgAddShares)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_AddVestingOptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgAddVestingOptions) if err := dec(in); err != nil { @@ -1663,10 +1523,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "InitializeMainnet", Handler: _Msg_InitializeMainnet_Handler, }, - { - MethodName: "AddShares", - Handler: _Msg_AddShares_Handler, - }, { MethodName: "AddVestingOptions", Handler: _Msg_AddVestingOptions_Handler, @@ -2074,85 +1930,6 @@ func (m *MsgInitializeMainnetResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } -func (m *MsgAddShares) 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 *MsgAddShares) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgAddShares) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Shares) > 0 { - for iNdEx := len(m.Shares) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Shares[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x1a - } - if m.CampaignID != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.CampaignID)) - i-- - dAtA[i] = 0x10 - } - if len(m.Coordinator) > 0 { - i -= len(m.Coordinator) - copy(dAtA[i:], m.Coordinator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Coordinator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgAddSharesResponse) 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 *MsgAddSharesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgAddSharesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - func (m *MsgAddVestingOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2704,41 +2481,6 @@ func (m *MsgInitializeMainnetResponse) Size() (n int) { return n } -func (m *MsgAddShares) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Coordinator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.CampaignID != 0 { - n += 1 + sovTx(uint64(m.CampaignID)) - } - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Shares) > 0 { - for _, e := range m.Shares { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgAddSharesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *MsgAddVestingOptions) Size() (n int) { if m == nil { return 0 @@ -4007,223 +3749,6 @@ func (m *MsgInitializeMainnetResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgAddShares) 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: MsgAddShares: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAddShares: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Coordinator", 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.Coordinator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CampaignID", wireType) - } - m.CampaignID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CampaignID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shares", 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 - } - m.Shares = append(m.Shares, github_com_cosmos_cosmos_sdk_types.Coin{}) - if err := m.Shares[len(m.Shares)-1].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 *MsgAddSharesResponse) 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: MsgAddSharesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAddSharesResponse: 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 *MsgAddVestingOptions) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0