diff --git a/proto/elys/oracle/query.proto b/proto/elys/oracle/query.proto index 2d8c4f049..a88a96494 100644 --- a/proto/elys/oracle/query.proto +++ b/proto/elys/oracle/query.proto @@ -37,11 +37,11 @@ service Query { } // Queries a Price by asset. rpc Price(QueryGetPriceRequest) returns (QueryGetPriceResponse) { - option (google.api.http).get = "/elys-network/elys/oracle/price"; + option (google.api.http).get = "/elys-network/elys/oracle/price/{asset}"; } // Queries a list of Price items. rpc PriceAll(QueryAllPriceRequest) returns (QueryAllPriceResponse) { - option (google.api.http).get = "/elys-network/elys/oracle/price"; + option (google.api.http).get = "/elys-network/elys/oracle/prices"; } // Queries a PriceFeeder by feeder. rpc PriceFeeder(QueryGetPriceFeederRequest) returns (QueryGetPriceFeederResponse) { diff --git a/x/amm/types/errors.go b/x/amm/types/errors.go index fdffb7410..309b46816 100644 --- a/x/amm/types/errors.go +++ b/x/amm/types/errors.go @@ -38,6 +38,7 @@ var ( ErrExitFeeShouldNotExceedTwoPercent = errors.Register(ModuleName, 110, "exit fee should not exceed 2%") ErrFeeShouldNotBeNegative = errors.Register(ModuleName, 111, "fee should not be negative") ErrInvalidShareAmountOut = errors.Register(ModuleName, 112, "invalid share amount out") + ErrPoolAssetsMustBeTwo = errors.Register(ModuleName, 113, "pool assets must be exactly two") ) const ( diff --git a/x/amm/types/message_create_pool.go b/x/amm/types/message_create_pool.go index b667a5ac4..4e7a3f0d0 100644 --- a/x/amm/types/message_create_pool.go +++ b/x/amm/types/message_create_pool.go @@ -45,6 +45,10 @@ func (msg *MsgCreatePool) ValidateBasic() error { return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) } + if len(msg.PoolAssets) != 2 { + return ErrPoolAssetsMustBeTwo + } + if msg.PoolParams == nil { return ErrPoolParamsShouldNotBeNil } diff --git a/x/amm/types/message_create_pool_test.go b/x/amm/types/message_create_pool_test.go index df86e196b..3dab176ad 100644 --- a/x/amm/types/message_create_pool_test.go +++ b/x/amm/types/message_create_pool_test.go @@ -34,7 +34,32 @@ func TestMsgCreatePool_ValidateBasic(t *testing.T) { }, }, err: sdkerrors.ErrInvalidAddress, - }, { + }, + { + name: "pool assets must be exactly two", + msg: types.MsgCreatePool{ + Sender: sample.AccAddress(), + PoolParams: &types.PoolParams{ + SwapFee: sdk.ZeroDec(), + ExitFee: sdk.ZeroDec(), + UseOracle: false, + WeightBreakingFeeMultiplier: sdk.ZeroDec(), + WeightBreakingFeeExponent: sdk.NewDecWithPrec(25, 1), // 2.5 + ExternalLiquidityRatio: sdk.NewDec(1), + WeightRecoveryFeePortion: sdk.NewDecWithPrec(10, 2), // 10% + ThresholdWeightDifference: sdk.ZeroDec(), + FeeDenom: ptypes.BaseCurrency, + }, + PoolAssets: []types.PoolAsset{ + { + Token: sdk.NewCoin("uatom", sdk.NewInt(10000000)), + Weight: sdk.NewInt(10), + }, + }, + }, + err: types.ErrPoolAssetsMustBeTwo, + }, + { name: "valid address", msg: types.MsgCreatePool{ Sender: sample.AccAddress(), @@ -49,6 +74,16 @@ func TestMsgCreatePool_ValidateBasic(t *testing.T) { ThresholdWeightDifference: sdk.ZeroDec(), FeeDenom: ptypes.BaseCurrency, }, + PoolAssets: []types.PoolAsset{ + { + Token: sdk.NewCoin("uusdc", sdk.NewInt(10000000)), + Weight: sdk.NewInt(10), + }, + { + Token: sdk.NewCoin("uatom", sdk.NewInt(10000000)), + Weight: sdk.NewInt(10), + }, + }, }, }, } diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index d1a4f549f..dcee207f3 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -873,67 +873,67 @@ func init() { func init() { proto.RegisterFile("elys/oracle/query.proto", fileDescriptor_2afc8ed4b42b5980) } var fileDescriptor_2afc8ed4b42b5980 = []byte{ - // 951 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x41, 0x6f, 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xf4, 0x2b, 0x78, 0x2b, 0xe7, 0x06, 0xaa, - 0x7d, 0x0c, 0x30, 0xad, 0x32, 0x86, 0xba, 0x66, 0x84, 0x7a, 0x79, 0x07, 0x53, 0x5e, 0x65, 0xc9, - 0x06, 0xed, 0x21, 0x4b, 0xc7, 0xf3, 0x32, 0x2c, 0x8f, 0x00, 0xa6, 0x8f, 0x12, 0x1d, 0x6f, 0xdb, - 0xfa, 0x05, 0xdb, 0xf1, 0x0b, 0xb6, 0xf5, 0xb7, 0x81, 0x2f, 0xd8, 0x3e, 0x64, 0xc3, 0xa4, 0x68, - 0x6e, 0xea, 0x26, 0xfd, 0xc3, 0x42, 0x7c, 0x53, 0xa4, 0x00, 0xbf, 0x74, 0x0d, 0x7c, 0x72, 0x60, - 0x20, 0xde, 0x50, 0x88, 0xad, 0xb9, 0x88, 0x5a, 0xd9, 0x60, 0xec, 0x41, 0x2d, 0xc9, 0xb0, 0xf1, - 0xf8, 0x6a, 0x50, 0x56, 0x6a, 0x49, 0x3d, 0xd4, 0x82, 0xac, 0x41, 0x25, 0x12, 0x93, 0xb0, 0xcf, - 0x95, 0x64, 0xd5, 0xc5, 0x15, 0x59, 0x87, 0xaa, 0x1c, 0x8d, 0x79, 0x24, 0xd9, 0x38, 0xa8, 0x97, - 0x36, 0xad, 0xf6, 0x4d, 0x77, 0xba, 0x41, 0x0f, 0xf0, 0x85, 0x4f, 0x35, 0x30, 0x05, 0x36, 0x94, - 0xd5, 0x07, 0x87, 0x39, 0x26, 0xe6, 0xc7, 0x12, 0x9f, 0x60, 0xe4, 0xda, 0x8c, 0x7e, 0x83, 0xb0, - 0x1d, 0xcf, 0x33, 0x60, 0x97, 0x55, 0xb0, 0x33, 0x0b, 0x49, 0xa7, 0x02, 0x59, 0xd2, 0xd2, 0x02, - 0xa4, 0xcb, 0xab, 0xcf, 0x1e, 0x34, 0x8c, 0xdc, 0x3d, 0x52, 0xad, 0x29, 0x09, 0x7c, 0x0d, 0x2a, - 0xba, 0x57, 0x61, 0x99, 0x70, 0x45, 0xbf, 0x85, 0xb7, 0x73, 0x6f, 0x61, 0x34, 0x1d, 0xb8, 0x95, - 0x6e, 0x74, 0x98, 0xb1, 0x7a, 0x36, 0x28, 0x7d, 0x0f, 0x43, 0x5b, 0x0d, 0xa6, 0x5b, 0x74, 0x80, - 0x5c, 0x49, 0xa6, 0x4c, 0xae, 0x65, 0x15, 0xe4, 0x4f, 0x0b, 0x03, 0x99, 0x95, 0x29, 0x0c, 0xa4, - 0x74, 0xcd, 0x40, 0x96, 0x56, 0xa9, 0x07, 0xff, 0x57, 0xa1, 0xac, 0x58, 0xc9, 0x04, 0x2a, 0xba, - 0xd3, 0x93, 0x0d, 0x83, 0x24, 0x3b, 0x46, 0x1a, 0x9b, 0xc5, 0x06, 0x5a, 0x82, 0xb6, 0x7f, 0xfe, - 0xeb, 0xbf, 0x67, 0x37, 0x28, 0xd9, 0x74, 0x62, 0xcb, 0xfb, 0x3e, 0x97, 0x4f, 0x45, 0xf8, 0xbd, - 0x93, 0x9d, 0x91, 0xe4, 0x57, 0x0b, 0x5e, 0x9b, 0x69, 0xee, 0x84, 0x66, 0xfd, 0xcf, 0xce, 0x99, - 0xc6, 0x3b, 0x57, 0xda, 0x20, 0xc6, 0x43, 0x85, 0x71, 0x9f, 0xec, 0x38, 0xf9, 0x33, 0xb8, 0xab, - 0xa7, 0x88, 0x73, 0x32, 0x1d, 0x00, 0xa7, 0xe4, 0x77, 0x0b, 0x5e, 0xcf, 0x4c, 0x0b, 0x72, 0x37, - 0xab, 0x57, 0x34, 0x73, 0x1a, 0x3b, 0x0b, 0xd9, 0x22, 0xa3, 0xa3, 0x18, 0xdf, 0x27, 0x2d, 0x83, - 0xd1, 0x63, 0x91, 0xec, 0x1a, 0xa0, 0x09, 0x20, 0x39, 0xb3, 0xa0, 0x7a, 0xd9, 0x64, 0xc9, 0x7b, - 0x59, 0xad, 0x9c, 0x49, 0xd5, 0xd8, 0x9e, 0x67, 0x86, 0x34, 0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 0xc7, 0x01, 0x8f, 0x7a, 0x15, 0xf5, 0x0f, 0xf7, 0xc3, 0x97, 0x01, 0x00, 0x00, 0xff, 0xff, 0xfa, - 0x18, 0x61, 0xc7, 0x87, 0x0c, 0x00, 0x00, + // 952 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xc0, 0xb3, 0x75, 0x6d, 0xe1, 0x97, 0x0a, 0xc4, 0xd4, 0x04, 0x63, 0x52, 0x27, 0x1d, 0x20, + 0x31, 0x4d, 0xbb, 0x43, 0xda, 0x08, 0x0e, 0x1c, 0x90, 0x23, 0xd1, 0x50, 0x09, 0xa1, 0xb0, 0x27, + 0xc4, 0x01, 0x33, 0xb6, 0x27, 0xc6, 0x62, 0xbd, 0xb3, 0xdd, 0x59, 0x03, 0x91, 0x15, 0x21, 0xb8, + 0x72, 0x20, 0x52, 0x4f, 0x1c, 0x38, 0x70, 0xe4, 0x9b, 0xf4, 0x58, 0x89, 0x0b, 0x27, 0x84, 0x12, + 0x3e, 0x08, 0xda, 0x99, 0xb7, 0xf1, 0x8e, 0x77, 0x5d, 0xbb, 0x92, 0x4f, 0xf1, 0xce, 0xbc, 0x3f, + 0xbf, 0xf7, 0x67, 0xde, 0x0b, 0xbc, 0x2e, 0xfc, 0x53, 0xc5, 0x64, 0xc4, 0x7b, 0xbe, 0x60, 0x8f, + 0xc7, 0x22, 0x3a, 0x75, 0xc3, 0x48, 0xc6, 0x92, 0xac, 0x27, 0x17, 0xae, 0xb9, 0x68, 0xd4, 0x06, + 0x72, 0x20, 0xf5, 0x39, 0x4b, 0x7e, 0x19, 0x91, 0xc6, 0xe6, 0x40, 0xca, 0x81, 0x2f, 0x18, 0x0f, + 0x87, 0x8c, 0x07, 0x81, 0x8c, 0x79, 0x3c, 0x94, 0x81, 0xc2, 0xdb, 0x3b, 0x3d, 0xa9,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, 0x3b, 0xfc, 0xf8, 0xe9, 0x45, 0xd3, 0x79, 0x76, 0xd1, 0x74, + 0xfe, 0xbd, 0x68, 0x3a, 0xe7, 0x97, 0xcd, 0xb5, 0x67, 0x97, 0xcd, 0xb5, 0xbf, 0x2f, 0x9b, 0x6b, + 0x5f, 0xee, 0x0d, 0x86, 0xf1, 0x37, 0xe3, 0xae, 0xdb, 0x93, 0xa3, 0x02, 0x5b, 0x3f, 0xa4, 0xd6, + 0xe2, 0xd3, 0x50, 0xa8, 0x6e, 0x45, 0xff, 0xe7, 0xfd, 0xe0, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x54, 0x53, 0x11, 0x88, 0x90, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index 36d58183c..8732df349 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -214,13 +214,31 @@ func local_request_Query_AssetInfoAll_0(ctx context.Context, marshaler runtime.M } var ( - filter_Query_Price_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_Price_0 = &utilities.DoubleArray{Encoding: map[string]int{"asset": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) func request_Query_Price_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetPriceRequest var metadata runtime.ServerMetadata + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["asset"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "asset") + } + + protoReq.Asset, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "asset", err) + } + if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -237,6 +255,24 @@ func local_request_Query_Price_0(ctx context.Context, marshaler runtime.Marshale var protoReq QueryGetPriceRequest var metadata runtime.ServerMetadata + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["asset"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "asset") + } + + protoReq.Asset, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "asset", err) + } + if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -823,9 +859,9 @@ var ( pattern_Query_AssetInfoAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"elys-network", "elys", "oracle", "asset_info"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_Price_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"elys-network", "elys", "oracle", "price"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_Price_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"elys-network", "elys", "oracle", "price", "asset"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_PriceAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"elys-network", "elys", "oracle", "price"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_PriceAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"elys-network", "elys", "oracle", "prices"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_PriceFeeder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"elys-network", "elys", "oracle", "price_feeder", "feeder"}, "", runtime.AssumeColonVerbOpt(true)))