From ee10806478f5573ad78b1db4618a49db733109b2 Mon Sep 17 00:00:00 2001 From: jelysn Date: Mon, 27 Nov 2023 20:39:13 +0800 Subject: [PATCH] add recipient on SwapByDenom --- proto/elys/amm/tx.proto | 1 + x/amm/client/cli/tx_swap_by_denom.go | 6 +- x/amm/keeper/msg_server_swap_by_denom.go | 5 +- x/amm/types/message_swap_by_denom.go | 3 +- x/amm/types/tx.pb.go | 205 ++++++++++++++--------- 5 files changed, 138 insertions(+), 82 deletions(-) diff --git a/proto/elys/amm/tx.proto b/proto/elys/amm/tx.proto index af0a3a082..765080502 100644 --- a/proto/elys/amm/tx.proto +++ b/proto/elys/amm/tx.proto @@ -112,6 +112,7 @@ message MsgSwapByDenom { string denom_in = 5; string denom_out = 6; string discount = 7 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string recipient = 8; } message MsgSwapByDenomResponse { diff --git a/x/amm/client/cli/tx_swap_by_denom.go b/x/amm/client/cli/tx_swap_by_denom.go index d7ee70400..f309368ce 100644 --- a/x/amm/client/cli/tx_swap_by_denom.go +++ b/x/amm/client/cli/tx_swap_by_denom.go @@ -20,10 +20,10 @@ const ( func CmdSwapByDenom() *cobra.Command { cmd := &cobra.Command{ - Use: "swap-by-denom [amount] [denom-in] [denom-out]", + Use: "swap-by-denom [amount] [denom-in] [denom-out] [recipient]", Short: "Swap an exact amount of tokens for a minimum of another token or a maximum amount of tokens for an exact amount on another token, similar to swapping a token on the trade screen GUI.", Example: "elysd tx amm swap-by-denom 1000000000uatom uatom uusd --min-amount=1000000000uatom --max-amount=1000000000uatom --discount=0.1 --from jack --keyring-backend test", - Args: cobra.ExactArgs(3), + Args: cobra.ExactArgs(4), RunE: func(cmd *cobra.Command, args []string) (err error) { argAmount, err := sdk.ParseCoinNormalized(args[0]) if err != nil { @@ -31,6 +31,7 @@ func CmdSwapByDenom() *cobra.Command { } argDenomIn := args[1] argDenomOut := args[2] + argRecipient := args[3] minAmountStr, err := cmd.Flags().GetString(FlagMinAmount) if err != nil { @@ -72,6 +73,7 @@ func CmdSwapByDenom() *cobra.Command { msg := types.NewMsgSwapByDenom( clientCtx.GetFromAddress().String(), + argRecipient, argAmount, minAmount, maxAmount, diff --git a/x/amm/keeper/msg_server_swap_by_denom.go b/x/amm/keeper/msg_server_swap_by_denom.go index 35960fda2..adf1f000d 100644 --- a/x/amm/keeper/msg_server_swap_by_denom.go +++ b/x/amm/keeper/msg_server_swap_by_denom.go @@ -43,9 +43,10 @@ func (k msgServer) SwapByDenom(goCtx context.Context, msg *types.MsgSwapByDenom) } res, err := k.SwapExactAmountIn( - ctx, + sdk.WrapSDKContext(ctx), &types.MsgSwapExactAmountIn{ Sender: msg.Sender, + Recipient: msg.Recipient, Routes: route, TokenIn: msg.Amount, TokenOutMinAmount: msg.MinAmount.Amount, @@ -79,7 +80,7 @@ func (k msgServer) SwapByDenom(goCtx context.Context, msg *types.MsgSwapByDenom) } res, err := k.SwapExactAmountOut( - ctx, + sdk.WrapSDKContext(ctx), &types.MsgSwapExactAmountOut{ Sender: msg.Sender, Routes: route, diff --git a/x/amm/types/message_swap_by_denom.go b/x/amm/types/message_swap_by_denom.go index 8e3188587..7cd5fb1be 100644 --- a/x/amm/types/message_swap_by_denom.go +++ b/x/amm/types/message_swap_by_denom.go @@ -9,9 +9,10 @@ const TypeMsgSwapByDenom = "swap_by_denom" var _ sdk.Msg = &MsgSwapByDenom{} -func NewMsgSwapByDenom(sender string, amount sdk.Coin, minAmount sdk.Coin, maxAmount sdk.Coin, denomIn string, denomOut string, discount sdk.Dec) *MsgSwapByDenom { +func NewMsgSwapByDenom(sender, recipient string, amount sdk.Coin, minAmount sdk.Coin, maxAmount sdk.Coin, denomIn string, denomOut string, discount sdk.Dec) *MsgSwapByDenom { return &MsgSwapByDenom{ Sender: sender, + Recipient: recipient, Amount: amount, MinAmount: minAmount, MaxAmount: maxAmount, diff --git a/x/amm/types/tx.pb.go b/x/amm/types/tx.pb.go index c3a6311df..923b32391 100644 --- a/x/amm/types/tx.pb.go +++ b/x/amm/types/tx.pb.go @@ -774,6 +774,7 @@ type MsgSwapByDenom struct { DenomIn string `protobuf:"bytes,5,opt,name=denom_in,json=denomIn,proto3" json:"denom_in,omitempty"` DenomOut string `protobuf:"bytes,6,opt,name=denom_out,json=denomOut,proto3" json:"denom_out,omitempty"` Discount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=discount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"discount"` + Recipient string `protobuf:"bytes,8,opt,name=recipient,proto3" json:"recipient,omitempty"` } func (m *MsgSwapByDenom) Reset() { *m = MsgSwapByDenom{} } @@ -851,6 +852,13 @@ func (m *MsgSwapByDenom) GetDenomOut() string { return "" } +func (m *MsgSwapByDenom) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + type MsgSwapByDenomResponse struct { Amount types.Coin `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount"` InRoute []*SwapAmountInRoute `protobuf:"bytes,2,rep,name=in_route,json=inRoute,proto3" json:"in_route,omitempty"` @@ -935,83 +943,83 @@ func init() { func init() { proto.RegisterFile("elys/amm/tx.proto", fileDescriptor_ed7ddafd861f6b7f) } var fileDescriptor_ed7ddafd861f6b7f = []byte{ - // 1207 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0x3a, 0x89, 0x63, 0x3f, 0x37, 0x4d, 0xb3, 0x4d, 0x1a, 0xc7, 0x4d, 0x1c, 0xb3, 0x48, - 0xc1, 0xaa, 0x54, 0x5b, 0x0d, 0x02, 0xd4, 0xa8, 0x02, 0xea, 0x26, 0x41, 0xae, 0x6a, 0x25, 0xda, - 0x4a, 0x15, 0x02, 0xc1, 0x6a, 0x63, 0x4f, 0x9d, 0x51, 0xbc, 0x33, 0xcb, 0xce,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, 0x1a, 0xa1, 0x96, 0x87, 0x1c, 0x1b, - 0x13, 0x4c, 0xda, 0xf9, 0xe9, 0x92, 0x56, 0xce, 0x98, 0x39, 0x42, 0xcd, 0xd0, 0x64, 0xfc, 0xac, - 0xc1, 0xcd, 0x1e, 0x12, 0x22, 0x06, 0x07, 0x6d, 0x4a, 0x7b, 0x23, 0x9b, 0xda, 0x84, 0x0c, 0xa7, - 0x87, 0x88, 0x08, 0xbe, 0x52, 0xa3, 0xf1, 0x35, 0x23, 0x03, 0xea, 0xc4, 0xf8, 0x21, 0x28, 0xd9, - 0x76, 0x17, 0xf3, 0xf1, 0x4a, 0xf6, 0x09, 0xcc, 0x39, 0x98, 0x44, 0x25, 0x13, 0x59, 0x8d, 0x58, - 0xb3, 0x59, 0x07, 0x13, 0x55, 0x33, 0x91, 0xc5, 0x33, 0x98, 0x4b, 0xf0, 0x83, 0xc9, 0x98, 0x35, - 0x9b, 0xed, 0xa1, 0xa7, 0x4e, 0xf4, 0x75, 0x98, 0x0b, 0xd8, 0xa1, 0x3e, 0xb7, 0x5a, 0x88, 0x50, - 0x47, 0x56, 0x2d, 0x6b, 0xce, 0x4a, 0xf3, 0xae, 0xcf, 0xb7, 0x84, 0xd1, 0x78, 0x2a, 0xcb, 0x16, - 0x12, 0x11, 0x95, 0xed, 0x01, 0x64, 0xa3, 0xf0, 0x51, 0xd9, 0xcd, 0x84, 0xc8, 0xc6, 0xdf, 0x29, - 0x58, 0x68, 0xb0, 0xf6, 0xd3, 0x23, 0xdb, 0xdd, 0xee, 0xda, 0x4d, 0x1e, 0xed, 0x6a, 0x18, 0xcf, - 0xf7, 0x21, 0x2d, 0x7b, 0x0c, 0x53, 0xef, 0xba, 0x1d, 0x9f, 0x5b, 0x01, 0x12, 0xc6, 0x9b, 0x62, - 0x8d, 0x7a, 0x9b, 0x0a, 0x48, 0xc8, 0x60, 0x52, 0xf6, 0x8a, 0x91, 0x65, 0xa0, 0x5b, 0xb0, 0x10, - 0x93, 0x14,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3, 0xe2, 0xc4, 0xcb, 0xb3, 0xe2, 0xc4, 0xef, 0x67, 0xc5, 0x89, 0xcf, 0xca, - 0x3d, 0x42, 0x15, 0xb8, 0x77, 0x09, 0xe2, 0x47, 0xd4, 0x3b, 0x94, 0x0f, 0xd5, 0x6e, 0xf0, 0x6f, - 0x05, 0x21, 0xd7, 0xfd, 0xb4, 0xfc, 0x62, 0x7f, 0xf7, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8a, - 0xb0, 0xb5, 0x3d, 0x6f, 0x10, 0x00, 0x00, + // 1211 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xda, 0x89, 0x63, 0x3f, 0x37, 0xff, 0x36, 0x49, 0xe3, 0xb8, 0x89, 0x63, 0x16, 0x29, + 0x58, 0x95, 0x6a, 0xab, 0x41, 0x80, 0x1a, 0x55, 0x40, 0xdd, 0x24, 0xc8, 0x55, 0xad, 0x44, 0x5b, + 0xa9, 0x42, 0x20, 0xb0, 0x36, 0xf6, 0xd4, 0x19, 0xc5, 0x3b, 0xb3, 0x78, 0x66, 0x89, 0x03, 0x07, + 0x24, 0x38, 0x70, 0xe5, 0xcc, 0x57, 0xe0, 0xce, 0x17, 0x80, 0x43, 0x8f, 0x3d, 0xa2, 0x1e, 0x02, + 0x4a, 0xbe, 0x00, 0xe2, 0x13, 0xa0, 0x99, 0x9d, 0xdd, 0xf5, 0xfa, 0x4f, 0xe2, 0x98, 0xd0, 0x53, + 0xbc, 0xef, 0xcd, 0xfb, 0xed, 0xbc, 0xdf, 0xfb, 0xcd, 0x7b, 0xb3, 0x81, 0x05, 0xd4, 0x3a, 0x65, + 0x25, 0xcb, 0xb6, 0x4b, 0xbc, 0x53, 0x74, 0xda, 0x94, 0x53, 0x3d, 0x29, 0x4c, 0x45, 0xcb, 0xb6, + 0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0x56, 0x23, + 0xd6, 0x6c, 0xc6, 0xc6, 0x44, 0xd5, 0x4c, 0x64, 0xf1, 0x1c, 0xe6, 0x22, 0xfc, 0x60, 0x32, 0x66, + 0xcd, 0x66, 0xba, 0xe8, 0xa9, 0x10, 0x7d, 0x13, 0xe6, 0x3c, 0x76, 0xa8, 0xcb, 0x6b, 0x0d, 0x44, + 0xa8, 0x2d, 0xab, 0x96, 0x32, 0x67, 0xa4, 0x79, 0xdf, 0xe5, 0x3b, 0xc2, 0x68, 0x3c, 0x93, 0x65, + 0xf3, 0x89, 0x08, 0xca, 0xf6, 0x10, 0x52, 0x41, 0xf8, 0xa8, 0xec, 0x26, 0x7d, 0x64, 0xe3, 0xef, + 0x18, 0x2c, 0x55, 0x59, 0xf3, 0xd9, 0x89, 0xe5, 0xec, 0x76, 0xac, 0x3a, 0x0f, 0x76, 0x35, 0x8c, + 0xe7, 0x07, 0x90, 0x90, 0x3d, 0x86, 0xa9, 0x77, 0xdd, 0x09, 0xcf, 0xad, 0x00, 0xf1, 0xe3, 0x4d, + 0xb1, 0x46, 0xbd, 0x4d, 0x05, 0x44, 0x64, 0x10, 0x97, 0xbd, 0x62, 0x64, 0x19, 0xe8, 0x35, 0x58, + 0x0a, 0x49, 0x0a, 0xeb, 0x39, 0x66, 0x05, 0x16, 0xfc, 0xfc, 0xab, 0x7e, 0x85, 0xf5, 0x27, 0x90, + 0x6c, 0x60, 0x56, 0x97, 0xa0, 0x53, 0xd7, 0x06, 0xdd, 0x41, 0x75, 0x33, 0x88, 0xd7, 0xd7, 0x20, + 0xd5, 0x46, 0x75, 0xec, 0x60, 0x44, 0x78, 0x26, 0x21, 0xe9, 0x0b, 0x0d, 0xc6, 0xef, 0x1a, 0xac, + 0x0d, 0xa2, 0xbc, 0xfb, 0x20, 0x86, 0xb9, 0xaa, 0x3c, 0xc7, 0x3c, 0x88, 0x7e, 0x9e, 0x03, 0x92, + 0x8c, 0xfd, 0xb7, 0x24, 0x8d, 0x7f, 0x62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0x61, 0x62, 0x91, 0x0f, 0x95, 0xec, 0xc6, 0x10, 0x47, 0x50, 0x96, 0x8f, 0x21, 0x19, 0x7c, + 0x98, 0x2c, 0x47, 0x16, 0xfb, 0xe6, 0xec, 0xfa, 0x40, 0x73, 0x37, 0x42, 0x70, 0x4f, 0x8e, 0x22, + 0xf8, 0xe6, 0x1e, 0x84, 0xbe, 0xcb, 0xe4, 0xe7, 0xb0, 0xd0, 0x7f, 0x15, 0xcc, 0x45, 0x62, 0xfa, + 0xfc, 0xd9, 0xcd, 0xcb, 0xfd, 0x01, 0xf8, 0x97, 0xa0, 0x0f, 0xb8, 0x2d, 0x6c, 0x5c, 0x16, 0xbd, + 0xef, 0xf2, 0xec, 0x3b, 0x57, 0x2c, 0x08, 0xf0, 0x2b, 0x90, 0xee, 0x6e, 0x3a, 0x99, 0xbe, 0x38, + 0xe5, 0xc9, 0xe6, 0x87, 0x79, 0x02, 0xa8, 0xef, 0x60, 0xfd, 0xf2, 0xf1, 0x74, 0x37, 0x02, 0x71, + 0xe9, 0xda, 0xec, 0xd6, 0xe8, 0x6b, 0xfd, 0x0d, 0x94, 0xcb, 0x2f, 0xcf, 0x73, 0xda, 0xab, 0xf3, + 0x9c, 0xf6, 0xd7, 0x79, 0x4e, 0xfb, 0xe9, 0x22, 0x37, 0xf1, 0xea, 0x22, 0x37, 0xf1, 0xc7, 0x45, + 0x6e, 0xe2, 0xb3, 0x42, 0x97, 0x50, 0x05, 0xee, 0x3d, 0x82, 0xf8, 0x09, 0x6d, 0x1f, 0xcb, 0x87, + 0x52, 0xc7, 0xfb, 0xa7, 0x83, 0x90, 0xeb, 0x61, 0x42, 0x7e, 0xcf, 0xbf, 0xfb, 0x6f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x35, 0x3c, 0x45, 0x03, 0x8d, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2040,6 +2048,13 @@ func (m *MsgSwapByDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x42 + } { size := m.Discount.Size() i -= size @@ -2491,6 +2506,10 @@ func (m *MsgSwapByDenom) Size() (n int) { } l = m.Discount.Size() n += 1 + l + sovTx(uint64(l)) + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -4751,6 +4770,38 @@ func (m *MsgSwapByDenom) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", 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.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])