vegaprotocol / data-node

A rich API server for Vega Protocol
https://vega.xyz
Other
3 stars 1 forks source link

Party Stake Linkings API fails with InvalidArgument error / type.googleapis.com/vega.ErrorDetail #850

Closed vega-paul closed 2 years ago

vega-paul commented 2 years ago

Stake Linkings API is falling to find existing valid party with stake.

Find a party:

curl "http://0.0.0.0:3029/parties"
{
  "parties": [
    {
      "id": "network"
    },
    {
      "id": "1b363e16017ba72c02691321fe9b6f714fbb599f3cc91a45ab1aaffeb60878bf"
    },
    {
      "id": "9e46bf6ad3153acb49387228b67596c95e26379d7ad47c4b4bd28089a996fb65"
    },
    {
      "id": "13e02645cf9d19614e5cf3c3ce3e9b20ca632d2f0dc568ed53094ca055751ea8"
    },
    {
      "id": "72b390b9f5cffbf1422d2c86874edab1e71c320e89760dddf876c760aa2adf9b"
    },
    {
      "id": "191ec64f40ce6282dc07c9b6fd878a610a92de603325b2d776dbea32d3bea30a"
    },
    {
      "id": "32c3fe212f2644cc02970ea957e4a037833a5c14c1a625c6db2d40ea25ea1767"
    }
  ]
}

Submit API to return stake linkings...

curl "http://0.0.0.0:3029/parties/stake?party=32c3fe212f2644cc02970ea957e4a037833a5c14c1a625c6db2d40ea25ea1767"
{
  "code": 3,
  "message": "InvalidArgument error",
  "details": [
    {
      "@type": "type.googleapis.com/vega.ErrorDetail",
      "code": 50002,
      "message": "failed to get party for ID",
      "inner": "'stake': invalid hex id"
    }
  ]
}

Stake linkings event exists

{"id":"1437-13","block":"636D6DF627699CA3BBAE97C075E6E6EF791C4EC3E5E3B38A061EF3E09AF4A8F8","type":"BUS_EVENT_TYPE_STAKE_LINKING","stakeLinking":{"id":"e20081d9aef35e85d1e7f7494c94479f007952cea26e91dd052bbe1cc753ceb3","type":"TYPE_LINK","ts":"1660574690","party":"32c3fe212f2644cc02970ea957e4a037833a5c14c1a625c6db2d40ea25ea1767","amount":"9749958450000000000","status":"STATUS_ACCEPTED","finalizedAt":"1660574709546881000","txHash":"0xb9aa8fbf65ca4dfce4994c7c717ce00f02a6868539b7bf75975f19861bf0fae7","blockHeight":"1121","blockTime":"1660574690","logIndex":"2","ethereumAddress":"0xEe7D375bcB50C26d52E1A4a472D8822A2A22d94F"},"version":1,"chainId":"test-chain-wc0swD","txHash":"636D6DF627699CA3BBAE97C075E6E6EF791C4EC3E5E3B38A061EF3E09AF4A8F8"}
pscott31 commented 2 years ago

I think you're using the wrong URL, e.g.

/parties/xxx/stake

Works for me. That said I was about to point you at the 'v2' version of this and noticed there doesn't seem to be one so I'll sort that.

gordsport commented 2 years ago

@vega-paul Please can you retest using the updated URL and close if no longer an issue?