From 39373577ffb7ec0275fd1ae0f71048925a5a57a4 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev <46343690+RusAkh@users.noreply.github.com> Date: Thu, 3 Nov 2022 09:05:37 +0500 Subject: [PATCH] feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972) * JoinSwapExactAmountIn query * ExitSwapShareAmountIn query * JoinSwapExactAmountIn, ExitSwapShareAmountIn queries * JoinSwapExactAmountIn, ExitSwapShareAmountIn queries * JoinSwapExactAmountIn, ExitSwapShareAmountIn queries * JoinSwapExactAmountIn, ExitSwapShareAmountIn queries * JoinSwapExactAmountIn, ExitSwapShareAmountIn queries * JoinSwapExactAmountIn, ExitSwapShareAmountIn queries * save * test: finish CalcJoinPoolShares query test * tests for CalcExitPoolCoinsFromShares * tests for CalcExitPoolCoinsFromShares * test: add additional exit coin tests * Update x/gamm/keeper/grpc_query.go Co-authored-by: Aleksandr Bezobchuk * Update x/gamm/keeper/grpc_query.go Co-authored-by: Aleksandr Bezobchuk * Update x/gamm/keeper/grpc_query.go Co-authored-by: Aleksandr Bezobchuk * queries * docs fix * chore: generate protobuf files * feat: remove TokensOutDenoms, fix typos * Update x/gamm/keeper/grpc_query_test.go Co-authored-by: Ruslan Akhtariev Co-authored-by: George McAskill <42020095+georgemc98@users.noreply.github.com> Co-authored-by: Roman Co-authored-by: Aleksandr Bezobchuk (cherry picked from commit 94534da031b67a2eca6c24a98a266451130f41e5) # Conflicts: # CHANGELOG.md # x/gamm/keeper/grpc_query.go # x/gamm/keeper/grpc_query_test.go # x/gamm/types/query.pb.go --- CHANGELOG.md | 5 + x/gamm/keeper/grpc_query.go | 3 + x/gamm/keeper/grpc_query_test.go | 3 + x/gamm/types/query.pb.go | 750 +++++++++++++++++++++++++++++++ 4 files changed, 761 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6401f677434..209b425682c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Features * [#2788](https://github.com/osmosis-labs/osmosis/pull/2788) Add logarithm base 2 implementation. +<<<<<<< HEAD * [#2739](https://github.com/osmosis-labs/osmosis/pull/2739),[#3356](https://github.com/osmosis-labs/osmosis/pull/3356) Add pool type query, and add it to stargate whitelist * [#2956](https://github.com/osmosis-labs/osmosis/issues/2956) Add queries for calculating amount of shares/tokens you get by providing X tokens/shares when entering/exiting a pool * [#3313](https://github.com/osmosis-labs/osmosis/pull/3313) Upgrade to IBC v3.4.0, allowing for IBC transfers with metadata. @@ -53,6 +54,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - This PR adds v2 queries for doing the correct thing, and giving people time to migrate from v1beta1 queries to v2. - It also changes cosmwasm to only allow the v2 queries, as no contracts on Osmosis mainnet uses the v1beta1 queries. +======= +* [#2739](https://github.com/osmosis-labs/osmosis/pull/2739) Add pool type query +* [#2956](https://github.com/osmosis-labs/osmosis/issues/2956) Add queries for calculating amount of shares/tokens you get by providing X tokens/shares when entering/exiting a pool +>>>>>>> 94534da0 (feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972)) ### Bug fixes diff --git a/x/gamm/keeper/grpc_query.go b/x/gamm/keeper/grpc_query.go index 3335dc8b281..b83139e693e 100644 --- a/x/gamm/keeper/grpc_query.go +++ b/x/gamm/keeper/grpc_query.go @@ -171,6 +171,7 @@ func (q Querier) CalcJoinPoolShares(ctx context.Context, req *types.QueryCalcJoi }, nil } +<<<<<<< HEAD // PoolsWithFilter query allows to query pools with specific parameters func (q Querier) PoolsWithFilter(ctx context.Context, req *types.QueryPoolsWithFilterRequest) (*types.QueryPoolsWithFilterResponse, error) { res, err := q.Pools(ctx, &types.QueryPoolsRequest{ @@ -261,6 +262,8 @@ func (q Querier) PoolsWithFilter(ctx context.Context, req *types.QueryPoolsWithF }, nil } +======= +>>>>>>> 94534da0 (feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972)) // CalcExitPoolCoinsFromShares queries the amount of tokens you get by exiting a specific amount of shares func (q Querier) CalcExitPoolCoinsFromShares(ctx context.Context, req *types.QueryCalcExitPoolCoinsFromSharesRequest) (*types.QueryCalcExitPoolCoinsFromSharesResponse, error) { if req == nil { diff --git a/x/gamm/keeper/grpc_query_test.go b/x/gamm/keeper/grpc_query_test.go index e5251042183..51d45face6e 100644 --- a/x/gamm/keeper/grpc_query_test.go +++ b/x/gamm/keeper/grpc_query_test.go @@ -90,6 +90,7 @@ func (suite *KeeperTestSuite) TestCalcExitPoolCoinsFromShares() { }) } } +<<<<<<< HEAD func (suite *KeeperTestSuite) TestPoolsWithFilter() { var ( @@ -261,6 +262,8 @@ func (suite *KeeperTestSuite) TestPoolsWithFilter() { } +======= +>>>>>>> 94534da0 (feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972)) func (suite *KeeperTestSuite) TestCalcJoinPoolShares() { queryClient := suite.queryClient ctx := suite.Ctx diff --git a/x/gamm/types/query.pb.go b/x/gamm/types/query.pb.go index fdfc89deaa4..694625ab394 100644 --- a/x/gamm/types/query.pb.go +++ b/x/gamm/types/query.pb.go @@ -1020,7 +1020,11 @@ func (m *QuerySpotPriceResponse) Reset() { *m = QuerySpotPriceResponse{} func (m *QuerySpotPriceResponse) String() string { return proto.CompactTextString(m) } func (*QuerySpotPriceResponse) ProtoMessage() {} func (*QuerySpotPriceResponse) Descriptor() ([]byte, []int) { +<<<<<<< HEAD return fileDescriptor_d9a717df9ca609ef, []int{21} +======= + return fileDescriptor_d9a717df9ca609ef, []int{19} +>>>>>>> 94534da0 (feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972)) } func (m *QuerySpotPriceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1068,7 +1072,11 @@ func (m *QuerySwapExactAmountInRequest) Reset() { *m = QuerySwapExactAmo func (m *QuerySwapExactAmountInRequest) String() string { return proto.CompactTextString(m) } func (*QuerySwapExactAmountInRequest) ProtoMessage() {} func (*QuerySwapExactAmountInRequest) Descriptor() ([]byte, []int) { +<<<<<<< HEAD return fileDescriptor_d9a717df9ca609ef, []int{22} +======= + return fileDescriptor_d9a717df9ca609ef, []int{20} +>>>>>>> 94534da0 (feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972)) } func (m *QuerySwapExactAmountInRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1133,7 +1141,11 @@ func (m *QuerySwapExactAmountInResponse) Reset() { *m = QuerySwapExactAm func (m *QuerySwapExactAmountInResponse) String() string { return proto.CompactTextString(m) } func (*QuerySwapExactAmountInResponse) ProtoMessage() {} func (*QuerySwapExactAmountInResponse) Descriptor() ([]byte, []int) { +<<<<<<< HEAD return fileDescriptor_d9a717df9ca609ef, []int{23} +======= + return fileDescriptor_d9a717df9ca609ef, []int{21} +>>>>>>> 94534da0 (feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972)) } func (m *QuerySwapExactAmountInResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1174,7 +1186,11 @@ func (m *QuerySwapExactAmountOutRequest) Reset() { *m = QuerySwapExactAm func (m *QuerySwapExactAmountOutRequest) String() string { return proto.CompactTextString(m) } func (*QuerySwapExactAmountOutRequest) ProtoMessage() {} func (*QuerySwapExactAmountOutRequest) Descriptor() ([]byte, []int) { +<<<<<<< HEAD return fileDescriptor_d9a717df9ca609ef, []int{24} +======= + return fileDescriptor_d9a717df9ca609ef, []int{22} +>>>>>>> 94534da0 (feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972)) } func (m *QuerySwapExactAmountOutRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1239,7 +1255,11 @@ func (m *QuerySwapExactAmountOutResponse) Reset() { *m = QuerySwapExactA func (m *QuerySwapExactAmountOutResponse) String() string { return proto.CompactTextString(m) } func (*QuerySwapExactAmountOutResponse) ProtoMessage() {} func (*QuerySwapExactAmountOutResponse) Descriptor() ([]byte, []int) { +<<<<<<< HEAD return fileDescriptor_d9a717df9ca609ef, []int{25} +======= + return fileDescriptor_d9a717df9ca609ef, []int{23} +>>>>>>> 94534da0 (feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972)) } func (m *QuerySwapExactAmountOutResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1275,7 +1295,11 @@ func (m *QueryTotalLiquidityRequest) Reset() { *m = QueryTotalLiquidityR func (m *QueryTotalLiquidityRequest) String() string { return proto.CompactTextString(m) } func (*QueryTotalLiquidityRequest) ProtoMessage() {} func (*QueryTotalLiquidityRequest) Descriptor() ([]byte, []int) { +<<<<<<< HEAD return fileDescriptor_d9a717df9ca609ef, []int{26} +======= + return fileDescriptor_d9a717df9ca609ef, []int{24} +>>>>>>> 94534da0 (feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972)) } func (m *QueryTotalLiquidityRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1312,7 +1336,11 @@ func (m *QueryTotalLiquidityResponse) Reset() { *m = QueryTotalLiquidity func (m *QueryTotalLiquidityResponse) String() string { return proto.CompactTextString(m) } func (*QueryTotalLiquidityResponse) ProtoMessage() {} func (*QueryTotalLiquidityResponse) Descriptor() ([]byte, []int) { +<<<<<<< HEAD return fileDescriptor_d9a717df9ca609ef, []int{27} +======= + return fileDescriptor_d9a717df9ca609ef, []int{25} +>>>>>>> 94534da0 (feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972)) } func (m *QueryTotalLiquidityResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1382,6 +1410,7 @@ func init() { func init() { proto.RegisterFile("osmosis/gamm/v1beta1/query.proto", fileDescriptor_d9a717df9ca609ef) } var fileDescriptor_d9a717df9ca609ef = []byte{ +<<<<<<< HEAD // 1695 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xdd, 0x6b, 0x5c, 0x45, 0x14, 0xcf, 0x4d, 0x93, 0x34, 0x99, 0x34, 0x5f, 0xd3, 0xb4, 0x4d, 0x37, 0xe9, 0x6e, 0x1d, 0x35, @@ -1489,6 +1518,110 @@ var fileDescriptor_d9a717df9ca609ef = []byte{ 0x7e, 0x7d, 0x1a, 0x6d, 0x79, 0xfb, 0x64, 0xe8, 0x81, 0x07, 0x7b, 0x4c, 0xa6, 0xf5, 0x35, 0xc7, 0xdf, 0xf0, 0xf6, 0xd4, 0x74, 0x7c, 0x47, 0x6e, 0x2b, 0x9e, 0x7b, 0x6b, 0x1d, 0x62, 0x82, 0x3c, 0xf5, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xac, 0xf5, 0xe8, 0x0d, 0xeb, 0x18, 0x00, 0x00, +======= + // 1603 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4b, 0x6f, 0x1c, 0xc5, + 0x16, 0x76, 0x3b, 0xb6, 0x63, 0x97, 0x6f, 0xfc, 0xa8, 0x38, 0x89, 0x33, 0x4e, 0x66, 0x72, 0xeb, + 0xea, 0xc6, 0x4e, 0x62, 0xf7, 0xc4, 0x8e, 0x23, 0x5d, 0x59, 0x37, 0x0f, 0x3b, 0xb1, 0x93, 0xb1, + 0x20, 0x36, 0x9d, 0x28, 0x08, 0x58, 0x8c, 0xda, 0x76, 0x33, 0xee, 0x64, 0xa6, 0xab, 0x3d, 0x55, + 0x1d, 0xdb, 0x42, 0x11, 0x52, 0x84, 0x58, 0xb1, 0x40, 0x0a, 0x64, 0x81, 0x22, 0xc1, 0x82, 0x05, + 0x62, 0x8d, 0xc4, 0x0f, 0x40, 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x45, 0x65, 0x3b, 0x3e, 0x49, 0x9d, + 0x92, 0x24, 0xbd, 0x35, 0x92, 0x8c, 0x03, 0xd2, 0x4d, 0xc6, 0x51, 0x44, 0x90, 0x47, 0x1a, 0x9a, + 0x68, 0x0c, 0x0e, 0x52, 0x55, 0xce, 0x9a, 0xf6, 0x42, 0x59, 0x5b, 0x44, 0x87, 0x83, 0x0b, 0xb4, + 0x6a, 0x16, 0xcd, 0x42, 0x5b, 0x67, 0x9d, 0x5c, 0x43, 0x47, 0xaa, 0xdc, 0x40, 0x34, 0x93, 0xa8, + 0xc7, 0x95, 0x2b, 0x71, 0x65, 0xd7, 0x00, 0x1d, 0xf2, 0x32, 0xdc, 0xc1, 0x5b, 0x94, 0x9b, 0x79, + 0xe1, 0xed, 0x25, 0x7b, 0xcb, 0xb3, 0x37, 0x6c, 0xbe, 0xdb, 0x16, 0xae, 0x4f, 0x34, 0xb8, 0x19, + 0xb5, 0xfc, 0x01, 0xc0, 0xfb, 0xa8, 0x2f, 0xef, 0x2f, 0x36, 0x66, 0xfb, 0xaa, 0x60, 0x3b, 0xac, + 0x24, 0x81, 0x25, 0x69, 0x2d, 0x03, 0xa1, 0xdd, 0x12, 0x50, 0x27, 0x11, 0xb6, 0x5f, 0x6e, 0x88, + 0x87, 0x46, 0xab, 0xfd, 0x40, 0x88, 0xaf, 0xa1, 0x7f, 0x71, 0xb1, 0x9c, 0x95, 0xa7, 0xd2, 0xcf, + 0x44, 0x4c, 0x94, 0x63, 0x10, 0xe5, 0x41, 0xb5, 0x59, 0xd4, 0x98, 0x18, 0xfd, 0x3c, 0xdc, 0x82, + 0xfc, 0xae, 0x41, 0x09, 0xbe, 0xe9, 0x52, 0xbe, 0x5a, 0xb4, 0xd7, 0xdb, 0x2a, 0xe4, 0x78, 0x11, + 0x0d, 0x09, 0x14, 0x59, 0x93, 0x31, 0x8b, 0x67, 0x37, 0x2c, 0x87, 0x16, 0xe0, 0xe6, 0x8d, 0x85, + 0x05, 0xa7, 0x52, 0x83, 0x18, 0x03, 0x62, 0x69, 0x5e, 0xac, 0x5c, 0x15, 0x0b, 0xf8, 0x3a, 0x1a, + 0xde, 0xf2, 0x28, 0x2f, 0xf7, 0xb3, 0x4f, 0xfa, 0x39, 0xb6, 0x57, 0x4a, 0x8d, 0x2a, 0x3f, 0x55, + 0x2a, 0xc4, 0x18, 0x94, 0x6b, 0xa1, 0xa7, 0xe5, 0xae, 0xde, 0xae, 0xa1, 0x6e, 0xa3, 0x7f, 0xdb, + 0xe6, 0x9b, 0x37, 0xb7, 0x4d, 0x77, 0xc9, 0xb2, 0xc8, 0x0d, 0xb8, 0x2b, 0x91, 0x48, 0x81, 0xdf, + 0x59, 0x84, 0x98, 0x4b, 0x79, 0xd6, 0x15, 0xab, 0x50, 0x56, 0x0f, 0xed, 0x95, 0x52, 0xc3, 0x50, + 0x28, 0x03, 0x19, 0x31, 0xfa, 0x98, 0x6f, 0x4d, 0xfe, 0xd0, 0xd0, 0x71, 0xe5, 0x70, 0xdb, 0x74, + 0x17, 0x77, 0xcc, 0x75, 0x28, 0x9b, 0x19, 0xc7, 0xa7, 0xf0, 0x14, 0xea, 0x61, 0x96, 0xb3, 0x61, + 0x15, 0xc1, 0xe7, 0xf0, 0x5e, 0x29, 0x75, 0x00, 0x7c, 0xca, 0x75, 0x62, 0x80, 0x42, 0x94, 0xed, + 0xce, 0x86, 0x6c, 0xeb, 0x48, 0x3d, 0x1e, 0xe2, 0x65, 0x52, 0xec, 0x1c, 0xdc, 0x2b, 0xa5, 0x06, + 0xfd, 0x64, 0x2b, 0x09, 0x31, 0xf6, 0xcb, 0x9f, 0x19, 0x07, 0xdf, 0x46, 0x3d, 0x45, 0xea, 0x71, + 0x8b, 0x8d, 0x76, 0xc9, 0xfb, 0x31, 0xae, 0xd7, 0x6a, 0x45, 0x75, 0x11, 0x47, 0x10, 0x82, 0xd0, + 0x5f, 0x38, 0x04, 0xe7, 0x08, 0x40, 0x2b, 0x27, 0xc4, 0x00, 0x6f,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0x7b, 0xff, 0x79, 0xb2, + 0xe3, 0xe9, 0xf3, 0x64, 0xc7, 0x0f, 0xcf, 0x93, 0x1d, 0xaf, 0x9f, 0x8d, 0xf4, 0x4d, 0xb0, 0xc7, + 0x54, 0xde, 0x5c, 0x63, 0xc1, 0x86, 0xf7, 0xa6, 0x67, 0xd2, 0x3b, 0x6a, 0x5b, 0xd9, 0x45, 0xad, + 0xf5, 0xc8, 0x7f, 0x15, 0x9c, 0xfb, 0x33, 0x00, 0x00, 0xff, 0xff, 0x69, 0xd3, 0xbc, 0xcf, 0x23, + 0x17, 0x00, 0x00, +>>>>>>> 94534da0 (feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972)) } // Reference imports to suppress errors if they are not otherwise used. @@ -1850,6 +1983,45 @@ func _Query_PoolType_Handler(srv interface{}, ctx context.Context, dec func(inte func _Query_CalcJoinPoolShares_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryCalcJoinPoolSharesRequest) +<<<<<<< HEAD +======= + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CalcJoinPoolShares(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/osmosis.gamm.v1beta1.Query/CalcJoinPoolShares", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CalcJoinPoolShares(ctx, req.(*QueryCalcJoinPoolSharesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_CalcExitPoolCoinsFromShares_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCalcExitPoolCoinsFromSharesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CalcExitPoolCoinsFromShares(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/osmosis.gamm.v1beta1.Query/CalcExitPoolCoinsFromShares", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CalcExitPoolCoinsFromShares(ctx, req.(*QueryCalcExitPoolCoinsFromSharesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_PoolParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPoolParamsRequest) +>>>>>>> 94534da0 (feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972)) if err := dec(in); err != nil { return nil, err } @@ -2314,6 +2486,173 @@ func (m *QueryPoolTypeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { } func (m *QueryCalcJoinPoolSharesRequest) Marshal() (dAtA []byte, err error) { +<<<<<<< HEAD + 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 *QueryCalcJoinPoolSharesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCalcJoinPoolSharesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TokensIn) > 0 { + for iNdEx := len(m.TokensIn) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TokensIn[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.PoolId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryCalcJoinPoolSharesResponse) 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 *QueryCalcJoinPoolSharesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCalcJoinPoolSharesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TokensOut) > 0 { + for iNdEx := len(m.TokensOut) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TokensOut[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size := m.ShareOutAmount.Size() + i -= size + if _, err := m.ShareOutAmount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryCalcExitPoolCoinsFromSharesRequest) 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 *QueryCalcExitPoolCoinsFromSharesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCalcExitPoolCoinsFromSharesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.ShareInAmount.Size() + i -= size + if _, err := m.ShareInAmount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.PoolId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryCalcExitPoolCoinsFromSharesResponse) 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 *QueryCalcExitPoolCoinsFromSharesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCalcExitPoolCoinsFromSharesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TokensOut) > 0 { + for iNdEx := len(m.TokensOut) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TokensOut[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryPoolParamsRequest) Marshal() (dAtA []byte, err error) { +======= +>>>>>>> 94534da0 (feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972)) size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4113,6 +4452,417 @@ func (m *QueryPoolTypeResponse) Unmarshal(dAtA []byte) error { return nil } func (m *QueryCalcJoinPoolSharesRequest) Unmarshal(dAtA []byte) error { +<<<<<<< HEAD +======= + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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: QueryCalcJoinPoolSharesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCalcJoinPoolSharesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) + } + m.PoolId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokensIn", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokensIn = append(m.TokensIn, types1.Coin{}) + if err := m.TokensIn[len(m.TokensIn)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCalcJoinPoolSharesResponse) 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 ErrIntOverflowQuery + } + 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: QueryCalcJoinPoolSharesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCalcJoinPoolSharesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShareOutAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ShareOutAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokensOut", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokensOut = append(m.TokensOut, types1.Coin{}) + if err := m.TokensOut[len(m.TokensOut)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCalcExitPoolCoinsFromSharesRequest) 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 ErrIntOverflowQuery + } + 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: QueryCalcExitPoolCoinsFromSharesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCalcExitPoolCoinsFromSharesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) + } + m.PoolId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShareInAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ShareInAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCalcExitPoolCoinsFromSharesResponse) 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 ErrIntOverflowQuery + } + 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: QueryCalcExitPoolCoinsFromSharesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCalcExitPoolCoinsFromSharesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokensOut", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokensOut = append(m.TokensOut, types1.Coin{}) + if err := m.TokensOut[len(m.TokensOut)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryPoolParamsRequest) Unmarshal(dAtA []byte) error { +>>>>>>> 94534da0 (feat(gamm): CalcJoinPoolShares and CalcExitPoolCoinsFromShares queries (#2972)) l := len(dAtA) iNdEx := 0 for iNdEx < l {