hodgerpodger / staketaxcsv

python repo to create blockchain CSVs
MIT License
252 stars 119 forks source link

report_inj failing with `{"code":13, "message":"query cannot be empty", "details":[]}`. #364

Closed AmazingFib closed 3 months ago

AmazingFib commented 3 months ago

Hey, thanks for this repo!

I am running into issuse with report_inj: it's failing with {"code":13, "message":"query cannot be empty", "details":[]}. Wondering if I am doing something wrong

Or it might have been polkach. When I visit the URL on a browser, I see the same error.

But injective seems to be working on stake.tax

Thanks!

Here is an example

python3 src/staketaxcsv/report_inj.py inj1r9khp68xmxkanpzskuh3ehr5xp4ps6j42t3c38 

the below url is what gets generated as part above

https://injective-api.polkachu.com/cosmos/tx/v1beta1/txs?page=1&limit=100&order_by=2&events=message.sender%3D%27inj1r9khp68xmxkanpzskuh3ehr5xp4ps6j42t3c38%27

visting it via browser gives

{"code":13, "message":"query cannot be empty", "details":[]}
hodgerpodger commented 3 months ago

oh interesting--i believe this is an error indicating this node is running a newer version of cosmos sdk. sounds like a bug I can likely fix (might be a few days til I can get to it, but will do).

if you're more curious on the specifics, I wrote a quick hack solution here for kyve with the same issue: https://github.com/hodgerpodger/staketaxcsv/commit/61147d1d92cca5337645ca6c1efb62606f122f3a . Looks like it's more than one blockchain so I'll probably find a more general fix soon-ish.

AmazingFib commented 3 months ago

Thanks! Confirm that changing events to query ran without error.

On a side note, this polkachu node seems to only have the newer tx ie. Trying to fetch some older tx result in tx not found. Wondering if this is your experience as well? If so, I am assuming stake.tax runs with a different node?

hodgerpodger commented 3 months ago

Okay I looked into it a bit more. Injective uses the mintscan data source for the website. Details can be found here: https://docs.stake.tax/devs/configuring-use-of-mintscan-api

This error you found is indeed an error when using the default lcd data source.

hodgerpodger commented 3 months ago

Fixed with https://github.com/hodgerpodger/staketaxcsv/commit/754901be3ae1c733ba63a987bf0df8cc706402de .