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

Feat: Fetch fiat price #26

Merged
merged 10 commits into from
May 29, 2024
Merged

Feat: Fetch fiat price #26

merged 10 commits into from
May 29, 2024

Conversation

tmrdlt
Copy link
Member

@tmrdlt tmrdlt commented Apr 24, 2024

  • Implemented CoinmarketcapClient for fetching fiat price on log basis including throtteling
  • Introduced HttpService
  • Bonus: Workaround for int-as-string param not being present in paginated calls

@tmrdlt tmrdlt self-assigned this Apr 24, 2024
Base automatically changed from test/validator-v2 to feat/grant-2 April 24, 2024 13:54
@tmrdlt tmrdlt force-pushed the feat/fetch-fiat-price branch 3 times, most recently from 5016c87 to cae619e Compare April 24, 2024 15:31
@tmrdlt tmrdlt marked this pull request as ready for review April 24, 2024 15:34
@tmrdlt tmrdlt requested a review from kenodressel April 24, 2024 15:39
@tmrdlt tmrdlt force-pushed the feat/fetch-fiat-price branch from cae619e to 72605bb Compare April 25, 2024 09:31
Comment on lines +95 to +97
const result = await this.get<MdwPaginatedResponse<T>>(
next + `&int-as-string=${this.INT_AS_STRING}`,
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor notes: should have been its own PR

expect.anything(),
);
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we test what happens if we run in the rate limit error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I'd add it to the importer spec however, as in the CoinmarketcapClieht nothing much happens besides returning the error (we are using a mocked version of the API).

service.getHistoricalPriceDataThrottled(1704203935123);
service.getHistoricalPriceDataThrottled(1704203935123);

await new Promise((res) => setTimeout(res, 200));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems a bit flaky, could we await the first two calls and then for the third call use the timeout?

@kenodressel kenodressel merged commit 1495594 into feat/grant-2 May 29, 2024
2 checks passed
@kenodressel kenodressel deleted the feat/fetch-fiat-price branch May 29, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants