-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Refactor subscription's logic #6210
Refactor subscription's logic #6210
Conversation
- Moved subscribing to provider events from Web3Subscription to Web3SubscriptionManager - subscribe and un subscribe called at Web3Subscription now is the same as calling them on Web3SubscriptionManager - Web3Subscription is lined now to Web3SubscriptionManager instead of directly to Web3RequestManager - update test cases ...
Bundle StatsHey there, this message comes from a github action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## 4.x #6210 +/- ##
==========================================
+ Coverage 87.46% 87.59% +0.12%
==========================================
Files 197 197
Lines 7557 7593 +36
Branches 2060 2078 +18
==========================================
+ Hits 6610 6651 +41
+ Misses 947 942 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Deploying with
|
Latest commit: |
8727ea1
|
Status: | ✅ Deploy successful! |
Preview URL: | https://9773d5df.web3-js-docs.pages.dev |
Branch Preview URL: | https://6202-subscribe-to-2-events-w.web3-js-docs.pages.dev |
+ mark the obsolete as deprecated
…em-to-not-work-properly' of https://github.com/ChainSafe/web3.js into 6202-subscribe-to-2-events-with-single-web3-instance-seem-to-not-work-properly
…nstance-seem-to-not-work-properly
+ update CHANGELOG + Fix some events types at `SocketProvider`
…nstance-seem-to-not-work-properly
Description
Identified issues:
Refactor subscription's logic
Web3Subscription
constructor now acceptsWeb3SubscriptionManager
(as an alternative to acceptingWeb3RequestManager
that is now marked as deprecated)Web3Subscription
constructor overloading that acceptsWeb3SubscriptionManager
is marked as deprecatedMoved subscribing to provider events from
Web3Subscription
toWeb3SubscriptionManager
subscribe
andunsubscribe
called atWeb3Subscription
now is the same as calling them onWeb3SubscriptionManager
Web3Subscription
is lined now toWeb3SubscriptionManager
instead of directly toWeb3RequestManager
Added the
SimpleProvider
interface which has onlyrequest(args)
method that is compatible with EIP-1193Added the
Eip1193EventName
type that contains the possible events names according to EIP-1193The
EIP1193Provider
class has now all the events (foron
andremoveListener
) according to EIP-1193update test cases ...
Fixes: #6202
Type of change
Checklist:
npm run lint
with success and extended the tests and types if necessary.npm run test:unit
with success.npm run test:coverage
and my test cases cover all the lines and branches of the added code.npm run build
and testeddist/web3.min.js
in a browser.CHANGELOG.md
file in the root folder.