Skip to content

Commit

Permalink
refactor(campaign): set correct order with `MsgUpdateSpecialAllocat…
Browse files Browse the repository at this point in the history
…ions` (#820)

* message order

* codec

Co-authored-by: Alex Johnson <alex.johnson@tendermint.com>
  • Loading branch information
lumtis and Alex Johnson authored May 31, 2022
1 parent 0cb81a6 commit cbc14af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion proto/campaign/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ service Msg {
rpc CreateCampaign(MsgCreateCampaign) returns (MsgCreateCampaignResponse);
rpc EditCampaign(MsgEditCampaign) returns (MsgEditCampaignResponse);
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);
rpc RedeemVouchers(MsgRedeemVouchers) returns (MsgRedeemVouchersResponse);
rpc UnredeemVouchers(MsgUnredeemVouchers) returns (MsgUnredeemVouchersResponse);
rpc UpdateSpecialAllocations(MsgUpdateSpecialAllocations) returns (MsgUpdateSpecialAllocationsResponse);
// this line is used by starport scaffolding # proto/tx/rpc
}

Expand Down
6 changes: 3 additions & 3 deletions x/campaign/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ func NewHandler(k keeper.Keeper) sdk.Handler {
case *types.MsgUpdateTotalSupply:
res, err := msgServer.UpdateTotalSupply(sdk.WrapSDKContext(ctx), msg)
return sdk.WrapServiceResult(ctx, res, err)
case *types.MsgUpdateSpecialAllocations:
res, err := msgServer.UpdateSpecialAllocations(sdk.WrapSDKContext(ctx), msg)
return sdk.WrapServiceResult(ctx, res, err)
case *types.MsgInitializeMainnet:
res, err := msgServer.InitializeMainnet(sdk.WrapSDKContext(ctx), msg)
return sdk.WrapServiceResult(ctx, res, err)
Expand All @@ -45,9 +48,6 @@ func NewHandler(k keeper.Keeper) sdk.Handler {
case *types.MsgUnredeemVouchers:
res, err := msgServer.UnredeemVouchers(sdk.WrapSDKContext(ctx), msg)
return sdk.WrapServiceResult(ctx, res, err)
case *types.MsgUpdateSpecialAllocations:
res, err := msgServer.UpdateSpecialAllocations(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
Expand Down
6 changes: 2 additions & 4 deletions x/campaign/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,24 @@ func RegisterCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgCreateCampaign{}, "campaign/CreateCampaign", nil)
cdc.RegisterConcrete(&MsgEditCampaign{}, "campaign/EditCampaign", nil)
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)
cdc.RegisterConcrete(&MsgRedeemVouchers{}, "campaign/RedeemVouchers", nil)
cdc.RegisterConcrete(&MsgUnredeemVouchers{}, "campaign/UnredeemVouchers", nil)
cdc.RegisterConcrete(&MsgUpdateSpecialAllocations{}, "campaign/UpdateSpecialAllocations", nil)
// this line is used by starport scaffolding # 2
}

func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgUpdateSpecialAllocations{},
)
// this line is used by starport scaffolding # 3
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgCreateCampaign{},
&MsgEditCampaign{},
&MsgUpdateTotalSupply{},
&MsgUpdateSpecialAllocations{},
&MsgInitializeMainnet{},
&MsgAddShares{},
&MsgAddVestingOptions{},
Expand Down

0 comments on commit cbc14af

Please sign in to comment.