Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing bittytax.conf does not invalidate the price cache #239

Open
curtailment opened this issue Feb 28, 2022 · 0 comments
Open

Changing bittytax.conf does not invalidate the price cache #239

curtailment opened this issue Feb 28, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@curtailment
Copy link

Within bittytax.conf you can change the mapping of symbols to asset IDs. So if you notice that BittyTax has the wrong asset & price for one of your assets, you then edit bittytax.conf to override the mapping of that symbol. However, if you do not manually delete the price cache, BittyTax continues to use the cached pricing data for the wrong mapping.

To reproduce, try the following:

> bittytax_price historic WMATIC 2021-09-17
WARNING Price for WMATIC on 2021-09-17 is not available

It fails because BittyTax has mapped WMATIC to "Wrapped Matic Tezos" on CoinGecko instead of the normal "Wrapped Matic" (on Polygon). The Tezos version did not exist on the date requested. See issue #238 for improving default asset mapping.

Now add the following line to bittytax.conf within data_source_select which points BittyTax to the intended asset:

'WMATIC': ['CoinGecko:wmatic']

Try the console again:

> bittytax_price historic WMATIC 2021-09-17
WARNING Price for WMATIC on 2021-09-17 is not available

The cached data is still being used despite the config change.

Now delete the cache folder in your home directory and run the terminal again:

> bittytax_price historic WMATIC 2021-09-17
1 WMATIC=0.000028964338348995474 BTC via CoinGecko (Wrapped Matic)
1 BTC=34,421.8895 GBP via CoinDesk (Bitcoin)
1 WMATIC=£1.00 GBP

Possible solutions:

  • Store cached price data by ID instead of symbol.
  • Store the modified date (or hash) of bittytax.conf in the cache. Then every time bittytax starts, check if these still match, else the config has been changed so delete the cache folder.
@nanonano nanonano self-assigned this Sep 6, 2022
@nanonano nanonano added the bug Something isn't working label Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants