dfinity / exchange-rate-canister

The exchange rate canister (XRC) makes use of the HTTP requests feature to provide exchange rates as a service to the IC.
Apache License 2.0
37 stars 10 forks source link

`bugfix`: fiat-crypto pairs were not handled correctly in earlier refactor #175

Closed dfinity-ryancroote closed 1 year ago

dfinity-ryancroote commented 1 year ago

When deploying the timestamp = null feature, ForexQuoteAssetNotFound errors started to populate the logs. This lead to the discovery that the refactor missed the inversion of the base and quote assets for fiat-crypto pairs.

This PR addresses the issue by inverting the base and quote assets for a fiat-crypto pair. The inverted request is then passed in to the handle_crypto_base_fiat_quote_pair handle function. To ensure coverage to avoid this problem from occurring in the future, additional unit tests were added to ensure this case is covered.