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

LocalProvider - close method #2020

Merged
merged 5 commits into from
Nov 16, 2023

Conversation

svetoslav-nikol0v
Copy link
Contributor

Description:

  • Adding a close method in LocalProvider class that closes the client

Related issue(s):

Fixes #

Notes for reviewer:

The idea is to close client when we have an instance of the Wallet which is using LocalProvider.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: svetoslav-nikol0v <[email protected]>
Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (ff951ea) 76.12% compared to head (4f51c9f) 83.78%.

❗ Current head 4f51c9f differs from pull request most recent head bf2168b. Consider uploading reports for the commit bf2168b to get more accurate results

Files Patch % Lines
src/LocalProvider.js 71.42% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2020      +/-   ##
===========================================
+ Coverage    76.12%   83.78%   +7.65%     
===========================================
  Files          304      304              
  Lines        75854    75861       +7     
===========================================
+ Hits         57746    63557    +5811     
+ Misses       18108    12304    -5804     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 171 to 174
this._client._network.close();
this._client._mirrorNetwork.close();
this._client._isShutdown = true;
clearTimeout(this._client._timer);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just call this._client.close() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we can. For some reason it didn't work first time but now it's ok.

@svetoslav-nikol0v svetoslav-nikol0v marked this pull request as ready for review November 14, 2023 14:40
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
19.3% 19.3% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@ochikov ochikov merged commit e3d2ed3 into develop Nov 16, 2023
7 of 8 checks passed
@ochikov ochikov deleted the close-client-when-using-wallet-with-provider branch November 16, 2023 12:52
@Petyo-Lukanov Petyo-Lukanov linked an issue Nov 16, 2023 that may be closed by this pull request
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.

Add LocalProvider close method
3 participants