diff --git a/proto/reserve/vaults/proposal.proto b/proto/reserve/vaults/proposal.proto index b1d0289d..7fa074c1 100644 --- a/proto/reserve/vaults/proposal.proto +++ b/proto/reserve/vaults/proposal.proto @@ -29,3 +29,13 @@ message UpdatesCollateralProposal { string description = 2; MsgUpdatesCollateral updates_collateral = 3 [(gogoproto.nullable) = false]; } + +message BurnShortfallProposal { + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "reserve/BurnShortfallProposal"; + + string title = 1; + string description = 2; + MsgBurnShortfall burn_shortfall = 3 [(gogoproto.nullable) = false]; +} diff --git a/proto/reserve/vaults/tx.proto b/proto/reserve/vaults/tx.proto index 1f09ae74..4b7a17ca 100644 --- a/proto/reserve/vaults/tx.proto +++ b/proto/reserve/vaults/tx.proto @@ -44,6 +44,8 @@ service Msg { // Close defines a method for close vault rpc Close(MsgClose) returns (MsgCloseResponse); + + rpc BurnShortfall(MsgBurnShortfall) returns (MsgBurnShortfallResponse); } message MsgUpdateParams { @@ -295,3 +297,20 @@ message MsgClose { // MsgRepayResponse defines the Msg/Mint response type. message MsgCloseResponse {} + +message MsgBurnShortfall { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "authority"; + + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string mint_denom = 2; + string amount = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (amino.dont_omitempty) = true, + (gogoproto.nullable) = false + ]; +} + +message MsgBurnShortfallResponse {} \ No newline at end of file diff --git a/x/vaults/keeper/keeper.go b/x/vaults/keeper/keeper.go index 4164834d..521d1d2e 100644 --- a/x/vaults/keeper/keeper.go +++ b/x/vaults/keeper/keeper.go @@ -263,4 +263,32 @@ func (k *Keeper) burnDebt(ctx context.Context, vmKey string, vm types.VaultManag } vm.MintAvailable = vm.MintAvailable.Add(coin.Amount) return k.VaultsManager.Set(ctx, vmKey, vm) -} \ No newline at end of file +} + +func (k *Keeper) BurnShortfallByMintDenom(ctx context.Context, mintDenom string, amount math.Int) error { + // get amount shortfall by mintdenom + amountShortfall, err := k.ShortfallAmount.Get(ctx, mintDenom) + if err != nil { + return err + } + if amountShortfall.LT(amount) { + return fmt.Errorf("amount shortfall is less than") + } + // get amount reserve by mintdenom + amountReserve := k.BankKeeper.GetAllBalances(ctx, k.accountKeeper.GetModuleAddress(types.ReserveModuleName)).AmountOf(mintDenom) + if amountReserve.LT(amount) { + return fmt.Errorf("amount reserve is less than") + } + + // Burn token from Reserve module + if err := k.BankKeeper.BurnCoins(ctx, types.ReserveModuleName, sdk.NewCoins(sdk.NewCoin(mintDenom, amount))); err != nil { + return err + } + + // Update shortfall amount after burning + remainingShortfall := amountShortfall.Sub(amount) + if err := k.ShortfallAmount.Set(ctx, mintDenom, remainingShortfall); err != nil { + return err + } + return nil +} diff --git a/x/vaults/keeper/msg_server.go b/x/vaults/keeper/msg_server.go index e450cd3b..479bd739 100644 --- a/x/vaults/keeper/msg_server.go +++ b/x/vaults/keeper/msg_server.go @@ -3,6 +3,7 @@ package keeper import ( "context" "fmt" + "slices" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" @@ -180,3 +181,26 @@ func (k msgServer) Close(ctx context.Context, msg *types.MsgClose) (*types.MsgCl } return &types.MsgCloseResponse{}, nil } + +// use mintDenom in reserve to burn Shortfall via gov +func (k msgServer) BurnShortfall(ctx context.Context, msg *types.MsgBurnShortfall) (*types.MsgBurnShortfallResponse, error) { + err := msg.ValidateBasic() + if err != nil { + return &types.MsgBurnShortfallResponse{}, err + } + + if k.authority != msg.Authority { + return nil, errorsmod.Wrapf(types.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, msg.Authority) + } + + if !slices.Contains(k.GetParams(ctx).AllowedMintDenom, msg.MintDenom) { + return nil, fmt.Errorf("denom %s is not in the allowed mint denom list", msg.MintDenom) + } + + err = k.BurnShortfallByMintDenom(ctx, msg.MintDenom, msg.Amount) + if err != nil { + return nil, err + } + + return &types.MsgBurnShortfallResponse{}, nil +} diff --git a/x/vaults/keeper/msg_server_test.go b/x/vaults/keeper/msg_server_test.go new file mode 100644 index 00000000..b44ff79c --- /dev/null +++ b/x/vaults/keeper/msg_server_test.go @@ -0,0 +1,194 @@ +package keeper_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "cosmossdk.io/math" + + "github.com/onomyprotocol/reserve/x/vaults/types" +) + +func (s *KeeperTestSuite) TestBurnShortfallByMintDenom() { + testcases := []struct { + name string + mintDenom string + setup func() types.MsgBurnShortfall + expShortfallAmountAfterBurn math.Int + expReserveBalcesAfterBurn math.Int + expPass bool + }{ + { + name: "success burn part", + mintDenom: "fxUSD", + setup: func() types.MsgBurnShortfall { + // make sure reserve has money + mintCoin := sdk.NewCoins(sdk.NewCoin("fxUSD", math.NewInt(10_000_000))) + s.FundAccount(s.TestAccs[0], types.ModuleName, mintCoin) + err := s.k.BankKeeper.SendCoinsFromAccountToModule(s.Ctx, s.TestAccs[0], types.ReserveModuleName, mintCoin) + s.Require().NoError(err) + + // make sure Guaranteed Shortfall Amount + err = s.k.ShortfallAmount.Set(s.Ctx, "fxUSD", math.NewInt(5_000_000)) + s.Require().NoError(err) + return types.MsgBurnShortfall{ + Authority: "onomy10d07y265gmmuvt4z0w9aw880jnsr700jqr8n8k", + MintDenom: "fxUSD", + Amount: math.NewInt(1_000_000), + } + }, + expShortfallAmountAfterBurn: math.NewInt(4_000_000), + expReserveBalcesAfterBurn: math.NewInt(9_000_000), + expPass: true, + }, + { + name: "success maximum burn, shortfallAmount is less than reserve balances", + mintDenom: "fxUSD", + setup: func() types.MsgBurnShortfall { + // make sure reserve has money + mintCoin := sdk.NewCoins(sdk.NewCoin("fxUSD", math.NewInt(10_000_000))) + s.FundAccount(s.TestAccs[0], types.ModuleName, mintCoin) + err := s.k.BankKeeper.SendCoinsFromAccountToModule(s.Ctx, s.TestAccs[0], types.ReserveModuleName, mintCoin) + s.Require().NoError(err) + + // make sure Guaranteed Shortfall Amount + err = s.k.ShortfallAmount.Set(s.Ctx, "fxUSD", math.NewInt(1_000_000)) + s.Require().NoError(err) + return types.MsgBurnShortfall{ + Authority: "onomy10d07y265gmmuvt4z0w9aw880jnsr700jqr8n8k", + MintDenom: "fxUSD", + Amount: math.NewInt(1_000_000), + } + }, + expShortfallAmountAfterBurn: math.ZeroInt(), + expReserveBalcesAfterBurn: math.NewInt(9_000_000), + expPass: true, + }, + { + name: "success maximum burn, reserve balancess is less than shortfallAmount", + mintDenom: "fxUSD", + setup: func() types.MsgBurnShortfall { + // make sure reserve has money + mintCoin := sdk.NewCoins(sdk.NewCoin("fxUSD", math.NewInt(1_000_000))) + s.FundAccount(s.TestAccs[0], types.ModuleName, mintCoin) + err := s.k.BankKeeper.SendCoinsFromAccountToModule(s.Ctx, s.TestAccs[0], types.ReserveModuleName, mintCoin) + s.Require().NoError(err) + + // make sure Guaranteed Shortfall Amount + err = s.k.ShortfallAmount.Set(s.Ctx, "fxUSD", math.NewInt(10_000_000)) + s.Require().NoError(err) + return types.MsgBurnShortfall{ + Authority: "onomy10d07y265gmmuvt4z0w9aw880jnsr700jqr8n8k", + MintDenom: "fxUSD", + Amount: math.NewInt(1_000_000), + } + }, + expShortfallAmountAfterBurn: math.NewInt(9_000_000), + expReserveBalcesAfterBurn: math.ZeroInt(), + expPass: true, + }, + { + name: "fail, reserve balancess no money", + mintDenom: "fxUSD", + setup: func() types.MsgBurnShortfall { + // make sure Guaranteed Shortfall Amount + err := s.k.ShortfallAmount.Set(s.Ctx, "fxUSD", math.NewInt(10_000_000)) + s.Require().NoError(err) + return types.MsgBurnShortfall{ + Authority: "onomy10d07y265gmmuvt4z0w9aw880jnsr700jqr8n8k", + MintDenom: "fxUSD", + Amount: math.NewInt(1_000_000), + } + }, + expPass: false, + }, + { + name: "fail, government account not the signatory for the proposed message", + mintDenom: "fxUSD", + setup: func() types.MsgBurnShortfall { + // make sure reserve has money + mintCoin := sdk.NewCoins(sdk.NewCoin("fxUSD", math.NewInt(1_000_000))) + s.FundAccount(s.TestAccs[0], types.ModuleName, mintCoin) + err := s.k.BankKeeper.SendCoinsFromAccountToModule(s.Ctx, s.TestAccs[0], types.ReserveModuleName, mintCoin) + s.Require().NoError(err) + + // make sure Guaranteed Shortfall Amount + err = s.k.ShortfallAmount.Set(s.Ctx, "fxUSD", math.NewInt(10_000_000)) + s.Require().NoError(err) + return types.MsgBurnShortfall{ + Authority: s.TestAccs[0].String(), + MintDenom: "fxUSD", + Amount: math.NewInt(1_000_000), + } + }, + expPass: false, + }, + { + name: "fail, denom is not in the allowed mint denom list", + mintDenom: "fxUSD", + setup: func() types.MsgBurnShortfall { + // make sure reserve has money + mintCoin := sdk.NewCoins(sdk.NewCoin("fxUSD", math.NewInt(1_000_000))) + s.FundAccount(s.TestAccs[0], types.ModuleName, mintCoin) + err := s.k.BankKeeper.SendCoinsFromAccountToModule(s.Ctx, s.TestAccs[0], types.ReserveModuleName, mintCoin) + s.Require().NoError(err) + + // make sure Guaranteed Shortfall Amount + err = s.k.ShortfallAmount.Set(s.Ctx, "fxUSD", math.NewInt(10_000_000)) + s.Require().NoError(err) + return types.MsgBurnShortfall{ + Authority: s.TestAccs[0].String(), + MintDenom: "atom", + Amount: math.NewInt(1_000_000), + } + }, + expPass: false, + }, + { + name: "fail, burn all", + mintDenom: "fxUSD", + setup: func() types.MsgBurnShortfall { + // make sure reserve has money + mintCoin := sdk.NewCoins(sdk.NewCoin("fxUSD", math.NewInt(5_000_000))) + s.FundAccount(s.TestAccs[0], types.ModuleName, mintCoin) + err := s.k.BankKeeper.SendCoinsFromAccountToModule(s.Ctx, s.TestAccs[0], types.ReserveModuleName, mintCoin) + s.Require().NoError(err) + + // make sure Guaranteed Shortfall Amount + err = s.k.ShortfallAmount.Set(s.Ctx, "fxUSD", math.NewInt(5_000_000)) + s.Require().NoError(err) + return types.MsgBurnShortfall{ + Authority: "onomy10d07y265gmmuvt4z0w9aw880jnsr700jqr8n8k", + MintDenom: "fxUSD", + Amount: math.NewInt(10_000_000), + } + }, + expPass: false, + }, + } + + for _, t := range testcases { + s.Run(t.name, func() { + s.SetupTest() + msg := t.setup() + + // burn Shortfall + _, err := s.msgServer.BurnShortfall(s.Ctx, &msg) + if t.expPass { + s.Require().NoError(err) + + // check reserve balances after burn + reserveBalces := s.k.BankKeeper.GetAllBalances(s.Ctx, s.App.AccountKeeper.GetModuleAddress(types.ReserveModuleName)) + s.Require().True(reserveBalces.AmountOf(t.mintDenom).Equal(t.expReserveBalcesAfterBurn)) + + // check ShortfallAmount after burn + + shortfallAmountAfterBurn, err := s.k.ShortfallAmount.Get(s.Ctx, t.mintDenom) + s.Require().NoError(err) + + s.Require().True(shortfallAmountAfterBurn.Equal(t.expShortfallAmountAfterBurn)) + } else { + s.Require().Error(err) + } + }) + } +} diff --git a/x/vaults/module/proposal_handler.go b/x/vaults/module/proposal_handler.go index 75452f2a..f1b0eb76 100644 --- a/x/vaults/module/proposal_handler.go +++ b/x/vaults/module/proposal_handler.go @@ -21,6 +21,9 @@ func NewVaultsProposalHandler(k *keeper.Keeper) govtypes.Handler { case *types.UpdatesCollateralProposal: _, err := msgSv.UpdatesCollateral(ctx, types.NewMsgUpdatesCollateral(c)) return err + case *types.BurnShortfallProposal: + _, err := msgSv.BurnShortfall(ctx, types.NewMsgBurnShortfall(c)) + return err default: return errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s proposal content type: %T", types.ModuleName, c) } diff --git a/x/vaults/types/codec.go b/x/vaults/types/codec.go index b4e7a346..da801f10 100644 --- a/x/vaults/types/codec.go +++ b/x/vaults/types/codec.go @@ -12,6 +12,7 @@ import ( func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&ActiveCollateralProposal{}, "reserve/ActiveCollateralProposal", nil) cdc.RegisterConcrete(&UpdatesCollateralProposal{}, "reserve/UpdatesCollateralProposal", nil) + cdc.RegisterConcrete(&BurnShortfallProposal{}, "reserve/BurnShortfallProposal", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -20,6 +21,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}, &MsgActiveCollateral{}, + &MsgBurnShortfall{}, &MsgUpdatesCollateral{}, &MsgCreateVault{}, &MsgDeposit{}, @@ -33,6 +35,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { (*govtypes.Content)(nil), &ActiveCollateralProposal{}, &UpdatesCollateralProposal{}, + &BurnShortfallProposal{}, ) } diff --git a/x/vaults/types/msgs.go b/x/vaults/types/msgs.go index cf3bf641..815ed1ca 100644 --- a/x/vaults/types/msgs.go +++ b/x/vaults/types/msgs.go @@ -11,6 +11,7 @@ import ( const ( ProposalTypeActiveCollateralProposal string = "ActiveCollateralProposal" ProposalTypeUpdatesCollateralProposal string = "UpdatesCollateralProposal" + ProposalTypeBurnShortfallProposal string = "BurnShortfallProposal" ) var ( @@ -225,6 +226,7 @@ func (msg *MsgUpdatesCollateral) ValidateBasic() error { var _ govtypes.Content = &ActiveCollateralProposal{} var _ govtypes.Content = &UpdatesCollateralProposal{} +var _ govtypes.Content = &BurnShortfallProposal{} func NewMsgActiveCollateral(a *ActiveCollateralProposal) *MsgActiveCollateral { return &MsgActiveCollateral{ @@ -260,6 +262,14 @@ func NewMsgUpdatesCollateral(u *UpdatesCollateralProposal) *MsgUpdatesCollateral } } +// NewMsgBurnShortfall +func NewMsgBurnShortfall(a *BurnShortfallProposal) *MsgBurnShortfall { + return &MsgBurnShortfall{ + Authority: a.BurnShortfall.Authority, + MintDenom: a.BurnShortfall.MintDenom, + } +} + func (m *ActiveCollateralProposal) GetDescription() string { return " " } @@ -295,7 +305,7 @@ func (m *UpdatesCollateralProposal) ProposalRoute() string { } func (m *UpdatesCollateralProposal) ProposalType() string { - return ProposalTypeActiveCollateralProposal + return ProposalTypeUpdatesCollateralProposal } func (m *UpdatesCollateralProposal) ValidateBasic() error { @@ -303,3 +313,37 @@ func (m *UpdatesCollateralProposal) ValidateBasic() error { return a.ValidateBasic() } + +// ValidateBasic +func (msg *MsgBurnShortfall) ValidateBasic() error { + if msg.Authority == "" { + return fmt.Errorf("authority is empty") + } + if msg.MintDenom == "" { + return fmt.Errorf("authority is empty") + } + if msg.Amount.LTE(math.ZeroInt()) { + return fmt.Errorf("amount cannot be less than 0") + } + return nil +} + +func (m *BurnShortfallProposal) GetDescription() string { + return m.Description +} + +func (m *BurnShortfallProposal) GetTitle() string { + return m.Title +} + +func (m *BurnShortfallProposal) ProposalRoute() string { + return RouterKey +} + +func (m *BurnShortfallProposal) ProposalType() string { + return ProposalTypeBurnShortfallProposal +} + +func (m *BurnShortfallProposal) ValidateBasic() error { + return m.BurnShortfall.ValidateBasic() +} diff --git a/x/vaults/types/proposal.pb.go b/x/vaults/types/proposal.pb.go index 723b7060..ed7ab358 100644 --- a/x/vaults/types/proposal.pb.go +++ b/x/vaults/types/proposal.pb.go @@ -103,15 +103,55 @@ func (m *UpdatesCollateralProposal) XXX_DiscardUnknown() { var xxx_messageInfo_UpdatesCollateralProposal proto.InternalMessageInfo +type BurnShortfallProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + BurnShortfall MsgBurnShortfall `protobuf:"bytes,3,opt,name=burn_shortfall,json=burnShortfall,proto3" json:"burn_shortfall"` +} + +func (m *BurnShortfallProposal) Reset() { *m = BurnShortfallProposal{} } +func (m *BurnShortfallProposal) String() string { return proto.CompactTextString(m) } +func (*BurnShortfallProposal) ProtoMessage() {} +func (*BurnShortfallProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_784ca0e6565c75e5, []int{2} +} +func (m *BurnShortfallProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BurnShortfallProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BurnShortfallProposal.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 *BurnShortfallProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_BurnShortfallProposal.Merge(m, src) +} +func (m *BurnShortfallProposal) XXX_Size() int { + return m.Size() +} +func (m *BurnShortfallProposal) XXX_DiscardUnknown() { + xxx_messageInfo_BurnShortfallProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_BurnShortfallProposal proto.InternalMessageInfo + func init() { proto.RegisterType((*ActiveCollateralProposal)(nil), "reserve.vaults.ActiveCollateralProposal") proto.RegisterType((*UpdatesCollateralProposal)(nil), "reserve.vaults.UpdatesCollateralProposal") + proto.RegisterType((*BurnShortfallProposal)(nil), "reserve.vaults.BurnShortfallProposal") } func init() { proto.RegisterFile("reserve/vaults/proposal.proto", fileDescriptor_784ca0e6565c75e5) } var fileDescriptor_784ca0e6565c75e5 = []byte{ - // 364 bytes of a gzipped FileDescriptorProto + // 419 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0x4a, 0x2d, 0x4e, 0x2d, 0x2a, 0x4b, 0xd5, 0x2f, 0x4b, 0x2c, 0xcd, 0x29, 0x29, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc8, 0x2f, 0x4e, 0xcc, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xeb, 0x41, 0xa4, @@ -129,12 +169,16 @@ var fileDescriptor_784ca0e6565c75e5 = []byte{ 0x92, 0xd4, 0xbc, 0x92, 0xae, 0xe7, 0x1b, 0xb4, 0x14, 0x60, 0x41, 0x83, 0xcb, 0x63, 0x4a, 0x3f, 0x18, 0xb9, 0x24, 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, 0x9e, 0x89, + 0xb0, 0x7a, 0xc6, 0xc9, 0xf3, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, + 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xf4, + 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xf3, 0xf3, 0xf2, 0x73, 0x2b, + 0xc1, 0x19, 0x21, 0x39, 0x3f, 0x47, 0x1f, 0x66, 0x62, 0x05, 0x3c, 0x4f, 0x55, 0x16, 0xa4, 0x16, + 0x27, 0xb1, 0x81, 0x15, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x84, 0x32, 0x22, 0x10, 0xb7, + 0x03, 0x00, 0x00, } func (m *ActiveCollateralProposal) Marshal() (dAtA []byte, err error) { @@ -231,6 +275,53 @@ func (m *UpdatesCollateralProposal) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *BurnShortfallProposal) 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 *BurnShortfallProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BurnShortfallProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.BurnShortfall.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintProposal(dAtA []byte, offset int, v uint64) int { offset -= sovProposal(v) base := offset @@ -280,6 +371,25 @@ func (m *UpdatesCollateralProposal) Size() (n int) { return n } +func (m *BurnShortfallProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = m.BurnShortfall.Size() + n += 1 + l + sovProposal(uint64(l)) + return n +} + func sovProposal(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -580,6 +690,153 @@ func (m *UpdatesCollateralProposal) Unmarshal(dAtA []byte) error { } return nil } +func (m *BurnShortfallProposal) 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 ErrIntOverflowProposal + } + 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: BurnShortfallProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BurnShortfallProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BurnShortfall", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BurnShortfall.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipProposal(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/vaults/types/tx.pb.go b/x/vaults/types/tx.pb.go index 0b2fdaff..1db711af 100644 --- a/x/vaults/types/tx.pb.go +++ b/x/vaults/types/tx.pb.go @@ -769,6 +769,81 @@ func (m *MsgCloseResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCloseResponse proto.InternalMessageInfo +type MsgBurnShortfall struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + MintDenom string `protobuf:"bytes,2,opt,name=mint_denom,json=mintDenom,proto3" json:"mint_denom,omitempty"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount"` +} + +func (m *MsgBurnShortfall) Reset() { *m = MsgBurnShortfall{} } +func (m *MsgBurnShortfall) String() string { return proto.CompactTextString(m) } +func (*MsgBurnShortfall) ProtoMessage() {} +func (*MsgBurnShortfall) Descriptor() ([]byte, []int) { + return fileDescriptor_bbce2367024dc47b, []int{18} +} +func (m *MsgBurnShortfall) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBurnShortfall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBurnShortfall.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 *MsgBurnShortfall) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBurnShortfall.Merge(m, src) +} +func (m *MsgBurnShortfall) XXX_Size() int { + return m.Size() +} +func (m *MsgBurnShortfall) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBurnShortfall.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBurnShortfall proto.InternalMessageInfo + +type MsgBurnShortfallResponse struct { +} + +func (m *MsgBurnShortfallResponse) Reset() { *m = MsgBurnShortfallResponse{} } +func (m *MsgBurnShortfallResponse) String() string { return proto.CompactTextString(m) } +func (*MsgBurnShortfallResponse) ProtoMessage() {} +func (*MsgBurnShortfallResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bbce2367024dc47b, []int{19} +} +func (m *MsgBurnShortfallResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBurnShortfallResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBurnShortfallResponse.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 *MsgBurnShortfallResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBurnShortfallResponse.Merge(m, src) +} +func (m *MsgBurnShortfallResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBurnShortfallResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBurnShortfallResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBurnShortfallResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "reserve.vaults.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "reserve.vaults.MsgUpdateParamsResponse") @@ -788,84 +863,90 @@ func init() { proto.RegisterType((*MsgRepayResponse)(nil), "reserve.vaults.MsgRepayResponse") proto.RegisterType((*MsgClose)(nil), "reserve.vaults.MsgClose") proto.RegisterType((*MsgCloseResponse)(nil), "reserve.vaults.MsgCloseResponse") + proto.RegisterType((*MsgBurnShortfall)(nil), "reserve.vaults.MsgBurnShortfall") + proto.RegisterType((*MsgBurnShortfallResponse)(nil), "reserve.vaults.MsgBurnShortfallResponse") } func init() { proto.RegisterFile("reserve/vaults/tx.proto", fileDescriptor_bbce2367024dc47b) } var fileDescriptor_bbce2367024dc47b = []byte{ - // 1150 bytes of a gzipped FileDescriptorProto + // 1211 bytes of a gzipped FileDescriptor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64, 0xbe, 0x34, 0x96, - 0xaf, 0xa7, 0x38, 0xb6, 0xe4, 0x3c, 0xda, 0x86, 0xd9, 0x80, 0x86, 0x8d, 0x54, 0x42, 0x84, 0x05, - 0x65, 0xe6, 0x15, 0xb9, 0x7a, 0x77, 0x63, 0xc3, 0xbf, 0xbf, 0x2a, 0x2e, 0xaa, 0x15, 0xe4, 0xee, - 0x57, 0x15, 0xca, 0xec, 0x00, 0x8b, 0xed, 0xca, 0x7d, 0xe2, 0x61, 0xa7, 0x5d, 0x25, 0xce, 0x8b, - 0xa7, 0x37, 0x41, 0x2f, 0x70, 0x95, 0x38, 0x6a, 0x75, 0x50, 0x40, 0xc3, 0xae, 0xf8, 0x7a, 0xcc, - 0x88, 0x1c, 0x98, 0xf6, 0xe9, 0xd7, 0x3b, 0xd4, 0x8d, 0x47, 0xa1, 0x2e, 0x33, 0x74, 0xae, 0x32, - 0x53, 0x29, 0x42, 0x55, 0xe4, 0x63, 0x18, 0x09, 0xf0, 0x5e, 0xc3, 0x25, 0x4d, 0x61, 0x0e, 0x4b, - 0xee, 0x5b, 0x9a, 0xfb, 0xea, 0x71, 0xee, 0xcd, 0x50, 0xa4, 0x58, 0x37, 0x43, 0xa1, 0x58, 0x73, - 0x01, 0xde, 0xab, 0x92, 0xa6, 0x40, 0x5f, 0xc0, 0x38, 0x17, 0xb8, 0x49, 0x7d, 0x2a, 0xda, 0x8d, - 0x2f, 0x09, 0x31, 0xb3, 0xe7, 0x52, 0x3b, 0x96, 0x90, 0x7d, 0x44, 0x08, 0xf2, 0x60, 0x26, 0xbd, - 0x1c, 0x2d, 0x12, 0x62, 0x5f, 0xb4, 0xcd, 0xdc, 0xf9, 0xd6, 0x3d, 0x45, 0xf9, 0x40, 0x31, 0xa2, - 0x47, 0x30, 0x1a, 0xd0, 0x50, 0xd0, 0xd0, 0x93, 0x1e, 0x46, 0xce, 0x55, 0x00, 0x34, 0x55, 0xec, - 0xe0, 0x3d, 0x30, 0x53, 0xdb, 0x46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 0x3d, 0x0e, 0x49, 0xf4, 0xda, 0xab, - 0x8f, 0x0a, 0x43, 0x55, 0x80, 0xae, 0x6a, 0x7d, 0xf5, 0x59, 0xa8, 0xe8, 0x8c, 0xf8, 0xde, 0x55, - 0xd1, 0xf7, 0xae, 0xca, 0x06, 0xa3, 0x61, 0xfa, 0xf6, 0x93, 0xca, 0x43, 0x1f, 0x40, 0x36, 0x36, - 0x44, 0x5c, 0xd9, 0x1a, 0xce, 0xca, 0xa0, 0x73, 0xd6, 0x50, 0xda, 0xbe, 0xd2, 0x55, 0x36, 0x61, - 0xae, 0xd7, 0x59, 0x62, 0xfa, 0x17, 0x03, 0xa0, 0xc6, 0xbd, 0x2a, 0x69, 0x31, 0x4e, 0x05, 0x5a, - 0x80, 0x11, 0x79, 0x41, 0x6b, 0x50, 0x57, 0x7a, 0x1e, 0xaa, 0xe7, 0xe4, 0x78, 0xd3, 0x45, 0xb7, - 0x20, 0xcb, 0x49, 0xe8, 0x92, 0x48, 0x35, 0xb8, 0x53, 0x16, 0x43, 0xc7, 0xc5, 0x3e, 0x70, 0xc0, - 0x76, 0x42, 0xf1, 0xdf, 0x7c, 0xa8, 0x9c, 0xb5, 0x99, 0xb4, 0x0f, 0x4d, 0x59, 0x9e, 0x05, 0xd4, - 0x55, 0x9b, 0x98, 0xf8, 0xd5, 0x80, 0xd1, 0x1a, 0xf7, 0x1e, 0x51, 0xb1, 0xed, 0x46, 0xf8, 0xf1, - 0x85, 0x77, 0x71, 0x55, 0xde, 0x48, 0x3b, 0x72, 0x13, 0x1b, 0x3f, 0x19, 0x90, 0xab, 0x71, 0xaf, - 0x46, 0xc3, 0x8b, 0xff, 0x8f, 0x98, 0x96, 0x6f, 0x85, 0x58, 0x6a, 0x22, 0xff, 0x67, 0x03, 0x46, - 0x6a, 0xdc, 0xab, 0x93, 0x16, 0x6e, 0x5f, 0x78, 0xfd, 0x08, 0xa6, 0x3a, 0x5a, 0x13, 0x03, 0xbe, - 0xd4, 0xbf, 0xe1, 0x33, 0x4e, 0xfe, 0x57, 0xfd, 0xa7, 0x29, 0x90, 0xd5, 0x3a, 0x0a, 0x6e, 0xff, - 0x3d, 0x0c, 0x57, 0x6a, 0xdc, 0x43, 0x9f, 0xc1, 0x58, 0xcf, 0x33, 0xac, 0xd8, 0xff, 0x7c, 0xea, - 0x7b, 0xec, 0x58, 0xef, 0xbc, 0x26, 0xa0, 0x53, 0x01, 0xb9, 0x30, 0x75, 0xec, 0x25, 0xb4, 0x34, - 0x20, 0xb9, 0x3f, 0xc8, 0xba, 0x7e, 0x86, 0xa0, 0xa4, 0x8a, 0x07, 0xd3, 0xc7, 0xef, 0x55, 0x6f, - 0x9d, 0xa8, 0x31, 0x15, 0x65, 0xdd, 0x38, 0x4b, 0x54, 0x52, 0xe8, 0x21, 0x8c, 0xa6, 0xfb, 0x75, - 0x61, 0x40, 0x72, 0x0a, 0xb7, 0xde, 0x3e, 0x1d, 0x4f, 0x68, 0x37, 0x21, 0xd7, 0xe9, 0x88, 0xd6, - 0x80, 0x14, 0x8d, 0x59, 0xe5, 0x93, 0xb1, 0x84, 0xea, 0x3e, 0x8c, 0x24, 0x7d, 0x69, 0x71, 0x40, - 0x7c, 0x07, 0xb4, 0x96, 0x4e, 0x01, 0x13, 0xb6, 0x0f, 0x61, 0x48, 0xb6, 0x87, 0xf9, 0x01, 0xc1, - 0x31, 0x60, 0x15, 0x4f, 0x00, 0x12, 0x86, 0x0d, 0x18, 0x56, 0x27, 0xd4, 0x1c, 0x10, 0x29, 0x11, - 0xab, 0x74, 0x12, 0x92, 0x26, 0x51, 0xc7, 0x64, 0x10, 0x89, 0x44, 0x06, 0x92, 0xf4, 0x6c, 0x76, - 0x6b, 0xf8, 0x9b, 0xf8, 0x98, 0xae, 0x6f, 0x3e, 0x3b, 0x28, 0x18, 0xcf, 0x0f, 0x0a, 0xc6, 0x1f, - 0x07, 0x05, 0xe3, 0x87, 0xc3, 0x42, 0xe6, 0xf9, 0x61, 0x21, 0xf3, 0xf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, 0x3a, 0xd9, 0x8e, 0x36, 0x09, 0xb0, 0xc7, 0xbb, 0x7a, 0xee, 0x64, 0x7d, 0x4f, 0x50, 0xde, + 0x97, 0x8c, 0xe8, 0x21, 0x8c, 0xfb, 0x6e, 0xc0, 0xdd, 0xc0, 0x11, 0x35, 0x8c, 0x9d, 0x68, 0x01, + 0x50, 0x54, 0x51, 0x05, 0xef, 0x82, 0x9e, 0xd8, 0x36, 0x72, 0xab, 0x37, 0x98, 0x15, 0xba, 0x6d, + 0xae, 0xe7, 0x4b, 0xda, 0xe2, 0xf9, 0xfa, 0x6c, 0x1f, 0xff, 0x44, 0xc0, 0x1b, 0x02, 0x4d, 0x9f, + 0x53, 0x38, 0xfe, 0x39, 0xbd, 0x02, 0x62, 0x7d, 0xb5, 0xfd, 0xc7, 0xc5, 0x96, 0xce, 0x47, 0x33, + 0x72, 0xe3, 0x17, 0x65, 0xa5, 0xbd, 0x2d, 0x3f, 0x21, 0x70, 0x91, 0xa1, 0x36, 0xfb, 0x75, 0x40, + 0x22, 0x20, 0xad, 0xf5, 0x82, 0xd0, 0x3a, 0x19, 0x21, 0x29, 0x95, 0x26, 0x4c, 0xa7, 0x8e, 0x9c, + 0xe5, 0xfa, 0xd8, 0x63, 0xfa, 0xc5, 0x92, 0xb6, 0x38, 0x52, 0x47, 0xc9, 0x53, 0x27, 0x11, 0x74, + 0x15, 0x2e, 0x28, 0x79, 0x2a, 0xf4, 0x92, 0x08, 0x9d, 0x90, 0x0a, 0xe5, 0xdc, 0xca, 0xec, 0xb7, + 0x4f, 0x8a, 0x99, 0xbf, 0x9e, 0x14, 0x33, 0x69, 0xe3, 0x28, 0x5f, 0x81, 0x85, 0x21, 0xe7, 0x3e, + 0xf6, 0x85, 0xbf, 0x73, 0x30, 0x13, 0x7b, 0x06, 0x3b, 0x33, 0x86, 0x33, 0x63, 0x38, 0x33, 0x86, + 0xbe, 0x31, 0xcc, 0x42, 0x56, 0x6d, 0x67, 0x69, 0x0a, 0x6a, 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 0xea, 0x1e, 0x8c, 0xc5, 0x0e, 0xbc, 0x30, 0x24, 0xbe, 0x07, + 0x1a, 0x57, 0x0f, 0x01, 0x63, 0xb6, 0x0f, 0x60, 0x44, 0x18, 0xe1, 0xdc, 0x90, 0xe0, 0x08, 0x30, + 0x8a, 0x07, 0x00, 0x31, 0xc3, 0x1a, 0x8c, 0x4a, 0x2f, 0xd2, 0x87, 0x44, 0x0a, 0xc4, 0x28, 0x1d, + 0x84, 0x24, 0x49, 0xa4, 0x21, 0x0c, 0x23, 0x11, 0xc8, 0x50, 0x92, 0xd4, 0xb1, 0x8e, 0x6e, 0xb7, + 0xe9, 0x23, 0x3d, 0x2c, 0x25, 0x15, 0x61, 0x2c, 0x1e, 0x15, 0xd1, 0x23, 0x37, 0x46, 0xbf, 0x8e, + 0x0e, 0xe3, 0xea, 0xfa, 0xb3, 0x9d, 0x82, 0xf6, 0x7c, 0xa7, 0xa0, 0xfd, 0xb9, 0x53, 0xd0, 0xbe, + 0xdf, 0x2d, 0x64, 0x9e, 0xef, 0x16, 0x32, 0x2f, 0x77, 0x0b, 0x99, 0xcf, 0x4d, 0xc7, 0xe5, 0xad, + 0x4e, 0xb3, 0x62, 0x51, 0xdf, 0xa4, 0x01, 0xf5, 0xbb, 0xe2, 0xeb, 0x1e, 0x8b, 0x7a, 0x66, 0xff, + 0x6b, 0x95, 0xde, 0xb7, 0x56, 0xdd, 0x36, 0x61, 0xcd, 0xac, 0x08, 0xb8, 0xfd, 0x6f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xbd, 0xb3, 0xda, 0xe5, 0xd4, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -900,6 +981,7 @@ type MsgClient interface { Repay(ctx context.Context, in *MsgRepay, opts ...grpc.CallOption) (*MsgRepayResponse, error) // Close defines a method for close vault Close(ctx context.Context, in *MsgClose, opts ...grpc.CallOption) (*MsgCloseResponse, error) + BurnShortfall(ctx context.Context, in *MsgBurnShortfall, opts ...grpc.CallOption) (*MsgBurnShortfallResponse, error) } type msgClient struct { @@ -991,6 +1073,15 @@ func (c *msgClient) Close(ctx context.Context, in *MsgClose, opts ...grpc.CallOp return out, nil } +func (c *msgClient) BurnShortfall(ctx context.Context, in *MsgBurnShortfall, opts ...grpc.CallOption) (*MsgBurnShortfallResponse, error) { + out := new(MsgBurnShortfallResponse) + err := c.cc.Invoke(ctx, "/reserve.vaults.Msg/BurnShortfall", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // UpdateParams defines a (governance) operation for updating the module @@ -1013,6 +1104,7 @@ type MsgServer interface { Repay(context.Context, *MsgRepay) (*MsgRepayResponse, error) // Close defines a method for close vault Close(context.Context, *MsgClose) (*MsgCloseResponse, error) + BurnShortfall(context.Context, *MsgBurnShortfall) (*MsgBurnShortfallResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1046,6 +1138,9 @@ func (*UnimplementedMsgServer) Repay(ctx context.Context, req *MsgRepay) (*MsgRe func (*UnimplementedMsgServer) Close(ctx context.Context, req *MsgClose) (*MsgCloseResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Close not implemented") } +func (*UnimplementedMsgServer) BurnShortfall(ctx context.Context, req *MsgBurnShortfall) (*MsgBurnShortfallResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BurnShortfall not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1213,6 +1308,24 @@ func _Msg_Close_Handler(srv interface{}, ctx context.Context, dec func(interface return interceptor(ctx, in, info, handler) } +func _Msg_BurnShortfall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBurnShortfall) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).BurnShortfall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/reserve.vaults.Msg/BurnShortfall", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).BurnShortfall(ctx, req.(*MsgBurnShortfall)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "reserve.vaults.Msg", HandlerType: (*MsgServer)(nil), @@ -1253,6 +1366,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "Close", Handler: _Msg_Close_Handler, }, + { + MethodName: "BurnShortfall", + Handler: _Msg_BurnShortfall_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "reserve/vaults/tx.proto", @@ -2046,6 +2163,76 @@ func (m *MsgCloseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgBurnShortfall) 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 *MsgBurnShortfall) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBurnShortfall) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.MintDenom) > 0 { + i -= len(m.MintDenom) + copy(dAtA[i:], m.MintDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.MintDenom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgBurnShortfallResponse) 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 *MsgBurnShortfallResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBurnShortfallResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -2364,6 +2551,34 @@ func (m *MsgCloseResponse) Size() (n int) { return n } +func (m *MsgBurnShortfall) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MintDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgBurnShortfallResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4700,6 +4915,204 @@ func (m *MsgCloseResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgBurnShortfall) 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: MsgBurnShortfall: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBurnShortfall: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", 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.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintDenom", 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.MintDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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 + } + if err := m.Amount.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 *MsgBurnShortfallResponse) 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: MsgBurnShortfallResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBurnShortfallResponse: 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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0