diff --git a/proto/elys/margin/tx.proto b/proto/elys/margin/tx.proto index 042fe2558..bba09e2c2 100644 --- a/proto/elys/margin/tx.proto +++ b/proto/elys/margin/tx.proto @@ -5,6 +5,7 @@ package elys.margin; option go_package = "github.com/elys-network/elys/x/margin/types"; import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; import "elys/margin/params.proto"; import "elys/margin/types.proto"; @@ -36,10 +37,16 @@ message MsgOpenResponse { message MsgClose { string creator = 1; uint64 id = 2; + cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false + ]; } message MsgCloseResponse { uint64 id = 1; + cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.nullable) = false + ]; } message MsgBrokerOpen { @@ -61,10 +68,16 @@ message MsgBrokerClose { string creator = 1; uint64 id = 2; string owner = 3; + cosmos.base.v1beta1.Coin amount = 4 [ + (gogoproto.nullable) = false + ]; } message MsgBrokerCloseResponse { uint64 id = 1; + cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false + ]; } message MsgUpdateParams { diff --git a/x/margin/client/cli/tx_broker_close.go b/x/margin/client/cli/tx_broker_close.go index b3ce7e634..7cbdba99a 100644 --- a/x/margin/client/cli/tx_broker_close.go +++ b/x/margin/client/cli/tx_broker_close.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/elys-network/elys/x/margin/types" "github.com/spf13/cobra" ) @@ -18,7 +19,7 @@ func CmdBrokerClose() *cobra.Command { Use: "broker-close [mtp-id] [mtp-owner] [flags]", Short: "Close margin position as a broker", Example: `elysd tx margin broker-close 1 sif123 --from=treasury --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000`, - Args: cobra.ExactArgs(2), + Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -29,8 +30,8 @@ func CmdBrokerClose() *cobra.Command { return errors.New("signer address is missing") } - argMtpId, ok := strconv.ParseUint(args[0], 10, 64) - if ok != nil { + argMtpId, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { return errors.New("invalid mtp id") } @@ -39,10 +40,16 @@ func CmdBrokerClose() *cobra.Command { return errors.New("invalid mtp owner address") } + argAmount, err := sdk.ParseCoinNormalized(args[2]) + if err != nil { + return errors.New("invalid amount") + } + msg := types.NewMsgBrokerClose( signer.String(), argMtpId, argMtpOwner, + argAmount, ) if err := msg.ValidateBasic(); err != nil { return err diff --git a/x/margin/client/cli/tx_close.go b/x/margin/client/cli/tx_close.go index 2a0fb9cec..da407ffba 100644 --- a/x/margin/client/cli/tx_close.go +++ b/x/margin/client/cli/tx_close.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/elys-network/elys/x/margin/types" "github.com/spf13/cobra" ) @@ -15,10 +16,10 @@ var _ = strconv.Itoa(0) func CmdClose() *cobra.Command { cmd := &cobra.Command{ - Use: "close [mtp-id] [flags]", + Use: "close [mtp-id] [amount] [flags]", Short: "Close margin position", - Example: `elysd tx margin close 1 --from=treasury --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000`, - Args: cobra.ExactArgs(1), + Example: `elysd tx margin close 1 10000000 --from=treasury --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000`, + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -29,14 +30,20 @@ func CmdClose() *cobra.Command { return errors.New("signer address is missing") } - argMtpId, ok := strconv.ParseUint(args[0], 10, 64) - if ok != nil { + argMtpId, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { return errors.New("invalid mtp id") } + argAmount, err := sdk.ParseCoinNormalized(args[1]) + if err != nil { + return errors.New("invalid amount") + } + msg := types.NewMsgClose( signer.String(), argMtpId, + argAmount, ) if err := msg.ValidateBasic(); err != nil { return err diff --git a/x/margin/client/cli/tx_close_test.go b/x/margin/client/cli/tx_close_test.go index ee61fe448..dfc329080 100644 --- a/x/margin/client/cli/tx_close_test.go +++ b/x/margin/client/cli/tx_close_test.go @@ -23,6 +23,7 @@ func TestClosePosition(t *testing.T) { // ... args := []string{ "1", + "10000000uusd", "--from=" + val.Address.String(), "-y", } diff --git a/x/margin/client/wasm/msg_broker_close.go b/x/margin/client/wasm/msg_broker_close.go index 500a8077d..3893696c2 100644 --- a/x/margin/client/wasm/msg_broker_close.go +++ b/x/margin/client/wasm/msg_broker_close.go @@ -40,7 +40,7 @@ func PerformMsgBrokerClose(f *marginkeeper.Keeper, ctx sdk.Context, contractAddr } msgServer := marginkeeper.NewMsgServerImpl(*f) - msgMsgBrokerClose := margintypes.NewMsgBrokerClose(msgBrokerClose.Creator, uint64(msgBrokerClose.Id), msgBrokerClose.Owner) + msgMsgBrokerClose := margintypes.NewMsgBrokerClose(msgBrokerClose.Creator, uint64(msgBrokerClose.Id), msgBrokerClose.Owner, msgBrokerClose.Amount) if err := msgMsgBrokerClose.ValidateBasic(); err != nil { return nil, errorsmod.Wrap(err, "failed validating msgMsgBrokerClose") diff --git a/x/margin/client/wasm/msg_close.go b/x/margin/client/wasm/msg_close.go index 20d95bc99..163117713 100644 --- a/x/margin/client/wasm/msg_close.go +++ b/x/margin/client/wasm/msg_close.go @@ -40,7 +40,7 @@ func PerformMsgClose(f *marginkeeper.Keeper, ctx sdk.Context, contractAddr sdk.A } msgServer := marginkeeper.NewMsgServerImpl(*f) - msgMsgClose := margintypes.NewMsgClose(msgClose.Creator, uint64(msgClose.Id)) + msgMsgClose := margintypes.NewMsgClose(msgClose.Creator, uint64(msgClose.Id), msgClose.Amount) if err := msgMsgClose.ValidateBasic(); err != nil { return nil, errorsmod.Wrap(err, "failed validating msgMsgClose") diff --git a/x/margin/keeper/broker_close.go b/x/margin/keeper/broker_close.go index 4abb32287..d601e54c5 100644 --- a/x/margin/keeper/broker_close.go +++ b/x/margin/keeper/broker_close.go @@ -6,7 +6,7 @@ import ( ) func (k Keeper) BrokerClose(ctx sdk.Context, msg *types.MsgBrokerClose) (*types.MsgBrokerCloseResponse, error) { - msgClose := types.NewMsgClose(msg.Owner, msg.Id) + msgClose := types.NewMsgClose(msg.Owner, msg.Id, msg.Amount) res, err := k.Close(ctx, msgClose) if err != nil { diff --git a/x/margin/keeper/invariant_check_test.go b/x/margin/keeper/invariant_check_test.go index b3d8777f1..0278376ab 100644 --- a/x/margin/keeper/invariant_check_test.go +++ b/x/margin/keeper/invariant_check_test.go @@ -122,6 +122,7 @@ func TestCheckBalanceInvariant_InvalidBalance(t *testing.T) { msg3 := margintypes.NewMsgClose( addr[0].String(), mtpId, + sdk.NewCoin(ptypes.BaseCurrency, sdk.NewInt(100000000)), ) _, err = mk.Close(ctx, msg3) diff --git a/x/margin/types/msgs.go b/x/margin/types/msgs.go index 8fdb56032..cfea65b59 100644 --- a/x/margin/types/msgs.go +++ b/x/margin/types/msgs.go @@ -27,10 +27,11 @@ var ( _ sdk.Msg = &MsgDewhitelist{} ) -func NewMsgClose(creator string, id uint64) *MsgClose { +func NewMsgClose(creator string, id uint64, amount sdk.Coin) *MsgClose { return &MsgClose{ Creator: creator, Id: id, + Amount: amount, } } @@ -104,11 +105,12 @@ func (msg *MsgOpen) ValidateBasic() error { return nil } -func NewMsgBrokerClose(creator string, id uint64, owner string) *MsgBrokerClose { +func NewMsgBrokerClose(creator string, id uint64, owner string, amount sdk.Coin) *MsgBrokerClose { return &MsgBrokerClose{ Creator: creator, Id: id, Owner: owner, + Amount: amount, } } diff --git a/x/margin/types/tx.pb.go b/x/margin/types/tx.pb.go index 8f9f491d5..a99397d42 100644 --- a/x/margin/types/tx.pb.go +++ b/x/margin/types/tx.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -145,8 +146,9 @@ func (m *MsgOpenResponse) GetId() uint64 { } type MsgClose struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` } func (m *MsgClose) Reset() { *m = MsgClose{} } @@ -196,8 +198,16 @@ func (m *MsgClose) GetId() uint64 { return 0 } +func (m *MsgClose) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + type MsgCloseResponse struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"` } func (m *MsgCloseResponse) Reset() { *m = MsgCloseResponse{} } @@ -240,6 +250,13 @@ func (m *MsgCloseResponse) GetId() uint64 { return 0 } +func (m *MsgCloseResponse) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + type MsgBrokerOpen struct { Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` CollateralAsset string `protobuf:"bytes,2,opt,name=collateral_asset,json=collateralAsset,proto3" json:"collateral_asset,omitempty"` @@ -364,9 +381,10 @@ func (m *MsgBrokerOpenResponse) GetId() uint64 { } type MsgBrokerClose struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` - Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` + Amount types.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"` } func (m *MsgBrokerClose) Reset() { *m = MsgBrokerClose{} } @@ -423,8 +441,16 @@ func (m *MsgBrokerClose) GetOwner() string { return "" } +func (m *MsgBrokerClose) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + type MsgBrokerCloseResponse struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` } func (m *MsgBrokerCloseResponse) Reset() { *m = MsgBrokerCloseResponse{} } @@ -467,6 +493,13 @@ func (m *MsgBrokerCloseResponse) GetId() uint64 { return 0 } +func (m *MsgBrokerCloseResponse) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + type MsgUpdateParams struct { // authority is the address that controls the module (defaults to x/gov unless overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` @@ -851,54 +884,58 @@ func init() { func init() { proto.RegisterFile("elys/margin/tx.proto", fileDescriptor_01b9dbed35cc5a15) } var fileDescriptor_01b9dbed35cc5a15 = []byte{ - // 751 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0xcf, 0x4e, 0xdb, 0x4e, - 0x10, 0x4e, 0xe2, 0x04, 0xc2, 0x84, 0x1f, 0x7f, 0x96, 0x00, 0xc6, 0xf0, 0x0b, 0xe0, 0x56, 0x2d, - 0x15, 0x22, 0x51, 0x69, 0x4f, 0x95, 0x7a, 0x80, 0xd2, 0x03, 0x55, 0x23, 0x22, 0x4b, 0x55, 0x25, - 0xda, 0x2a, 0x32, 0xf6, 0xd6, 0x58, 0x71, 0xbc, 0xd6, 0xee, 0xd2, 0xc0, 0x5b, 0xf4, 0x35, 0xfa, - 0x20, 0x95, 0x38, 0x72, 0xac, 0x7a, 0x40, 0x08, 0x5e, 0xa4, 0xf2, 0xda, 0x71, 0xd6, 0x21, 0x09, - 0xa2, 0x52, 0xa5, 0x1e, 0x7a, 0x4a, 0x76, 0xbe, 0x99, 0x6f, 0xbe, 0xf5, 0x7c, 0x1e, 0x19, 0xca, - 0xd8, 0x3b, 0x63, 0xb5, 0xb6, 0x49, 0x1d, 0xd7, 0xaf, 0xf1, 0xd3, 0x6a, 0x40, 0x09, 0x27, 0xa8, - 0x14, 0x46, 0xab, 0x51, 0x54, 0x2b, 0x3b, 0xc4, 0x21, 0x22, 0x5e, 0x0b, 0xff, 0x45, 0x29, 0x9a, - 0x2a, 0x17, 0x06, 0x26, 0x35, 0xdb, 0x2c, 0x46, 0x16, 0x53, 0x94, 0x67, 0x01, 0x8e, 0x01, 0xfd, - 0x9b, 0x02, 0xe3, 0x75, 0xe6, 0x1c, 0x04, 0xd8, 0x47, 0x2a, 0x8c, 0x5b, 0x14, 0x9b, 0x9c, 0x50, - 0x35, 0xbb, 0x96, 0xdd, 0x98, 0x30, 0xba, 0x47, 0xf4, 0x04, 0x66, 0x2c, 0xe2, 0x79, 0x26, 0xc7, - 0xd4, 0xf4, 0x9a, 0x26, 0x63, 0x98, 0xab, 0x39, 0x91, 0x32, 0xdd, 0x8b, 0xef, 0x84, 0x61, 0xf4, - 0x01, 0x66, 0xe5, 0xd4, 0x36, 0x39, 0xf1, 0xb9, 0xaa, 0x84, 0xb9, 0xbb, 0xd5, 0xf3, 0xcb, 0xd5, - 0xcc, 0xcf, 0xcb, 0xd5, 0x47, 0x8e,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xb1, 0x58, 0xca, 0xa9, 0xe1, 0xc5, 0x2b, 0x4f, 0x5b, 0x19, 0x14, 0x4d, - 0x1c, 0xf4, 0x12, 0x0a, 0x91, 0x49, 0xe7, 0xfb, 0xd3, 0x44, 0x58, 0xfb, 0x7f, 0x60, 0x38, 0x29, - 0x7f, 0x0b, 0x20, 0x6d, 0x36, 0xad, 0x3f, 0xb9, 0x87, 0x69, 0xfa, 0x70, 0x2c, 0x61, 0x3b, 0x80, - 0x92, 0xfc, 0xde, 0x2c, 0x0f, 0x2e, 0x89, 0x84, 0x3d, 0x18, 0x01, 0x26, 0x84, 0x06, 0x4c, 0xa6, - 0x5f, 0x86, 0xfe, 0x22, 0x19, 0xd5, 0x1e, 0x8e, 0x42, 0x65, 0x91, 0xb2, 0xcf, 0x97, 0x87, 0x14, - 0x85, 0xe0, 0x6d, 0x91, 0x03, 0x8c, 0x8b, 0xf6, 0x61, 0xa2, 0xe7, 0xda, 0xa5, 0xfe, 0x8a, 0x04, - 0xd2, 0xd6, 0x87, 0x42, 0xb2, 0x36, 0xd9, 0x89, 0xb7, 0xb4, 0x49, 0xe0, 0x6d, 0x6d, 0x03, 0x2c, - 0xb6, 0xfb, 0xfa, 0xfc, 0xba, 0x92, 0xbd, 0xb8, 0xae, 0x64, 0xaf, 0xae, 0x2b, 0xd9, 0xaf, 0x37, - 0x95, 0xcc, 0xc5, 0x4d, 0x25, 0xf3, 0xe3, 0xa6, 0x92, 0x39, 0xdc, 0x94, 0xd6, 0x6b, 0x48, 0xb4, - 0xe5, 0x63, 0xde, 0x21, 0xb4, 0x25, 0x0e, 0xb5, 0xd3, 0xd4, 0x37, 0xd3, 0xd1, 0x98, 0xf8, 0x68, - 0x7a, 0xf6, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xe1, 0x6d, 0x30, 0x74, 0xa2, 0x09, 0x00, 0x00, + // 816 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0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 0x0e, 0x30, 0x45, 0xaf, 0x5c, 0x67, 0x52, 0x95, 0xeb, 0x57, + 0x29, 0xdf, 0x41, 0x49, 0xba, 0xa8, 0xca, 0xe1, 0xba, 0x91, 0x08, 0x32, 0x62, 0xa3, 0x19, 0xc2, + 0x68, 0xc6, 0x31, 0xf6, 0xc3, 0x7a, 0x21, 0xde, 0x84, 0x25, 0xd2, 0xf5, 0x0b, 0x58, 0xec, 0xb7, + 0x9b, 0x24, 0x49, 0x22, 0xcf, 0x4d, 0x47, 0xfe, 0x4f, 0x1e, 0x3e, 0x6b, 0x50, 0xaf, 0x4e, 0x70, + 0x07, 0x91, 0x4f, 0x06, 0xfd, 0xf8, 0x0d, 0xaa, 0x54, 0xa1, 0x88, 0x7b, 0x21, 0x22, 0x6a, 0x99, + 0x6f, 0x3b, 0x59, 0xe8, 0x5f, 0xc3, 0xca, 0xd0, 0x35, 0x4e, 0x34, 0xef, 0x9f, 0x59, 0x98, 0x4f, + 0x33, 0xa7, 0xf5, 0x70, 0xda, 0x3b, 0x2f, 0xf5, 0x96, 0xcc, 0x57, 0x98, 0xce, 0x7c, 0x36, 0xac, + 0x0e, 0x4b, 0x79, 0x07, 0x7f, 0x4f, 0x39, 0x3c, 0xbf, 0xf1, 0x71, 0xfe, 0x25, 0x72, 0x6d, 0x86, + 0x9a, 0xfc, 0xb1, 0x56, 0x36, 0x61, 0xd6, 0xbe, 0x62, 0x97, 0x98, 0xf8, 0xec, 0x56, 0x6c, 0x78, + 0x10, 0x50, 0xf6, 0xa0, 0x94, 0x3c, 0xea, 0x62, 0x92, 0x96, 0x87, 0x7d, 0xc3, 0x21, 0x4b, 0xa4, + 0xe8, 0xeb, 0xb0, 0x36, 0xc2, 0xde, 0xdf, 0x81, 0xee, 0xf1, 0x63, 0x16, 0x10, 0xc6, 0xc1, 0x5b, + 0x7d, 0xab, 0x50, 0x8c, 0xe2, 0x34, 0x35, 0xb7, 0x9d, 0x8f, 0x8f, 0x96, 0x2f, 0x62, 0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0xb5, 0xc9, 0x4e, 0x7c, 0xa1, 0x4d, 0x02, 0x5f, 0x6a, 0x1b, 0x63, + 0xb1, 0xfa, 0x8f, 0x77, 0x4f, 0xb5, 0xec, 0xfd, 0x53, 0x2d, 0xfb, 0xf8, 0x54, 0xcb, 0xfe, 0xf5, + 0x5c, 0xcb, 0xdc, 0x3f, 0xd7, 0x32, 0xff, 0x3e, 0xd7, 0x32, 0xe7, 0x7b, 0xd2, 0x8b, 0x1e, 0x13, + 0xed, 0x87, 0x88, 0xf5, 0x30, 0xe9, 0xf0, 0x85, 0x79, 0x33, 0xf4, 0x61, 0xd8, 0x2e, 0xf1, 0x2f, + 0xc3, 0x6f, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xa5, 0x47, 0xe7, 0xe7, 0xa7, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1360,6 +1397,16 @@ func (m *MsgClose) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a if m.Id != 0 { i = encodeVarintTx(dAtA, i, uint64(m.Id)) i-- @@ -1395,6 +1442,16 @@ func (m *MsgCloseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 if m.Id != 0 { i = encodeVarintTx(dAtA, i, uint64(m.Id)) i-- @@ -1537,6 +1594,16 @@ func (m *MsgBrokerClose) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 if len(m.Owner) > 0 { i -= len(m.Owner) copy(dAtA[i:], m.Owner) @@ -1579,6 +1646,16 @@ func (m *MsgBrokerCloseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a if m.Id != 0 { i = encodeVarintTx(dAtA, i, uint64(m.Id)) i-- @@ -1909,6 +1986,8 @@ func (m *MsgClose) Size() (n int) { if m.Id != 0 { n += 1 + sovTx(uint64(m.Id)) } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -1921,6 +2000,8 @@ func (m *MsgCloseResponse) Size() (n int) { if m.Id != 0 { n += 1 + sovTx(uint64(m.Id)) } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -1987,6 +2068,8 @@ func (m *MsgBrokerClose) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -1999,6 +2082,8 @@ func (m *MsgBrokerCloseResponse) Size() (n int) { if m.Id != 0 { n += 1 + sovTx(uint64(m.Id)) } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -2536,6 +2621,39 @@ func (m *MsgClose) Unmarshal(dAtA []byte) error { break } } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2605,6 +2723,39 @@ func (m *MsgCloseResponse) Unmarshal(dAtA []byte) error { break } } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -3106,6 +3257,39 @@ func (m *MsgBrokerClose) Unmarshal(dAtA []byte) error { } m.Owner = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -3175,6 +3359,39 @@ func (m *MsgBrokerCloseResponse) Unmarshal(dAtA []byte) error { break } } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])