From 3e8ead2f68875069890d3654fcdd2df1f1a731f8 Mon Sep 17 00:00:00 2001 From: shrenujb <98204323+shrenujb@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:54:15 -0400 Subject: [PATCH] remove deposit amount from pml message (#2158) Signed-off-by: Shrenuj Bansal --- .../src/codegen/dydxprotocol/listing/tx.ts | 18 +-- proto/dydxprotocol/listing/tx.proto | 7 - .../msg_create_market_permissionless_test.go | 2 - protocol/x/listing/types/tx.pb.go | 122 +++++------------- 4 files changed, 36 insertions(+), 113 deletions(-) diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/listing/tx.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/listing/tx.ts index a9671092af..7e8d14a123 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/listing/tx.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/listing/tx.ts @@ -41,9 +41,6 @@ export interface MsgCreateMarketPermissionless { /** The subaccount to deposit from. */ subaccountId?: SubaccountId; - /** Number of quote quantums to deposit. */ - - quoteQuantums: Uint8Array; } /** * MsgCreateMarketPermissionless is a message used to create new markets without @@ -56,9 +53,6 @@ export interface MsgCreateMarketPermissionlessSDKType { /** The subaccount to deposit from. */ subaccount_id?: SubaccountIdSDKType; - /** Number of quote quantums to deposit. */ - - quote_quantums: Uint8Array; } /** * MsgCreateMarketPermissionlessResponse defines the @@ -199,8 +193,7 @@ export const MsgSetMarketsHardCapResponse = { function createBaseMsgCreateMarketPermissionless(): MsgCreateMarketPermissionless { return { ticker: "", - subaccountId: undefined, - quoteQuantums: new Uint8Array() + subaccountId: undefined }; } @@ -214,10 +207,6 @@ export const MsgCreateMarketPermissionless = { SubaccountId.encode(message.subaccountId, writer.uint32(18).fork()).ldelim(); } - if (message.quoteQuantums.length !== 0) { - writer.uint32(26).bytes(message.quoteQuantums); - } - return writer; }, @@ -238,10 +227,6 @@ export const MsgCreateMarketPermissionless = { message.subaccountId = SubaccountId.decode(reader, reader.uint32()); break; - case 3: - message.quoteQuantums = reader.bytes(); - break; - default: reader.skipType(tag & 7); break; @@ -255,7 +240,6 @@ export const MsgCreateMarketPermissionless = { const message = createBaseMsgCreateMarketPermissionless(); message.ticker = object.ticker ?? ""; message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? SubaccountId.fromPartial(object.subaccountId) : undefined; - message.quoteQuantums = object.quoteQuantums ?? new Uint8Array(); return message; } diff --git a/proto/dydxprotocol/listing/tx.proto b/proto/dydxprotocol/listing/tx.proto index 572586e15e..8f0808de9e 100644 --- a/proto/dydxprotocol/listing/tx.proto +++ b/proto/dydxprotocol/listing/tx.proto @@ -49,13 +49,6 @@ message MsgCreateMarketPermissionless { // The subaccount to deposit from. dydxprotocol.subaccounts.SubaccountId subaccount_id = 2; - - // Number of quote quantums to deposit. - bytes quote_quantums = 3 [ - (gogoproto.customtype) = - "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", - (gogoproto.nullable) = false - ]; } // MsgCreateMarketPermissionlessResponse defines the diff --git a/protocol/x/listing/keeper/msg_create_market_permissionless_test.go b/protocol/x/listing/keeper/msg_create_market_permissionless_test.go index 61e7dda62d..a4c531739a 100644 --- a/protocol/x/listing/keeper/msg_create_market_permissionless_test.go +++ b/protocol/x/listing/keeper/msg_create_market_permissionless_test.go @@ -1,7 +1,6 @@ package keeper_test import ( - "github.com/dydxprotocol/v4-chain/protocol/dtypes" testapp "github.com/dydxprotocol/v4-chain/protocol/testutil/app" "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" "github.com/dydxprotocol/v4-chain/protocol/x/listing/keeper" @@ -91,7 +90,6 @@ func TestMsgCreateMarketPermissionless(t *testing.T) { Owner: constants.AliceAccAddress.String(), Number: 0, }, - QuoteQuantums: dtypes.SerializableInt{}, } _, err = ms.CreateMarketPermissionless(ctx, &msg) diff --git a/protocol/x/listing/types/tx.pb.go b/protocol/x/listing/types/tx.pb.go index 5da888bc0a..4d8ce4644e 100644 --- a/protocol/x/listing/types/tx.pb.go +++ b/protocol/x/listing/types/tx.pb.go @@ -11,7 +11,6 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - github_com_dydxprotocol_v4_chain_protocol_dtypes "github.com/dydxprotocol/v4-chain/protocol/dtypes" types "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -131,8 +130,6 @@ type MsgCreateMarketPermissionless struct { Ticker string `protobuf:"bytes,1,opt,name=ticker,proto3" json:"ticker,omitempty"` // The subaccount to deposit from. SubaccountId *types.SubaccountId `protobuf:"bytes,2,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id,omitempty"` - // Number of quote quantums to deposit. - QuoteQuantums github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,3,opt,name=quote_quantums,json=quoteQuantums,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"quote_quantums"` } func (m *MsgCreateMarketPermissionless) Reset() { *m = MsgCreateMarketPermissionless{} } @@ -327,45 +324,41 @@ func init() { func init() { proto.RegisterFile("dydxprotocol/listing/tx.proto", fileDescriptor_144a579c1e2dcb94) } var fileDescriptor_144a579c1e2dcb94 = []byte{ - // 594 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x8d, 0xdb, 0x4f, 0x95, 0x3a, 0x5f, 0x53, 0xa9, 0x56, 0x04, 0xc1, 0x6a, 0x9d, 0x10, 0x09, - 0x9a, 0x56, 0xaa, 0x2d, 0x52, 0x40, 0xa2, 0x08, 0x09, 0x52, 0x84, 0x5a, 0x41, 0xa4, 0xe2, 0x48, - 0x2c, 0xd8, 0x58, 0x13, 0x7b, 0x70, 0x46, 0xb5, 0x3d,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e8, 0xd6, 0x4c, 0x29, 0x06, 0xa2, 0x7d, 0x57, 0x50, 0x21, - 0x55, 0xf5, 0x45, 0xea, 0x82, 0x57, 0x38, 0xf6, 0xc5, 0x53, 0x12, 0x31, 0xa0, 0xe2, 0x28, 0x31, - 0xc4, 0xdc, 0x13, 0xaf, 0xa1, 0xa5, 0xd4, 0x52, 0x52, 0x4f, 0xd3, 0x98, 0xf4, 0x02, 0x8c, 0xa9, - 0x8d, 0xab, 0xff, 0xf5, 0x24, 0xb3, 0x24, 0xc8, 0x25, 0x3f, 0x6c, 0xa1, 0xcd, 0x7f, 0x30, 0xef, - 0xdf, 0xb2, 0xf2, 0x65, 0x11, 0x2d, 0xd6, 0xc0, 0x53, 0x01, 0xad, 0x5d, 0x36, 0xf4, 0xf6, 0x64, - 0x5a, 0x93, 0xbc, 0xa6, 0x55, 0xae, 0x9e, 0xdb, 0x6f, 0xae, 0x7e, 0x50, 0x90, 0x36, 0xc3, 0x94, - 0xbb, 0x53, 0x21, 0xa7, 0x17, 0x69, 0x0f, 0xe7, 0x28, 0x1a, 0x10, 0xfa, 0xac, 0xa0, 0xf5, 0x99, - 0x03, 0xbf, 0x37, 0xeb, 0x96, 0x53, 0xcb, 0xb4, 0x47, 0x73, 0x95, 0xf5, 0x69, 0x55, 0xeb, 0x67, - 0x1d, 0x5d, 0x39, 0xef, 0xe8, 0xca, 0xef, 0x8e, 0xae, 0x7c, 0xea, 0xea, 0x99, 0xf3, 0xae, 0x9e, - 0xf9, 0xd9, 0xd5, 0x33, 0xaf, 0x1f, 0x5c, 0xfd, 0xc9, 0xb4, 0x86, 0xff, 0xdd, 0xde, 0xdb, 0x69, - 0x2c, 0x25, 0x91, 0xdd, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xde, 0xd1, 0xee, 0x34, 0x9c, 0x05, - 0x00, 0x00, + // 535 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0xce, 0x52, 0x54, 0xa9, 0x0b, 0x45, 0xaa, 0x15, 0x41, 0xb0, 0x5a, 0xb7, 0x44, 0x82, 0xfe, + 0x48, 0xb5, 0x45, 0x0a, 0x48, 0x14, 0x71, 0x20, 0x45, 0x08, 0x04, 0x91, 0x2a, 0x47, 0xe2, 0xc0, + 0xc5, 0xda, 0xd8, 0x8b, 0xbd, 0x6a, 0xec, 0xb5, 0x76, 0xd6, 0x55, 0x72, 0xe5, 0x01, 0x80, 0x03, + 0x07, 0xce, 0x3c, 0x01, 0x07, 0x0e, 0x3c, 0x42, 0x8f, 0x15, 0x27, 0x4e, 0x08, 0x25, 0x07, 0x5e, + 0x03, 0xc5, 0xbb, 0xf9, 0x53, 0x9d, 0x80, 0x72, 0xf2, 0xce, 0xce, 0x7c, 0xdf, 0x7c, 0xe3, 0x6f, + 0xb4, 0x78, 0x23, 0xe8, 0x06, 0x9d, 0x54, 0x70, 0xc9, 0x7d, 0xde, 0x76, 0xda, 0x0c, 0x24, 0x4b, + 0x42, 0x47, 0x76, 0xec, 0xfc, 0xce, 0x28, 0x4f, 0xa6, 0x6d, 0x9d, 0x36, 0x6f, 0xfa, 0x1c, 0x62, + 0x0e, 0x5e, 0x9e, 0x70, 0x54, 0xa0, 0x00, 0xe6, 0x0d, 0x15, 0x39, 0x31, 0x84, 0xce, 0xe9, 0xdd, + 0xc1, 0x47, 0x27, 0xca, 0x21, 0x0f, 0xb9, 0x02, 0x0c, 0x4e, 0xfa, 0x76, 0x77, 0xaa, 0x3d, 0x64, + 0x2d, 0xe2, 0xfb, 0x3c, 0x4b, 0x24, 0x4c, 0x9c, 0x75, 0xe9, 0xad, 0x42, 0xa5, 0x29, 0x11, 0x24, + 0xd6, 0xcd, 0xab, 0x1f, 0x10, 0x2e, 0x37, 0x20, 0x6c, 0x52, 0xd9, 0x20, 0xe2, 0x84, 0x4a, 0x78, + 0x4e, 0x44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0xbc, 0xac, 0x1c, 0xd6, 0xe3, 0x39, 0x76, + 0xd1, 0x42, 0xda, 0x33, 0x1b, 0xd7, 0x2f, 0x9f, 0xfd, 0xda, 0x2c, 0xb9, 0x9a, 0xe4, 0x82, 0x3d, + 0xbb, 0x78, 0xfb, 0x1f, 0xca, 0x87, 0x53, 0xd6, 0xbe, 0x2c, 0xe1, 0xa5, 0x06, 0x84, 0x06, 0xe0, + 0xb5, 0x8b, 0xfb, 0xb5, 0x57, 0x2c, 0xab, 0xc8, 0x7a, 0xb3, 0xf6, 0xff, 0xb5, 0xc3, 0xe6, 0xc6, + 0x7b, 0x84, 0xcd, 0x39, 0x3b, 0x72, 0x30, 0x93, 0x72, 0x36, 0xc8, 0x7c, 0xb4, 0x00, 0x68, 0x24, + 0xe8, 0x13, 0xc2, 0xeb, 0x73, 0x0d, 0xbf, 0x3f, 0x6f, 0xca, 0x99, 0x30, 0xf3, 0xf1, 0x42, 0xb0, + 0xa1, 0xac, 0x7a, 0xf3, 0xac, 0x67, 0xa1, 0xf3, 0x9e, 0x85, 0x7e, 0xf7, 0x2c, 0xf4, 0xb1, 0x6f, + 0x95, 0xce, 0xfb, 0x56, 0xe9, 0x67, 0xdf, 0x2a, 0xbd, 0x79, 0x18, 0x32, 0x19, 0x65, 0x2d, 0xdb, + 0xe7, 0xb1, 0x33, 0xf5, 0x90, 0x9c, 0xde, 0xdb, 0xf7, 0x23, 0xc2, 0x12, 0x67, 0x74, 0xd3, 0x19, + 0x3f, 0x83, 0xdd, 0x94, 0x42, 0x6b, 0x39, 0xcf, 0x1c, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xfa, + 0xd7, 0x13, 0x8c, 0x2b, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -604,16 +597,6 @@ func (m *MsgCreateMarketPermissionless) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l - { - size := m.QuoteQuantums.Size() - i -= size - if _, err := m.QuoteQuantums.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a if m.SubaccountId != nil { { size, err := m.SubaccountId.MarshalToSizedBuffer(dAtA[:i]) @@ -772,8 +755,6 @@ func (m *MsgCreateMarketPermissionless) Size() (n int) { l = m.SubaccountId.Size() n += 1 + l + sovTx(uint64(l)) } - l = m.QuoteQuantums.Size() - n += 1 + l + sovTx(uint64(l)) return n } @@ -1064,39 +1045,6 @@ func (m *MsgCreateMarketPermissionless) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QuoteQuantums", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.QuoteQuantums.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])