Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(campaign): set correct order with MsgUpdateSpecialAllocations #820

Merged
merged 3 commits into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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