pendulum-chain / oracle-pallet

The Unlicense
0 stars 0 forks source link

Change type of `volume` to `f64` #13

Closed ebma closed 9 months ago

ebma commented 9 months ago

The problem here is that parsing the response from the QUOTABLE_ASSETS_ENDPOINT (https://api.diadata.org/v1/quotedAssets) is not working.

It fails because the response of that endpoint contains a value 4656506323017036700000000000000 which is too large to fit into the Decimal type. It works when changing it to f64 though. While the f64 type will not be able to accurately hold all volumes, it works for the assets that we are interested in. I checked the resulting values for the supply of KSM and XLM and they look correct.

Closes #12.

bogdanS98 commented 9 months ago

Looks good to me 👍🏼