Skip to content

Bug report: GovClient.Proposals() doesn't properly parse request #365

Open
@dylanschultzie

Description

@dylanschultzie

Prerequisites

Expected Behavior

Presumably proposals should be returned that fit the given status: https://github.com/fetchai/cosmpy/blob/main/tests/unit/test_gov/test_rest_client.py#L93

Current Behavior

Response: 400, b'{\n  "code": 3,\n  "message": "type mismatch, parameter: proposal_id, error: strconv.ParseUint: parsing \\"\\": invalid syntax",\n  "details": [\n  ]\n}')

To Reproduce

from cosmpy.common.rest_client import RestClient
from cosmpy.gov.rest_client import GovRestClient
from cosmpy.protos.cosmos.gov.v1beta1.query_pb2 import QueryProposalsRequest

gov_client = GovRestClient(RestClient(f"https://rest-fetchhub.fetch.ai"))    
request = QueryProposalsRequest()
request.proposal_status = 2
response = gov_client.Proposals(request)

Context

Cosmpy: v0.8.0
Python: v3.11

Failure Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions