diff --git a/CHANGELOG.md b/CHANGELOG.md index 535b683d49..3ce0b33b7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ * [#1520](https://github.com/crypto-org-chain/cronos/pull/1520) Avoid invalid chain id for signer error when rpc call before chain id set in BeginBlock. * [#1539](https://github.com/crypto-org-chain/cronos/pull/1539) Fix go-block-stm bug that causes app hash mismatch. +* [#1560](https://github.com/crypto-org-chain/cronos/pull/1560) Update queries contract addresses by native denom from a query in contract_by_denom. *Jun 18, 2024* diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 665c4e5d49..ceb1f05701 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -4,9 +4,11 @@ info: description: A REST interface for state queries version: 1.0.0 paths: - /cronos/v1/contract_by_denom/{denom}: + /cronos/v1/contract_by_denom: get: - summary: ContractByDenom queries contract addresses by native denom + summary: >- + ContractByDenom queries contract addresses by native denom from a query + string. operationId: ContractByDenom responses: '200': @@ -217,8 +219,8 @@ paths: } parameters: - name: denom - in: path - required: true + in: query + required: false type: string tags: - Query diff --git a/integration_tests/configs/genesis_token_mapping.jsonnet b/integration_tests/configs/genesis_token_mapping.jsonnet index e2cf59e778..df809d98bb 100644 --- a/integration_tests/configs/genesis_token_mapping.jsonnet +++ b/integration_tests/configs/genesis_token_mapping.jsonnet @@ -56,6 +56,10 @@ config { denom: 'gravity0x0000000000000000000000000000000000000000', contract: '0x68542BD12B41F5D51D6282Ec7D91D7d0D78E4503', }, + { + denom: 'ibc/6B5A664BF0AF4F71B2F0BAA33141E2F1321242FBD5D19762F541EC971ACB0865', + contract: '0x0000000000000000000000000000000000000000', + }, ], auto_contracts: [ { diff --git a/integration_tests/test_exported_genesis.py b/integration_tests/test_exported_genesis.py index 6be07e59d2..b6f382747e 100644 --- a/integration_tests/test_exported_genesis.py +++ b/integration_tests/test_exported_genesis.py @@ -2,6 +2,8 @@ from pathlib import Path import pytest +import requests +from pystarport import ports from .network import setup_custom_cronos from .utils import ADDRS, CONTRACTS @@ -29,8 +31,25 @@ def test_exported_contract(custom_cronos): def test_exported_token_mapping(custom_cronos): cli = custom_cronos.cosmos_cli(0) - rsp = cli.query_contract_by_denom( - "gravity0x0000000000000000000000000000000000000000" - ) - assert rsp["contract"] == "0x68542BD12B41F5D51D6282Ec7D91D7d0D78E4503" - assert rsp["auto_contract"] == "0x68542BD12B41F5D51D6282Ec7D91D7d0D78E4503" + port = ports.api_port(custom_cronos.base_port(0)) + for case in [ + { + "denom": "gravity0x0000000000000000000000000000000000000000", + "expected": { + "contract": "0x68542BD12B41F5D51D6282Ec7D91D7d0D78E4503", + "auto_contract": "0x68542BD12B41F5D51D6282Ec7D91D7d0D78E4503", + }, + }, + { + "denom": "ibc/6B5A664BF0AF4F71B2F0BAA33141E2F1321242FBD5D19762F541EC971ACB0865", # noqa: E501 + "expected": { + "contract": "0x0000000000000000000000000000000000000000", + "auto_contract": "", + }, + }, + ]: + denom = case["denom"] + expected = case["expected"] + assert cli.query_contract_by_denom(denom) == expected + url = f"http://127.0.0.1:{port}/cronos/v1/contract_by_denom?denom={denom}" + assert requests.get(url).json() == expected diff --git a/proto/cronos/query.proto b/proto/cronos/query.proto index 0f7c457d88..00127962b8 100644 --- a/proto/cronos/query.proto +++ b/proto/cronos/query.proto @@ -12,9 +12,9 @@ option go_package = "github.com/crypto-org-chain/cronos/v2/x/cronos/types"; // Query defines the gRPC querier service. service Query { - // ContractByDenom queries contract addresses by native denom + // ContractByDenom queries contract addresses by native denom from a query string. rpc ContractByDenom(ContractByDenomRequest) returns (ContractByDenomResponse) { - option (google.api.http).get = "/cronos/v1/contract_by_denom/{denom}"; + option (google.api.http).get = "/cronos/v1/contract_by_denom"; } // DenomByContract queries native denom by contract address diff --git a/x/cronos/types/query.pb.go b/x/cronos/types/query.pb.go index f929622915..569ff486c8 100644 --- a/x/cronos/types/query.pb.go +++ b/x/cronos/types/query.pb.go @@ -494,56 +494,56 @@ func init() { func init() { proto.RegisterFile("cronos/query.proto", fileDescriptor_d4ed0fd688c48372) } var fileDescriptor_d4ed0fd688c48372 = []byte{ - // 780 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x4f, 0x4f, 0xe3, 0x46, - 0x14, 0x8f, 0x21, 0xa4, 0x61, 0x02, 0x45, 0x9d, 0x50, 0x30, 0x6e, 0x6b, 0xa7, 0x6e, 0x05, 0x54, - 0x02, 0x5b, 0x84, 0x4a, 0xad, 0x7a, 0xe8, 0x21, 0x29, 0x12, 0x17, 0x50, 0x6b, 0xe5, 0x84, 0x90, - 0xac, 0x89, 0x33, 0x75, 0x2c, 0xf0, 0x8c, 0xf1, 0x8c, 0x23, 0x22, 0x84, 0x54, 0xb5, 0x97, 0x1e, - 0x91, 0xfa, 0x05, 0x38, 0xf7, 0x93, 0x70, 0x44, 0xea, 0xa5, 0xea, 0xa1, 0xbb, 0x82, 0x3d, 0xec, - 0xc7, 0x58, 0x79, 0x3c, 0x93, 0x04, 0x12, 0x76, 0x4f, 0x9e, 0xf9, 0xfd, 0xde, 0x9f, 0xdf, 0x9b, - 0xf7, 0x9e, 0x01, 0x0c, 0x52, 0x4a, 0x28, 0x73, 0x2f, 0x32, 0x9c, 0x0e, 0x9d, 0x24, 0xa5, 0x9c, - 0xc2, 0x4a, 0x81, 0x19, 0xab, 0x21, 0x0d, 0xa9, 0x80, 0xdc, 0xfc, 0x54, 0xb0, 0xc6, 0xe7, 0x21, - 0xa5, 0xe1, 0x39, 0x76, 0x51, 0x12, 0xb9, 0x88, 0x10, 0xca, 0x11, 0x8f, 0x28, 0x61, 0x92, 0xb5, - 0x24, 0x2b, 0x6e, 0xdd, 0xec, 0x57, 0x97, 0x47, 0x31, 0x66, 0x1c, 0xc5, 0x89, 0x34, 0xd8, 0xc0, - 0xbc, 0x8f, 0xd3, 0x38, 0x22, 0xd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a9, 0xbd, 0x7e, 0x30, 0xb5, 0x9b, 0x47, - 0xb3, 0x74, 0xff, 0x68, 0x96, 0xfe, 0x7d, 0x34, 0x4b, 0x27, 0xdf, 0x86, 0x11, 0xef, 0x67, 0x5d, - 0x27, 0xa0, 0xb1, 0x1b, 0xa4, 0xc3, 0x84, 0xd3, 0x5d, 0x9a, 0x86, 0xbb, 0x41, 0x1f, 0x45, 0x64, - 0x14, 0xac, 0xe9, 0x5e, 0xaa, 0x33, 0x1f, 0x26, 0x98, 0x75, 0x2b, 0xe2, 0xd7, 0xb0, 0xff, 0x2e, - 0x00, 0x00, 0xff, 0xff, 0x45, 0xdb, 0x55, 0xc7, 0x75, 0x06, 0x00, 0x00, + // 773 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x41, 0x4f, 0xe3, 0x46, + 0x14, 0x8e, 0x21, 0xa4, 0x61, 0x02, 0x45, 0x9d, 0x50, 0x30, 0x2e, 0xb5, 0x53, 0xb7, 0x2a, 0x54, + 0x2a, 0xb6, 0x08, 0x95, 0x5a, 0xf5, 0xd0, 0x43, 0x52, 0x24, 0x2e, 0xa0, 0xd6, 0xca, 0x09, 0x21, + 0x59, 0x13, 0x67, 0xea, 0x58, 0xe0, 0x19, 0xe3, 0x19, 0x47, 0x89, 0x50, 0x2f, 0xed, 0xa5, 0x47, + 0xa4, 0xfe, 0x01, 0xfa, 0x6f, 0x38, 0x22, 0xf5, 0xb2, 0xda, 0xc3, 0xee, 0x0a, 0xf6, 0xb0, 0x3f, + 0x63, 0xe5, 0xf1, 0x4c, 0x12, 0x48, 0xd8, 0x3d, 0xc5, 0xf3, 0x7d, 0x6f, 0xde, 0xf7, 0xde, 0xbc, + 0xef, 0x05, 0xc0, 0x20, 0xa5, 0x84, 0x32, 0xf7, 0x32, 0xc3, 0xe9, 0xc8, 0x49, 0x52, 0xca, 0x29, + 0xac, 0x14, 0x98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, 0x1c, 0xdb, 0xd9, 0x5b, 0xa2, 0xfa, 0x3a, 0xfc, 0x6c, 0xaa, 0xfa, 0xc2, + 0x63, 0x30, 0x01, 0xb5, 0x29, 0xa7, 0x40, 0xeb, 0x71, 0x9a, 0x19, 0xe3, 0x19, 0x8d, 0xe7, 0x03, + 0xa4, 0x98, 0x29, 0xc4, 0x74, 0xb8, 0x31, 0x2d, 0x36, 0x89, 0x6b, 0x9d, 0xdc, 0xde, 0x9b, 0xda, + 0xdd, 0xbd, 0xa9, 0xbd, 0xb9, 0x37, 0xb5, 0xeb, 0x07, 0xb3, 0x74, 0xf7, 0x60, 0x96, 0x5e, 0x3c, + 0x98, 0xa5, 0xd3, 0x1f, 0xc2, 0x88, 0xf7, 0xb3, 0xae, 0x13, 0xd0, 0xd8, 0x0d, 0xd2, 0x51, 0xc2, + 0xe9, 0x1e, 0x4d, 0xc3, 0xbd, 0xa0, 0x8f, 0x22, 0x32, 0x4e, 0xd6, 0x74, 0x87, 0xea, 0x9b, 0x8f, + 0x12, 0xcc, 0xba, 0x15, 0xf1, 0x8f, 0x70, 0xf0, 0x3e, 0x00, 0x00, 0xff, 0xff, 0x40, 0x82, 0x6e, + 0xe3, 0x6c, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -558,7 +558,7 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { - // ContractByDenom queries contract addresses by native denom + // ContractByDenom queries contract addresses by native denom from a query string. ContractByDenom(ctx context.Context, in *ContractByDenomRequest, opts ...grpc.CallOption) (*ContractByDenomResponse, error) // DenomByContract queries native denom by contract address DenomByContract(ctx context.Context, in *DenomByContractRequest, opts ...grpc.CallOption) (*DenomByContractResponse, error) @@ -626,7 +626,7 @@ func (c *queryClient) Permissions(ctx context.Context, in *QueryPermissionsReque // QueryServer is the server API for Query service. type QueryServer interface { - // ContractByDenom queries contract addresses by native denom + // ContractByDenom queries contract addresses by native denom from a query string. ContractByDenom(context.Context, *ContractByDenomRequest) (*ContractByDenomResponse, error) // DenomByContract queries native denom by contract address DenomByContract(context.Context, *DenomByContractRequest) (*DenomByContractResponse, error) diff --git a/x/cronos/types/query.pb.gw.go b/x/cronos/types/query.pb.gw.go index 38bd87d332..f127cb7749 100644 --- a/x/cronos/types/query.pb.gw.go +++ b/x/cronos/types/query.pb.gw.go @@ -33,26 +33,19 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join +var ( + filter_Query_ContractByDenom_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + func request_Query_ContractByDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq ContractByDenomRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ContractByDenom_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.ContractByDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -64,22 +57,11 @@ func local_request_Query_ContractByDenom_0(ctx context.Context, marshaler runtim var protoReq ContractByDenomRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ContractByDenom_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.ContractByDenom(ctx, &protoReq) @@ -418,7 +400,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_ContractByDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"cronos", "v1", "contract_by_denom", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ContractByDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"cronos", "v1", "contract_by_denom"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_DenomByContract_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"cronos", "v1", "denom_by_contract", "contract"}, "", runtime.AssumeColonVerbOpt(false)))