This repository was archived by the owner on Mar 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Refactor subscription's logic #6210
Merged
Muhammad-Altabba
merged 18 commits into
4.x
from
6202-subscribe-to-2-events-with-single-web3-instance-seem-to-not-work-properly
Jun 24, 2023
Merged
Refactor subscription's logic #6210
Muhammad-Altabba
merged 18 commits into
4.x
from
6202-subscribe-to-2-events-with-single-web3-instance-seem-to-not-work-properly
Jun 24, 2023
+645
−174
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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 |
luu-alex
approved these changes
Jun 19, 2023
+ 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
jdevcs
reviewed
Jun 21, 2023
jdevcs
reviewed
Jun 21, 2023
+ update CHANGELOG + Fix some events types at `SocketProvider`
…nstance-seem-to-not-work-properly
jdevcs
approved these changes
Jun 22, 2023
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.