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

Chore: Replace new instances of ApiPromises with (re)using interBtcApi instance #136

Merged
merged 9 commits into from
Aug 10, 2023
Merged

Chore: Replace new instances of ApiPromises with (re)using interBtcApi instance #136

merged 9 commits into from
Aug 10, 2023

Conversation

bvotteler
Copy link
Contributor

@bvotteler bvotteler commented Aug 2, 2023

Resolves #135

Changes made:

  • Removed the creation of new instances of ApiPromise when trying to fetch foreign asset data
  • Replaced it with using the shared InterBtcApi lib instance instead
  • Added tests
  • Added a few static structures and helpers to assist testing setups
  • Simplified a few other structures to remove unnecessary generic map inversions (that confused Jest)
  • Edited test coverage action to store base values when merging to master (enables showing change in coverage percentages)

@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

❗ No coverage uploaded for pull request base (master@4a8ef15). Click here to learn what that means.
The diff coverage is n/a.

@@           Coverage Diff            @@
##             master    #136   +/-   ##
========================================
  Coverage          ?   1.82%           
========================================
  Files             ?      33           
  Lines             ?    2140           
  Branches          ?     484           
========================================
  Hits              ?      39           
  Misses            ?    1973           
  Partials          ?     128           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@interlay interlay deleted a comment from github-actions bot Aug 3, 2023
Copy link
Contributor

@peterslany peterslany left a comment

Choose a reason for hiding this comment

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

Good job making this code more readable 🙌

src/mappings/_utils.test.ts Show resolved Hide resolved
src/mappings/_utils.ts Show resolved Hide resolved
src/mappings/_utils.ts Show resolved Hide resolved
@bvotteler bvotteler merged commit 3ae2c58 into interlay:master Aug 10, 2023
@bvotteler bvotteler deleted the fix-close-api-promise-connections branch August 10, 2023 03:03
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.

Reduce use of ApiPromise connections, or close after use
2 participants