From 22eb589fa8bfe5929e9c04972d862b93cb89c1b7 Mon Sep 17 00:00:00 2001 From: orngefrost Date: Sun, 18 Oct 2020 23:37:32 +0900 Subject: [PATCH 1/5] common: reformat --- proto/osmosis/gamm/v1beta1/tx.proto | 128 ++++++++++++++-------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/proto/osmosis/gamm/v1beta1/tx.proto b/proto/osmosis/gamm/v1beta1/tx.proto index a3ac966802d..66ba68dacb4 100644 --- a/proto/osmosis/gamm/v1beta1/tx.proto +++ b/proto/osmosis/gamm/v1beta1/tx.proto @@ -73,100 +73,100 @@ message MsgExitPool { // ===================== MsgCreatePool message TokenInfo { string denom = 1 [ - (gogoproto.moretags) = "yaml:\"denom\"" - ]; + (gogoproto.moretags) = "yaml:\"denom\"" + ]; string ratio = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"ratio\"", - (gogoproto.nullable) = false - ]; + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"ratio\"", + (gogoproto.nullable) = false + ]; string amount = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"amount\"", - (gogoproto.nullable) = false - ]; + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.nullable) = false + ]; } message MsgCreatePool { bytes sender = 1 [ - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", - (gogoproto.moretags) = "yaml:\"sender\"" - ]; + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.moretags) = "yaml:\"sender\"" + ]; string swapFee = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"swap_fee\"", - (gogoproto.nullable) = false - ]; + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"swap_fee\"", + (gogoproto.nullable) = false + ]; repeated TokenInfo tokenInfo = 3 [ - (gogoproto.moretags) = "yaml:\"token_info\"", - (gogoproto.nullable) = false - ]; + (gogoproto.moretags) = "yaml:\"token_info\"", + (gogoproto.nullable) = false + ]; } // ===================== MsgSwapExactAmountIn message MsgSwapExactAmountIn { bytes sender = 1 [ - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", - (gogoproto.moretags) = "yaml:\"sender\"" - ]; + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.moretags) = "yaml:\"sender\"" + ]; bytes targetPool = 2 [ - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", - (gogoproto.moretags) = "yaml:\"target_pool\"" - ]; + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.moretags) = "yaml:\"target_pool\"" + ]; cosmos.base.v1beta1.Coin tokenIn = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.moretags) = "yaml:\"token_in\"", - (gogoproto.nullable) = false - ]; + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.moretags) = "yaml:\"token_in\"", + (gogoproto.nullable) = false + ]; string tokenAmountIn = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"token_amount_in\"", - (gogoproto.nullable) = false - ]; + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"token_amount_in\"", + (gogoproto.nullable) = false + ]; cosmos.base.v1beta1.Coin tokenOut = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.moretags) = "yaml:\"token_out\"", - (gogoproto.nullable) = false - ]; + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.moretags) = "yaml:\"token_out\"", + (gogoproto.nullable) = false + ]; string minAmountOut = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"min_amount_out\"", - (gogoproto.nullable) = false - ]; + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"min_amount_out\"", + (gogoproto.nullable) = false + ]; string maxPrice = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"max_price\"", - (gogoproto.nullable) = false - ]; + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"max_price\"", + (gogoproto.nullable) = false + ]; } // ===================== MsgSwapExactAmountOut message MsgSwapExactAmountOut { bytes sender = 1 [ - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", - (gogoproto.moretags) = "yaml:\"sender\"" - ]; + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.moretags) = "yaml:\"sender\"" + ]; bytes targetPool = 2 [ - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", - (gogoproto.moretags) = "yaml:\"target_pool\"" - ]; + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.moretags) = "yaml:\"target_pool\"" + ]; cosmos.base.v1beta1.Coin tokenIn = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.moretags) = "yaml:\"token_in\"", - (gogoproto.nullable) = false - ]; + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.moretags) = "yaml:\"token_in\"", + (gogoproto.nullable) = false + ]; string maxAmountIn = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"max_amount_in\"", - (gogoproto.nullable) = false - ]; + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"max_amount_in\"", + (gogoproto.nullable) = false + ]; cosmos.base.v1beta1.Coin tokenOut = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.moretags) = "yaml:\"token_out\"", - (gogoproto.nullable) = false - ]; + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.moretags) = "yaml:\"token_out\"", + (gogoproto.nullable) = false + ]; string tokenAmountOut = 6 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.moretags) = "yaml:\"token_amount_out\"", From 947f3c34fdc2b0a9914521b48aa64bb89b4bb5f1 Mon Sep 17 00:00:00 2001 From: orngefrost Date: Sun, 18 Oct 2020 23:50:04 +0900 Subject: [PATCH 2/5] fix(x/gamm): naming miss * Ratio -> Weight --- proto/osmosis/gamm/v1beta1/tx.proto | 4 +- x/gamm/keeper/pool/service.go | 2 +- x/gamm/types/tx.pb.go | 109 ++++++++++++++++------------ 3 files changed, 65 insertions(+), 50 deletions(-) diff --git a/proto/osmosis/gamm/v1beta1/tx.proto b/proto/osmosis/gamm/v1beta1/tx.proto index 66ba68dacb4..2e19e623a1c 100644 --- a/proto/osmosis/gamm/v1beta1/tx.proto +++ b/proto/osmosis/gamm/v1beta1/tx.proto @@ -75,9 +75,9 @@ message TokenInfo { string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; - string ratio = 2 [ + string weight = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"ratio\"", + (gogoproto.moretags) = "yaml:\"weight\"", (gogoproto.nullable) = false ]; string amount = 3 [ diff --git a/x/gamm/keeper/pool/service.go b/x/gamm/keeper/pool/service.go index d3545a23531..9983b0a40f8 100644 --- a/x/gamm/keeper/pool/service.go +++ b/x/gamm/keeper/pool/service.go @@ -47,7 +47,7 @@ func (p poolService) CreatePool( records := make(map[string]types.Record, len(tokenInfo)) for _, info := range tokenInfo { records[info.Denom] = types.Record{ - DenormalizedWeight: info.Ratio, + DenormalizedWeight: info.Weight, Balance: info.Amount, } } diff --git a/x/gamm/types/tx.pb.go b/x/gamm/types/tx.pb.go index d2bc8146312..959f4f013b2 100644 --- a/x/gamm/types/tx.pb.go +++ b/x/gamm/types/tx.pb.go @@ -243,8 +243,8 @@ func (m *MsgExitPool) GetMinAmountsOut() []MinAmountOut { // ===================== MsgCreatePool type TokenInfo struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` - Ratio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=ratio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"ratio" yaml:"ratio"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"ratio"` + Weight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"weight" yaml:"weight"` + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` } func (m *TokenInfo) Reset() { *m = TokenInfo{} } @@ -470,46 +470,61 @@ func init() { func init() { proto.RegisterFile("osmosis/gamm/v1beta1/tx.proto", fileDescriptor_cfc8fd3ac7df3247) } var fileDescriptor_cfc8fd3ac7df3247 = []byte{ - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x95, 0x4d, 0x6f, 0xd3, 0x30, - 0x18, 0xc7, 0x9b, 0xbd, 0xa1, 0x7a, 0xad, 0x80, 0x68, 0x9b, 0xca, 0xa4, 0x25,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b1, 0x22, 0x3f, 0xf7, 0xd7, 0x56, 0x44, - 0xa4, 0x60, 0x45, 0x4e, 0x85, 0x3f, 0xa4, 0x15, 0x4f, 0x06, 0x11, 0xff, 0x6f, 0xad, 0x38, 0x01, - 0xb5, 0xe9, 0xd8, 0x5a, 0x44, 0x49, 0xf1, 0xac, 0x74, 0x12, 0xab, 0xbf, 0x4b, 0x21, 0x86, 0x55, - 0x84, 0xeb, 0xc7, 0xa0, 0x3e, 0x49, 0x87, 0x65, 0x0a, 0x4a, 0x27, 0xe0, 0x1f, 0x9c, 0x28, 0x8c, - 0xd5, 0x31, 0x94, 0x14, 0x6b, 0x97, 0x13, 0x67, 0x4a, 0xbe, 0x19, 0x30, 0xfc, 0xa6, 0x81, 0xea, - 0x01, 0x3d, 0xc1, 0xa4, 0x45, 0x8e, 0xe8, 0xb5, 0x9d, 0x38, 0x00, 0x8b, 0x09, 0xe2, 0x11, 0x55, - 0x3e, 0xec, 0x95, 0x48, 0xe1, 0x31, 0xf6, 0xa7, 0x54, 0x01, 0x81, 0xae, 0x84, 0xe9, 0xaf, 0xc1, - 0x92, 0x6c, 0x55, 0x85, 0xbb, 0x57, 0x3a, 0xdc, 0x59, 0xac, 0xa2, 0xc1, 0x4f, 0x73, 0xa0, 0xde, - 0x66, 0xe1, 0x7e, 0x82, 0x11, 0xc7, 0xff, 0x5c, 0xb0, 0xb7, 0xe0, 0x06, 0x3b, 0x45, 0xbd, 0xa7, - 0x18, 0xab, 0x74, 0x9a, 0xa5, 0xd3, 0xb9, 0xa9, 0x5a, 0x39, 0x45, 0x3d, 0xef, 0x08, 0x63, 0xe8, - 0xe6, 0x44, 0xfd, 0x0d, 0xa8, 0xf2, 0x7c, 0x5a, 0x8d, 0x79, 0x21, 0x85, 0x79, 0xb5, 0x14, 0x93, - 0xa1, 0x3a, 0x77, 0x94, 0x11, 0xea, 0x37, 0x28, 0xce, 0x7b, 0x11, 0x39, 0xa2, 0xd0, 0x9d, 0xc2, - 0x9c, 0xfd, 0xf3, 0xa1, 0xa1, 0x5d, 0x0c, 0x0d, 0xed, 0xeb, 0xd0, 0xd0, 0xde, 0x8f, 0x8c, 0xca, - 0xc5, 0xc8, 0xa8, 0x7c, 0x1e, 0x19, 0x95, 0xc3, 0x7b, 0xc5, 0xbe, 0x77, 0xf2, 0x67, 0x2c, 0xff, - 0x0e, 0xe4, 0x83, 0x26, 0xda, 0xef, 0x2c, 0x89, 0x07, 0xe8, 0xc1, 0xaf, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x52, 0xa9, 0x56, 0x26, 0xed, 0x06, 0x00, 0x00, + // 857 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4d, 0x4f, 0xe3, 0x46, + 0x18, 0x8e, 0xf9, 0x08, 0x64, 0x92, 0xb4, 0xd4, 0x0a, 0x34, 0x20, 0x61, 0xd3, 0x39, 0x50, 0x7a, + 0xc0, 0x11, 0x54, 0xea, 0xa1, 0x17, 0x14, 0xa7, 0x40, 0x53, 0x29, 0x2a, 0x72, 0x2b, 0xb5, 0xa2, + 0x52, 0x23, 0xc7, 0x19, 0x1c, 0x0b, 0x3c, 0x93, 0x66, 0x9c, 0x26, 0xf4, 0x3f, 0x74, 0xb5, 0xc7, + 0xdd, 0xeb, 0xfe, 0x1a, 0x8e, 0x1c, 0x57, 0x7b, 0xb0, 0x56, 0xa0, 0xfd, 0x03, 0xb9, 0xec, 0x6a, + 0x4f, 0x2b, 0xcf, 0x8c, 0x3f, 0x12, 0xb2, 0x5a, 0xac, 0x08, 0xed, 0x1e, 0xf6, 0x64, 0x6b, 0x3e, + 0x9e, 0xe7, 0x9d, 0xe7, 0x7d, 0xde, 0x77, 0x6c, 0xb0, 0x49, 0xa8, 0x4b, 0xa8, 0x43, 0x2b, 0xb6, + 0xe9, 0xba, 0x95, 0x7f, 0xf7, 0x5a, 0xc8, 0x33, 0xf7, 0x2a, 0x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9, + 0x07, 0x00, 0x3c, 0xb3, 0x67, 0x23, 0x2f, 0x60, 0x62, 0xe7, 0x59, 0xd0, 0xd7, 0x46, 0xbe, 0x2a, + 0x73, 0x7c, 0x3e, 0xd7, 0xec, 0x12, 0x72, 0x01, 0x8d, 0xc4, 0x4a, 0x19, 0x83, 0x62, 0x30, 0xc8, + 0x23, 0xfe, 0xb5, 0xef, 0x95, 0xe7, 0x99, 0x14, 0x3f, 0xa7, 0x96, 0x62, 0x8d, 0x13, 0x05, 0x60, + 0x42, 0x8b, 0x26, 0xe9, 0x7b, 0xd0, 0x18, 0x87, 0x97, 0xdb, 0xa0, 0x10, 0x09, 0x44, 0xeb, 0xb8, + 0xbc, 0xb0, 0x35, 0xbf, 0x93, 0xdf, 0xff, 0x46, 0x9b, 0xe6, 0x08, 0x2d, 0x91, 0x57, 0x7d, 0x33, + 0x88, 0x68, 0xe4, 0xab, 0xab, 0x93, 0x92, 0xd3, 0xa6, 0x83, 0xa1, 0x31, 0x86, 0x0a, 0x9f, 0x4a, + 0xa0, 0xd0, 0x70, 0x70, 0x4c, 0x9b, 0xc6, 0x15, 0xe1, 0xbe, 0x99, 0x5d, 0xe1, 0xe0, 0x84, 0x2b, + 0x42, 0x54, 0xf8, 0x86, 0xbb, 0xe2, 0x70, 0xe8, 0x78, 0x9f, 0xac, 0x2b, 0xce, 0x41, 0x21, 0x4e, + 0x5b, 0x1d, 0x0b, 0x53, 0x1c, 0xa7, 0x56, 0x62, 0xf5, 0xae, 0x29, 0x58, 0xb2, 0x92, 0xe0, 0x72, + 0x07, 0x14, 0x23, 0x75, 0x68, 0x60, 0x41, 0xee, 0x09, 0xf8, 0x1e, 0x4f, 0x24, 0xd2, 0xaa, 0x2b, + 0xc2, 0x14, 0x6b, 0x93, 0x8a, 0x53, 0x61, 0xbe, 0x31, 0x60, 0xf8, 0x4a, 0x02, 0xb9, 0xdf, 0xc9, + 0x39, 0xc2, 0x75, 0x7c, 0x46, 0xee, 0xed, 0x89, 0x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bb, 0x50, + 0x38, 0x45, 0xa2, 0x79, 0x8c, 0xc3, 0xcb, 0xff, 0x81, 0x65, 0x36, 0x10, 0x34, 0x8e, 0xc5, 0x0f, + 0x9d, 0xb4, 0x96, 0xfe, 0xa4, 0x2b, 0xc9, 0x30, 0x58, 0x53, 0x89, 0xf8, 0x82, 0x36, 0xe9, 0x26, + 0xda, 0x51, 0x39, 0x3b, 0x5b, 0x9b, 0x8c, 0xdb, 0x17, 0x27, 0x1a, 0x03, 0x97, 0xff, 0x06, 0xcb, + 0xae, 0x39, 0x3c, 0xe9, 0x39, 0x16, 0x2a, 0x2f, 0x31, 0x22, 0x3d, 0x35, 0xd1, 0x4a, 0x7c, 0x79, + 0x76, 0x03, 0x20, 0x68, 0x44, 0x98, 0xf0, 0x51, 0x16, 0xac, 0xde, 0xad, 0x87, 0x80, 0xf9, 0x73, + 0x41, 0xcc, 0x52, 0x10, 0x1d, 0x90, 0x77, 0xe3, 0xef, 0x18, 0x51, 0x0e, 0x47, 0xa9, 0x53, 0x57, + 0x9a, 0xfc, 0xee, 0x61, 0x2c, 0x49, 0xe8, 0x8f, 0x5a, 0x0a, 0xff, 0x80, 0x2f, 0x12, 0x75, 0x19, + 0x17, 0x43, 0x3d, 0xf5, 0x41, 0xbf, 0x9e, 0x52, 0xf7, 0x8c, 0x6c, 0x82, 0xe0, 0xa1, 0x0b, 0x42, + 0xaf, 0x5d, 0xdd, 0x28, 0xd2, 0xf5, 0x8d, 0x22, 0xbd, 0xbc, 0x51, 0xa4, 0xc7, 0xb7, 0x4a, 0xe6, + 0xfa, 0x56, 0xc9, 0x3c, 0xbf, 0x55, 0x32, 0xa7, 0xdf, 0x25, 0xf1, 0x77, 0xc3, 0x7f, 0x9d, 0xf0, + 0x39, 0xe4, 0x7f, 0x3d, 0x8c, 0xa6, 0x95, 0x65, 0x7f, 0x29, 0xdf, 0xbf, 0x0b, 0x00, 0x00, 0xff, + 0xff, 0x57, 0x0c, 0x85, 0x84, 0x12, 0x0d, 0x00, 0x00, } func (m *MaxAmountIn) Marshal() (dAtA []byte, err error) { @@ -741,9 +756,9 @@ func (m *TokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a { - size := m.Ratio.Size() + size := m.Weight.Size() i -= size - if _, err := m.Ratio.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintTx(dAtA, i, uint64(size)) @@ -1087,7 +1102,7 @@ func (m *TokenInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.Ratio.Size() + l = m.Weight.Size() n += 1 + l + sovTx(uint64(l)) l = m.Amount.Size() n += 1 + l + sovTx(uint64(l)) @@ -1824,7 +1839,7 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ratio", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1852,7 +1867,7 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Ratio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex From 0cfcae344f9b9adba2a860b85f6e3d1a40d311a8 Mon Sep 17 00:00:00 2001 From: orngefrost Date: Mon, 19 Oct 2020 00:49:53 +0900 Subject: [PATCH 3/5] feat(proto): add description in lp token --- proto/osmosis/gamm/v1beta1/pool.proto | 9 ++++++--- proto/osmosis/gamm/v1beta1/tx.proto | 18 ++++++++++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/proto/osmosis/gamm/v1beta1/pool.proto b/proto/osmosis/gamm/v1beta1/pool.proto index cb2d7d7d823..19311b813e2 100644 --- a/proto/osmosis/gamm/v1beta1/pool.proto +++ b/proto/osmosis/gamm/v1beta1/pool.proto @@ -20,10 +20,13 @@ message Record { } message LP { - string name = 1 [ - (gogoproto.moretags) = "yaml:\"name\"" + string denom = 1 [ + (gogoproto.moretags) = "yaml:\"denom\"" ]; - string totalSupply = 2 [ + string description = 2 [ + (gogoproto.moretags) = "yaml:\"description\"" + ]; + string totalSupply = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.moretags) = "yaml:\"total_supply\"", (gogoproto.nullable) = false diff --git a/proto/osmosis/gamm/v1beta1/tx.proto b/proto/osmosis/gamm/v1beta1/tx.proto index 2e19e623a1c..8a274449768 100644 --- a/proto/osmosis/gamm/v1beta1/tx.proto +++ b/proto/osmosis/gamm/v1beta1/tx.proto @@ -71,7 +71,16 @@ message MsgExitPool { } // ===================== MsgCreatePool -message TokenInfo { +message LPTokenInfo { + string denom = 1 [ + (gogoproto.moretags) = "yaml:\"denom\"" + ]; + string description = 2 [ + (gogoproto.moretags) = "yaml:\"description\"" + ]; +} + +message BindTokenInfo { string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; @@ -99,7 +108,12 @@ message MsgCreatePool { (gogoproto.nullable) = false ]; - repeated TokenInfo tokenInfo = 3 [ + LPTokenInfo lpToken = 3 [ + (gogoproto.moretags) = "yaml:\"lp_token\"", + (gogoproto.nullable) = false + ]; + + repeated BindTokenInfo bindTokens = 4 [ (gogoproto.moretags) = "yaml:\"token_info\"", (gogoproto.nullable) = false ]; From 9783632059a5693d9a1f92897261e3cee9910a5e Mon Sep 17 00:00:00 2001 From: orngefrost Date: Mon, 19 Oct 2020 00:50:41 +0900 Subject: [PATCH 4/5] fix(x/gamm): add protection logic & some getter methods --- x/gamm/keeper/pool/service.go | 160 ++++++++++++++++++++++++++++++---- x/gamm/types/errors.go | 1 + 2 files changed, 143 insertions(+), 18 deletions(-) diff --git a/x/gamm/keeper/pool/service.go b/x/gamm/keeper/pool/service.go index 9983b0a40f8..9809baa3725 100644 --- a/x/gamm/keeper/pool/service.go +++ b/x/gamm/keeper/pool/service.go @@ -1,6 +1,8 @@ package pool import ( + "fmt" + "github.com/c-osmosis/osmosis/x/gamm/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -8,7 +10,13 @@ import ( ) type Service interface { - CreatePool(sdk.Context, sdk.AccAddress, sdk.Dec, []types.TokenInfo) error + // Viewer + GetPoolShareInfo(sdk.Context, uint64) (types.LP, error) + GetPoolTokenBalance(sdk.Context, uint64) (sdk.Coins, error) + GetSpotPrice(sdk.Context, uint64, string, string) (sdk.Int, error) + + // Sender + CreatePool(sdk.Context, sdk.AccAddress, sdk.Dec, types.LPTokenInfo, []types.BindTokenInfo) error JoinPool(sdk.Context, sdk.AccAddress, uint64, sdk.Int, []types.MaxAmountIn) error ExitPool(sdk.Context, sdk.AccAddress, uint64, sdk.Int, []types.MinAmountOut) error } @@ -31,30 +39,102 @@ func NewService( } } +func (p poolService) GetPoolShareInfo(ctx sdk.Context, poolId uint64) (types.LP, error) { + pool, err := p.store.FetchPool(ctx, poolId) + if err != nil { + return types.LP{}, err + } + return pool.Token, nil +} + +func (p poolService) GetPoolTokenBalance(ctx sdk.Context, poolId uint64) (sdk.Coins, error) { + pool, err := p.store.FetchPool(ctx, poolId) + if err != nil { + return nil, err + } + + var coins sdk.Coins + for denom, record := range pool.Records { + coins = append(coins, sdk.Coin{ + Denom: denom, + Amount: record.Balance, + }) + } + if coins == nil { + panic("oh my god") + } + coins = coins.Sort() + + return coins, nil +} + +func (p poolService) GetSpotPrice(ctx sdk.Context, poolId uint64, tokenIn, tokenOut string) (sdk.Int, error) { + pool, err := p.store.FetchPool(ctx, poolId) + if err != nil { + return sdk.Int{}, err + } + + inRecord, ok := pool.Records[tokenIn] + if !ok { + return sdk.Int{}, sdkerrors.Wrapf( + types.ErrNotBound, + "token %s is not bound to pool", tokenIn, + ) + } + outRecord, ok := pool.Records[tokenOut] + if !ok { + return sdk.Int{}, sdkerrors.Wrapf( + types.ErrNotBound, + "token %s is not bound to pool", tokenOut, + ) + } + + spotPrice := calcSpotPrice( + inRecord.Balance.ToDec(), + inRecord.DenormalizedWeight, + outRecord.Balance.ToDec(), + outRecord.DenormalizedWeight, + pool.SwapFee, + ).TruncateInt() + + return spotPrice, nil +} + func (p poolService) CreatePool( ctx sdk.Context, sender sdk.AccAddress, swapFee sdk.Dec, - tokenInfo []types.TokenInfo, + lpToken types.LPTokenInfo, + bindTokens []types.BindTokenInfo, ) error { - if len(tokenInfo) < 2 { + if len(bindTokens) < 2 { return sdkerrors.Wrapf( types.ErrInvalidRequest, "token info length should be at least 2", ) } - records := make(map[string]types.Record, len(tokenInfo)) - for _, info := range tokenInfo { + records := make(map[string]types.Record, len(bindTokens)) + for _, info := range bindTokens { records[info.Denom] = types.Record{ DenormalizedWeight: info.Weight, Balance: info.Amount, } } + poolId := p.store.GetNextPoolNumber(ctx) + if lpToken.Denom == "" { + lpToken.Denom = fmt.Sprintf("osmosis/pool/%d", poolId) + } + pool := types.Pool{ - Id: p.store.GetNextPoolNumber(ctx), - SwapFee: swapFee, + Id: poolId, + SwapFee: swapFee, + Token: types.LP{ + Denom: lpToken.Denom, + Description: lpToken.Description, + TotalSupply: sdk.NewInt(0), + }, TotalWeight: sdk.NewInt(0), Records: records, } @@ -100,13 +180,33 @@ func (p poolService) JoinPool( return sdkerrors.Wrapf(types.ErrMathApprox, "calc poolRatio") } + checker := map[string]bool{} + for _, m := range maxAmountsIn { + if check := checker[m.Denom]; check { + return sdkerrors.Wrapf( + types.ErrInvalidRequest, + "do not use duplicated denom", + ) + } + checker[m.Denom] = true + } + if len(pool.Records) != len(checker) { + return sdkerrors.Wrapf( + types.ErrInvalidRequest, + "invalid maxAmountsIn argument", + ) + } + var sendTargets sdk.Coins for _, maxAmountIn := range maxAmountsIn { var ( tokenDenom = maxAmountIn.Denom - record = pool.Records[tokenDenom] + record, ok = pool.Records[tokenDenom] tokenAmountIn = poolRatio.Mul(record.Balance.ToDec()).TruncateInt() ) + if !ok { + return sdkerrors.Wrapf(types.ErrInvalidRequest, "token is not bound to pool") + } if tokenAmountIn.Equal(sdk.NewInt(0)) { return sdkerrors.Wrapf(types.ErrMathApprox, "calc tokenAmountIn") } @@ -122,6 +222,7 @@ func (p poolService) JoinPool( }) } + // process token transfer err = p.bankKeeper.SendCoinsFromAccountToModule( ctx, sender, @@ -132,8 +233,9 @@ func (p poolService) JoinPool( return err } + // process lpToken transfer poolShare := lpService{ - denom: lpToken.Name, + denom: lpToken.Denom, bankKeeper: p.bankKeeper, } if err := poolShare.mintPoolShare(ctx, poolAmountOut); err != nil { @@ -169,24 +271,33 @@ func (p poolService) ExitPool( return sdkerrors.Wrapf(types.ErrMathApprox, "calc poolRatio") } - poolShare := lpService{ - denom: lpToken.Name, - bankKeeper: p.bankKeeper, - } - if err := poolShare.pullPoolShare(ctx, sender, poolAmountIn); err != nil { - return err + checker := map[string]bool{} + for _, m := range minAmountsOut { + if check := checker[m.Denom]; check { + return sdkerrors.Wrapf( + types.ErrInvalidRequest, + "do not use duplicated denom", + ) + } + checker[m.Denom] = true } - if err := poolShare.burnPoolShare(ctx, poolAmountIn); err != nil { - return err + if len(pool.Records) != len(checker) { + return sdkerrors.Wrapf( + types.ErrInvalidRequest, + "invalid minAmountsOut argument", + ) } var sendTargets sdk.Coins for _, minAmountOut := range minAmountsOut { var ( tokenDenom = minAmountOut.Denom - record = pool.Records[tokenDenom] + record, ok = pool.Records[tokenDenom] tokenAmountOut = poolRatio.Mul(record.Balance.ToDec()).TruncateInt() ) + if !ok { + return sdkerrors.Wrapf(types.ErrInvalidRequest, "token is not bound to pool") + } if tokenAmountOut.Equal(sdk.NewInt(0)) { return sdkerrors.Wrapf(types.ErrMathApprox, "calc tokenAmountOut") } @@ -202,6 +313,7 @@ func (p poolService) ExitPool( }) } + // process token transfer err = p.bankKeeper.SendCoinsFromModuleToAccount( ctx, types.ModuleName, @@ -212,6 +324,18 @@ func (p poolService) ExitPool( return err } + // process lpToken transfer + poolShare := lpService{ + denom: lpToken.Denom, + bankKeeper: p.bankKeeper, + } + if err := poolShare.pullPoolShare(ctx, sender, poolAmountIn); err != nil { + return err + } + if err := poolShare.burnPoolShare(ctx, poolAmountIn); err != nil { + return err + } + // save changes lpToken.TotalSupply = lpToken.TotalSupply.Sub(poolAmountIn) pool.Token = lpToken diff --git a/x/gamm/types/errors.go b/x/gamm/types/errors.go index 23944b945fe..529eb1dddd4 100644 --- a/x/gamm/types/errors.go +++ b/x/gamm/types/errors.go @@ -8,4 +8,5 @@ var ( ErrMathApprox = sdkerrors.Register(ModuleName, 3, "math approx error") ErrLimitExceed = sdkerrors.Register(ModuleName, 4, "limit exceeded") ErrInvalidRequest = sdkerrors.Register(ModuleName, 5, "bad request") + ErrNotBound = sdkerrors.Register(ModuleName, 6, "not bound") ) From af9d54e6cbe9a128f48ad6e31c57974cb4142716 Mon Sep 17 00:00:00 2001 From: orngefrost Date: Mon, 19 Oct 2020 00:50:59 +0900 Subject: [PATCH 5/5] common: generate protobuf message --- x/gamm/types/pool.pb.go | 145 ++++++++---- x/gamm/types/tx.pb.go | 472 ++++++++++++++++++++++++++++++++-------- 2 files changed, 475 insertions(+), 142 deletions(-) diff --git a/x/gamm/types/pool.pb.go b/x/gamm/types/pool.pb.go index 8a2b2d5aa99..9472f8e054f 100644 --- a/x/gamm/types/pool.pb.go +++ b/x/gamm/types/pool.pb.go @@ -65,8 +65,9 @@ func (m *Record) XXX_DiscardUnknown() { var xxx_messageInfo_Record proto.InternalMessageInfo type LP struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` - TotalSupply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=totalSupply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"totalSupply" yaml:"total_supply"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + TotalSupply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=totalSupply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"totalSupply" yaml:"total_supply"` } func (m *LP) Reset() { *m = LP{} } @@ -102,9 +103,16 @@ func (m *LP) XXX_DiscardUnknown() { var xxx_messageInfo_LP proto.InternalMessageInfo -func (m *LP) GetName() string { +func (m *LP) GetDenom() string { if m != nil { - return m.Name + return m.Denom + } + return "" +} + +func (m *LP) GetDescription() string { + if m != nil { + return m.Description } return "" } @@ -181,40 +189,42 @@ func init() { func init() { proto.RegisterFile("osmosis/gamm/v1beta1/pool.proto", fileDescriptor_e5ab9bc6d45f98ce) } var fileDescriptor_e5ab9bc6d45f98ce = []byte{ - // 524 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xcf, 0x6e, 0xd3, 0x30, - 0x1c, 0xc7, 0x9b, 0xfe, 0x59, 0x35, 0x77, 0x30, 0x64, 0x2a, 0x54, 0x55, 0x90, 0x54, 0x46, 0x82, - 0x72, 0x58, 0xa2, 0x95, 0x0b, 0xda, 0x09, 0xca, 0x86, 0x84, 0xd4, 0x43, 0x65, 0x0e, 0xc0, 0x38, - 0x54, 0x6e, 0x62, 0xb2, 0xa8, 0x49, 0x1c, 0xd5, 0xee, 0x46, 0x10, 0x0f, 0x81, 0x78, 0xaa, 0x1d, - 0x77, 0x44, 0x1c, 0x22, 0xd4, 0x4a, 0x3c, 0x40, 0x9e, 0x00, 0xc5, 0x76, 0xa6, 0x1c, 0x7a, 0xa9, - 0xb4, 0x93, 0xad, 0xf8, 0xfb, 0xfb, 0x7c, 0xfd, 0xfb, 0xe3, 0x00, 0x8b, 0xf1, 0x88, 0xf1, 0x80, - 0x3b, 0x3e, 0x89, 0x22, 0xe7, 0xf2, 0x78, 0x4e, 0x05, 0x39, 0x76, 0x12, 0xc6, 0x42, 0x3b, 0x59, - 0x32, 0xc1, 0x60, 0x57, 0x0b, 0xec, 0x42, 0x60, 0x6b, 0x41, 0xbf, 0xeb, 0x33, 0x9f, 0x49, 0x81, - 0x53, 0xec, 0x94, 0xb6, 0x6f, 0xba, 0x52, 0xec, 0xcc, 0x09, 0xa7, 0xb7, 0x2c, 0x97, 0x05, 0xb1, - 0x3a, 0x47, 0x6b, 0x03, 0xec, 0x61, 0xea, 0xb2, 0xa5, 0x07, 0x7f, 0x00, 0xe8, 0xd1, 0x98, 0x2d, - 0x23, 0x12, 0x06, 0xdf, 0xa9, 0xf7, 0x91, 0x06, 0xfe, 0x85, 0xe8, 0x19, 0x03, 0x63, 0xb8, 0x3f, - 0x9e, 0x5c, 0x67, 0x56, 0xed, 0x4f, 0x66, 0x3d, 0xf3, 0x03, 0x71, 0xb1, 0x9a, 0xdb, 0x2e, 0x8b, - 0x1c, 0x4d, 0x56, 0xcb, 0x11, 0xf7, 0x16, 0x8e, 0x48, 0x13, 0xca, 0xed, 0x53, 0xea, 0xe6, 0x99, - 0xd5, 0x4f, 0x49, 0x14, 0x9e, 0xa0, 0x2a, 0x71, 0x76, 0x25, 0x91, 0x08, 0x6f, 0xf1, 0x81, 0xe7, - 0xa0, 0x3d, 0x27, 0x21, 0x89, 0x5d, 0xda, 0xab, 0x4b, 0xcb, 0xd7, 0x3b, 0x58, 0xbe, 0x8f, 0x45, - 0x9e, 0x59, 0xf7, 0x95, 0xa5, 0xc6, 0x20, 0x5c, 0x02, 0xd1, 0x2f, 0x03, 0xd4, 0x27, 0x53, 0xf8, - 0x14, 0x34, 0x63, 0x12, 0x51, 0x9d, 0xd2, 0x61, 0x9e, 0x59, 0x1d, 0x15, 0x51, 0x7c, 0x45, 0x58, - 0x1e, 0x42, 0x1f, 0x74, 0x04, 0x13, 0x24, 0xfc, 0xb0, 0x4a, 0x92, 0x30, 0xd5, 0x77, 0x39, 0xdb, - 0xf9, 0x2e, 0x0f, 0x15, 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da, 0x34, 0xfe, 0xae, 0x4d, 0xe3, - 0xe7, 0xc6, 0xac, 0xdd, 0x6c, 0xcc, 0xda, 0xef, 0x8d, 0x59, 0x3b, 0x7f, 0x51, 0x2d, 0xf0, 0x51, - 0xf9, 0xec, 0xcb, 0xf5, 0x9b, 0xfa, 0x01, 0xc8, 0x3a, 0xcf, 0xf7, 0xe4, 0x73, 0x7d, 0xf9, 0x3f, - 0x00, 0x00, 0xff, 0xff, 0xe9, 0x4f, 0x0f, 0x88, 0x1d, 0x04, 0x00, 0x00, + // 547 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4f, 0x6f, 0xd3, 0x3e, + 0x18, 0xc7, 0x9b, 0xfe, 0x59, 0x35, 0x77, 0xbf, 0x1f, 0x93, 0xa9, 0xa6, 0xa8, 0x82, 0xa4, 0xf2, + 0x61, 0x94, 0xc3, 0x12, 0xad, 0x5c, 0xa6, 0x9d, 0xa0, 0x6c, 0x48, 0x48, 0x3d, 0x54, 0xe6, 0x00, + 0x8c, 0x43, 0x95, 0x26, 0x26, 0x8b, 0x9a, 0xc4, 0x51, 0xec, 0x6e, 0x14, 0xf1, 0x22, 0x78, 0x59, + 0xbb, 0xb1, 0x23, 0xe2, 0x10, 0xa1, 0x56, 0xe2, 0x05, 0xe4, 0x15, 0xa0, 0xd8, 0x4e, 0x97, 0x43, + 0x2f, 0x95, 0x38, 0xd9, 0x92, 0xbf, 0xcf, 0xe7, 0xeb, 0xe7, 0xf1, 0xf3, 0x18, 0x98, 0x94, 0x45, + 0x94, 0x05, 0xcc, 0xf6, 0x9d, 0x28, 0xb2, 0x6f, 0x4e, 0x67, 0x84, 0x3b, 0xa7, 0x76, 0x42, 0x69, + 0x68, 0x25, 0x29, 0xe5, 0x14, 0x76, 0x95, 0xc0, 0x2a, 0x04, 0x96, 0x12, 0xf4, 0xba, 0x3e, 0xf5, + 0xa9, 0x10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 0xb4, + 0xfb, 0x95, 0xa1, 0xfd, 0x5e, 0x19, 0xda, 0xf7, 0xb5, 0x51, 0xbb, 0x5f, 0x1b, 0xb5, 0x9f, 0x6b, + 0xa3, 0x76, 0xf5, 0xbc, 0x5a, 0xe0, 0x93, 0xf2, 0xcf, 0x28, 0xd7, 0x2f, 0xf2, 0xf7, 0x10, 0x75, + 0x9e, 0xed, 0x89, 0x59, 0x7f, 0xf1, 0x37, 0x00, 0x00, 0xff, 0xff, 0x09, 0x97, 0xbf, 0x3e, 0x5a, + 0x04, 0x00, 0x00, } func (m *Record) Marshal() (dAtA []byte, err error) { @@ -289,11 +299,18 @@ func (m *LP) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintPool(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintPool(dAtA, i, uint64(len(m.Name))) + dAtA[i] = 0x1a + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintPool(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintPool(dAtA, i, uint64(len(m.Denom))) i-- dAtA[i] = 0xa } @@ -412,7 +429,11 @@ func (m *LP) Size() (n int) { } var l int _ = l - l = len(m.Name) + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovPool(uint64(l)) + } + l = len(m.Description) if l > 0 { n += 1 + l + sovPool(uint64(l)) } @@ -606,7 +627,7 @@ func (m *LP) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -634,9 +655,41 @@ func (m *LP) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Denom = 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 ErrIntOverflowPool + } + 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 ErrInvalidLengthPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPool + } + 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 TotalSupply", wireType) } diff --git a/x/gamm/types/tx.pb.go b/x/gamm/types/tx.pb.go index 959f4f013b2..4aef188992b 100644 --- a/x/gamm/types/tx.pb.go +++ b/x/gamm/types/tx.pb.go @@ -241,24 +241,76 @@ func (m *MsgExitPool) GetMinAmountsOut() []MinAmountOut { } // ===================== MsgCreatePool -type TokenInfo struct { +type LPTokenInfo struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"denom"` +} + +func (m *LPTokenInfo) Reset() { *m = LPTokenInfo{} } +func (m *LPTokenInfo) String() string { return proto.CompactTextString(m) } +func (*LPTokenInfo) ProtoMessage() {} +func (*LPTokenInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_cfc8fd3ac7df3247, []int{4} +} +func (m *LPTokenInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LPTokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LPTokenInfo.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 *LPTokenInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_LPTokenInfo.Merge(m, src) +} +func (m *LPTokenInfo) XXX_Size() int { + return m.Size() +} +func (m *LPTokenInfo) XXX_DiscardUnknown() { + xxx_messageInfo_LPTokenInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_LPTokenInfo proto.InternalMessageInfo + +func (m *LPTokenInfo) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *LPTokenInfo) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +type BindTokenInfo struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` Weight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"weight" yaml:"weight"` Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` } -func (m *TokenInfo) Reset() { *m = TokenInfo{} } -func (m *TokenInfo) String() string { return proto.CompactTextString(m) } -func (*TokenInfo) ProtoMessage() {} -func (*TokenInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{4} +func (m *BindTokenInfo) Reset() { *m = BindTokenInfo{} } +func (m *BindTokenInfo) String() string { return proto.CompactTextString(m) } +func (*BindTokenInfo) ProtoMessage() {} +func (*BindTokenInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_cfc8fd3ac7df3247, []int{5} } -func (m *TokenInfo) XXX_Unmarshal(b []byte) error { +func (m *BindTokenInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *BindTokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TokenInfo.Marshal(b, m, deterministic) + return xxx_messageInfo_BindTokenInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -268,19 +320,19 @@ func (m *TokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *TokenInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenInfo.Merge(m, src) +func (m *BindTokenInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_BindTokenInfo.Merge(m, src) } -func (m *TokenInfo) XXX_Size() int { +func (m *BindTokenInfo) XXX_Size() int { return m.Size() } -func (m *TokenInfo) XXX_DiscardUnknown() { - xxx_messageInfo_TokenInfo.DiscardUnknown(m) +func (m *BindTokenInfo) XXX_DiscardUnknown() { + xxx_messageInfo_BindTokenInfo.DiscardUnknown(m) } -var xxx_messageInfo_TokenInfo proto.InternalMessageInfo +var xxx_messageInfo_BindTokenInfo proto.InternalMessageInfo -func (m *TokenInfo) GetDenom() string { +func (m *BindTokenInfo) GetDenom() string { if m != nil { return m.Denom } @@ -288,16 +340,17 @@ func (m *TokenInfo) GetDenom() string { } type MsgCreatePool struct { - Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty" yaml:"sender"` - SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swapFee" yaml:"swap_fee"` - TokenInfo []TokenInfo `protobuf:"bytes,3,rep,name=tokenInfo,proto3" json:"tokenInfo" yaml:"token_info"` + Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty" yaml:"sender"` + SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swapFee" yaml:"swap_fee"` + LpToken LPTokenInfo `protobuf:"bytes,3,opt,name=lpToken,proto3" json:"lpToken" yaml:"lp_token"` + BindTokens []BindTokenInfo `protobuf:"bytes,4,rep,name=bindTokens,proto3" json:"bindTokens" yaml:"token_info"` } func (m *MsgCreatePool) Reset() { *m = MsgCreatePool{} } func (m *MsgCreatePool) String() string { return proto.CompactTextString(m) } func (*MsgCreatePool) ProtoMessage() {} func (*MsgCreatePool) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{5} + return fileDescriptor_cfc8fd3ac7df3247, []int{6} } func (m *MsgCreatePool) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -333,9 +386,16 @@ func (m *MsgCreatePool) GetSender() github_com_cosmos_cosmos_sdk_types.AccAddres return nil } -func (m *MsgCreatePool) GetTokenInfo() []TokenInfo { +func (m *MsgCreatePool) GetLpToken() LPTokenInfo { if m != nil { - return m.TokenInfo + return m.LpToken + } + return LPTokenInfo{} +} + +func (m *MsgCreatePool) GetBindTokens() []BindTokenInfo { + if m != nil { + return m.BindTokens } return nil } @@ -355,7 +415,7 @@ func (m *MsgSwapExactAmountIn) Reset() { *m = MsgSwapExactAmountIn{} } func (m *MsgSwapExactAmountIn) String() string { return proto.CompactTextString(m) } func (*MsgSwapExactAmountIn) ProtoMessage() {} func (*MsgSwapExactAmountIn) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{6} + return fileDescriptor_cfc8fd3ac7df3247, []int{7} } func (m *MsgSwapExactAmountIn) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -413,7 +473,7 @@ func (m *MsgSwapExactAmountOut) Reset() { *m = MsgSwapExactAmountOut{} } func (m *MsgSwapExactAmountOut) String() string { return proto.CompactTextString(m) } func (*MsgSwapExactAmountOut) ProtoMessage() {} func (*MsgSwapExactAmountOut) Descriptor() ([]byte, []int) { - return fileDescriptor_cfc8fd3ac7df3247, []int{7} + return fileDescriptor_cfc8fd3ac7df3247, []int{8} } func (m *MsgSwapExactAmountOut) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -461,7 +521,8 @@ func init() { proto.RegisterType((*MsgJoinPool)(nil), "osmosis.gamm.v1beta1.MsgJoinPool") proto.RegisterType((*MinAmountOut)(nil), "osmosis.gamm.v1beta1.MinAmountOut") proto.RegisterType((*MsgExitPool)(nil), "osmosis.gamm.v1beta1.MsgExitPool") - proto.RegisterType((*TokenInfo)(nil), "osmosis.gamm.v1beta1.TokenInfo") + proto.RegisterType((*LPTokenInfo)(nil), "osmosis.gamm.v1beta1.LPTokenInfo") + proto.RegisterType((*BindTokenInfo)(nil), "osmosis.gamm.v1beta1.BindTokenInfo") proto.RegisterType((*MsgCreatePool)(nil), "osmosis.gamm.v1beta1.MsgCreatePool") proto.RegisterType((*MsgSwapExactAmountIn)(nil), "osmosis.gamm.v1beta1.MsgSwapExactAmountIn") proto.RegisterType((*MsgSwapExactAmountOut)(nil), "osmosis.gamm.v1beta1.MsgSwapExactAmountOut") @@ -470,61 +531,64 @@ func init() { func init() { proto.RegisterFile("osmosis/gamm/v1beta1/tx.proto", fileDescriptor_cfc8fd3ac7df3247) } var fileDescriptor_cfc8fd3ac7df3247 = []byte{ - // 857 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4d, 0x4f, 0xe3, 0x46, - 0x18, 0x8e, 0xf9, 0x08, 0x64, 0x92, 0xb4, 0xd4, 0x0a, 0x34, 0x20, 0x61, 0xd3, 0x39, 0x50, 0x7a, - 0xc0, 0x11, 0x54, 0xea, 0xa1, 0x17, 0x14, 0xa7, 0x40, 0x53, 0x29, 0x2a, 0x72, 0x2b, 0xb5, 0xa2, - 0x52, 0x23, 0xc7, 0x19, 0x1c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b, - 0x42, 0x54, 0xf8, 0x86, 0xbb, 0xe2, 0x70, 0xe8, 0x78, 0x9f, 0xac, 0x2b, 0xce, 0x41, 0x21, 0x4e, - 0x5b, 0x1d, 0x0b, 0x53, 0x1c, 0xa7, 0x56, 0x62, 0xf5, 0xae, 0x29, 0x58, 0xb2, 0x92, 0xe0, 0x72, - 0x07, 0x14, 0x23, 0x75, 0x68, 0x60, 0x41, 0xee, 0x09, 0xf8, 0x1e, 0x4f, 0x24, 0xd2, 0xaa, 0x2b, - 0xc2, 0x14, 0x6b, 0x93, 0x8a, 0x53, 0x61, 0xbe, 0x31, 0x60, 0xf8, 0x4a, 0x02, 0xb9, 0xdf, 0xc9, - 0x39, 0xc2, 0x75, 0x7c, 0x46, 0xee, 0xed, 0x89, 0x3f, 0x40, 0x76, 0x80, 0x1c, 0xbb, 0x13, 0x1a, - 0xe2, 0x20, 0x85, 0x0c, 0x3f, 0x21, 0x2b, 0x4e, 0x27, 0x47, 0x81, 0x86, 0x80, 0x0b, 0x80, 0x79, - 0xb4, 0x42, 0xdf, 0x83, 0xd4, 0xfa, 0x0a, 0xe0, 0xd0, 0x65, 0x02, 0x0e, 0x3e, 0x9b, 0x03, 0xc5, - 0x06, 0xb5, 0x6b, 0x3d, 0x64, 0x7a, 0xe8, 0xc1, 0x4d, 0xf6, 0x17, 0x58, 0xa2, 0x03, 0xb3, 0x7b, - 0x84, 0x90, 0x10, 0xa8, 0x9a, 0x5a, 0xa0, 0x2f, 0x45, 0x28, 0x03, 0xb3, 0xdb, 0x3c, 0x43, 0x08, - 0x1a, 0x21, 0xa2, 0xfc, 0x27, 0xc8, 0x79, 0x61, 0xc6, 0xca, 0xf3, 0xcc, 0x18, 0xea, 0x74, 0x63, - 0x44, 0x89, 0xd5, 0xd7, 0x85, 0x2b, 0x44, 0x1d, 0xb2, 0xfd, 0x4d, 0x07, 0x9f, 0x11, 0x68, 0xc4, - 0x60, 0xf0, 0xff, 0x2c, 0x28, 0x35, 0xa8, 0xfd, 0xdb, 0xc0, 0xec, 0x1e, 0x0e, 0x4d, 0xcb, 0x8b, - 0xfc, 0xf8, 0x90, 0x5a, 0xd9, 0x77, 0x0a, 0xb2, 0xa0, 0x1f, 0x4f, 0x2f, 0xc8, 0xf4, 0x24, 0xc9, - 0x0a, 0x1e, 0x80, 0x25, 0x71, 0x54, 0x66, 0xae, 0xfc, 0xfe, 0xba, 0xc6, 0xb7, 0x6a, 0xc1, 0x45, - 0x1a, 0x89, 0x56, 0x23, 0x0e, 0xd6, 0x75, 0x91, 0xaf, 0x6f, 0xef, 0x41, 0x17, 0x6c, 0x88, 0x13, - 0x16, 0x4a, 0x0b, 0x8d, 0x90, 0x2d, 0xb8, 0x50, 0xd8, 0x6b, 0xd4, 0x3b, 0x16, 0x66, 0xbb, 0x50, - 0x38, 0x45, 0xa2, 0x79, 0x8c, 0xc3, 0xcb, 0xff, 0x81, 0x65, 0x36, 0x10, 0x34, 0x8e, 0xc5, 0x0f, - 0x9d, 0xb4, 0x96, 0xfe, 0xa4, 0x2b, 0xc9, 0x30, 0x58, 0x53, 0x89, 0xf8, 0x82, 0x36, 0xe9, 0x26, - 0xda, 0x51, 0x39, 0x3b, 0x5b, 0x9b, 0x8c, 0xdb, 0x17, 0x27, 0x1a, 0x03, 0x97, 0xff, 0x06, 0xcb, - 0xae, 0x39, 0x3c, 0xe9, 0x39, 0x16, 0x2a, 0x2f, 0x31, 0x22, 0x3d, 0x35, 0xd1, 0x4a, 0x7c, 0x79, - 0x76, 0x03, 0x20, 0x68, 0x44, 0x98, 0xf0, 0x51, 0x16, 0xac, 0xde, 0xad, 0x87, 0x80, 0xf9, 0x73, - 0x41, 0xcc, 0x52, 0x10, 0x1d, 0x90, 0x77, 0xe3, 0xef, 0x18, 0x51, 0x0e, 0x47, 0xa9, 0x53, 0x57, - 0x9a, 0xfc, 0xee, 0x61, 0x2c, 0x49, 0xe8, 0x8f, 0x5a, 0x0a, 0xff, 0x80, 0x2f, 0x12, 0x75, 0x19, - 0x17, 0x43, 0x3d, 0xf5, 0x41, 0xbf, 0x9e, 0x52, 0xf7, 0x8c, 0x6c, 0x82, 0xe0, 0xa1, 0x0b, 0x42, - 0xaf, 0x5d, 0xdd, 0x28, 0xd2, 0xf5, 0x8d, 0x22, 0xbd, 0xbc, 0x51, 0xa4, 0xc7, 0xb7, 0x4a, 0xe6, - 0xfa, 0x56, 0xc9, 0x3c, 0xbf, 0x55, 0x32, 0xa7, 0xdf, 0x25, 0xf1, 0x77, 0xc3, 0x7f, 0x9d, 0xf0, - 0x39, 0xe4, 0x7f, 0x3d, 0x8c, 0xa6, 0x95, 0x65, 0x7f, 0x29, 0xdf, 0xbf, 0x0b, 0x00, 0x00, 0xff, - 0xff, 0x57, 0x0c, 0x85, 0x84, 0x12, 0x0d, 0x00, 0x00, + // 910 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x97, 0x4d, 0x8f, 0xdb, 0x44, + 0x18, 0xc7, 0xd7, 0xdb, 0x6d, 0xb6, 0x9d, 0x24, 0xb0, 0x58, 0xbb, 0xdb, 0xb4, 0x52, 0xed, 0x32, + 0x48, 0xa5, 0x1c, 0xd6, 0x51, 0x8b, 0xc4, 0x81, 0x4b, 0xb5, 0x0e, 0x6d, 0x09, 0x22, 0x62, 0x65, + 0x2a, 0x21, 0x15, 0xa9, 0x91, 0x63, 0xcf, 0x7a, 0x47, 0x1b, 0xcf, 0x98, 0xcc, 0x84, 0xa4, 0x7c, + 0x07, 0x10, 0x47, 0xf8, 0x46, 0x3d, 0xf6, 0x88, 0x38, 0x58, 0x68, 0xf7, 0xc4, 0x35, 0x17, 0x10, + 0x07, 0x84, 0xe6, 0xc5, 0x2f, 0x79, 0xa9, 0x58, 0x2b, 0x5a, 0xc1, 0xa1, 0xa7, 0x44, 0x9e, 0x99, + 0xdf, 0x7f, 0xe6, 0x79, 0xfe, 0xcf, 0xe3, 0x31, 0xb8, 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0x52, 0x5d, 0x16, 0xc5, 0xd0, 0xad, 0x7c, 0xd0, 0x1b, 0x2b, 0xea, 0x5e, 0x8a, 0x2d, 0x08, + 0x5c, 0x76, 0x41, 0xb8, 0x9d, 0x97, 0x67, 0x96, 0xf1, 0xea, 0xcc, 0x32, 0x7e, 0x3b, 0xb3, 0x8c, + 0x1f, 0xcf, 0xad, 0x8d, 0x57, 0xe7, 0xd6, 0xc6, 0x2f, 0xe7, 0xd6, 0xc6, 0xb3, 0x0f, 0xca, 0xfc, + 0x83, 0xec, 0xb3, 0x2d, 0xfb, 0x9d, 0xaa, 0x0f, 0x38, 0x29, 0x33, 0xa8, 0xc9, 0x0f, 0xae, 0x0f, + 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xeb, 0xb6, 0x4b, 0x72, 0xdd, 0x0d, 0x00, 0x00, } func (m *MaxAmountIn) Marshal() (dAtA []byte, err error) { @@ -725,7 +789,44 @@ func (m *MsgExitPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *TokenInfo) Marshal() (dAtA []byte, err error) { +func (m *LPTokenInfo) 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 *LPTokenInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LPTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BindTokenInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -735,12 +836,12 @@ func (m *TokenInfo) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TokenInfo) MarshalTo(dAtA []byte) (int, error) { +func (m *BindTokenInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *BindTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -795,10 +896,10 @@ func (m *MsgCreatePool) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.TokenInfo) > 0 { - for iNdEx := len(m.TokenInfo) - 1; iNdEx >= 0; iNdEx-- { + if len(m.BindTokens) > 0 { + for iNdEx := len(m.BindTokens) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.TokenInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.BindTokens[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -806,9 +907,19 @@ func (m *MsgCreatePool) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } } + { + size, err := m.LpToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a { size := m.SwapFee.Size() i -= size @@ -1092,7 +1203,24 @@ func (m *MsgExitPool) Size() (n int) { return n } -func (m *TokenInfo) Size() (n int) { +func (m *LPTokenInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *BindTokenInfo) Size() (n int) { if m == nil { return 0 } @@ -1121,8 +1249,10 @@ func (m *MsgCreatePool) Size() (n int) { } l = m.SwapFee.Size() n += 1 + l + sovTx(uint64(l)) - if len(m.TokenInfo) > 0 { - for _, e := range m.TokenInfo { + l = m.LpToken.Size() + n += 1 + l + sovTx(uint64(l)) + if len(m.BindTokens) > 0 { + for _, e := range m.BindTokens { l = e.Size() n += 1 + l + sovTx(uint64(l)) } @@ -1776,7 +1906,7 @@ func (m *MsgExitPool) Unmarshal(dAtA []byte) error { } return nil } -func (m *TokenInfo) Unmarshal(dAtA []byte) error { +func (m *LPTokenInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1799,10 +1929,127 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TokenInfo: wiretype end group for non-group") + return fmt.Errorf("proto: LPTokenInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TokenInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LPTokenInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = 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 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.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BindTokenInfo) 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: BindTokenInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BindTokenInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2028,7 +2275,40 @@ func (m *MsgCreatePool) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LpToken", 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.LpToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BindTokens", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2055,8 +2335,8 @@ func (m *MsgCreatePool) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TokenInfo = append(m.TokenInfo, TokenInfo{}) - if err := m.TokenInfo[len(m.TokenInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.BindTokens = append(m.BindTokens, BindTokenInfo{}) + if err := m.BindTokens[len(m.BindTokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex