Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Enable Custom Event Subscription - #6262

Merged
Muhammad-Altabba merged 8 commits into
4.xfrom
6223-eth-subscription-manager-does-not-allow-custom-subscriptions
Jul 14, 2023
Merged

Enable Custom Event Subscription#6262
Muhammad-Altabba merged 8 commits into
4.xfrom
6223-eth-subscription-manager-does-not-allow-custom-subscriptions

Conversation

@Muhammad-Altabba

@Muhammad-Altabba Muhammad-Altabba commented Jul 6, 2023

Copy link
Copy Markdown
Contributor

Description

Fixes #6223 (for this, the way to inherit from Web3Subscription has been simplified)
And #6252

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run lint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success.
  • I ran npm run test:coverage and my test cases cover all the lines and branches of the added code.
  • I ran npm run build and tested dist/web3.min.js in a browser.
  • I have tested my code on the live network.
  • I have checked the Deploy Preview and it looks correct.
  • I have updated the CHANGELOG.md file in the root folder.
  • I have linked Issue(s) with this PR in "Linked Issues" menu.

+ add a test
+ fix 6252
@Muhammad-Altabba Muhammad-Altabba linked an issue Jul 6, 2023 that may be closed by this pull request
@github-actions

github-actions Bot commented Jul 6, 2023

Copy link
Copy Markdown

Bundle Stats

Hey 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

Asset Old size New size Diff Diff %
Total 646 KB 646 KB 439 bytes 0.07%
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset Old size New size Diff Diff %
../lib/commonjs/web3.d.ts 811 bytes 1.14 KB 361 bytes 44.51%

Smaller

No assets were smaller

Unchanged

Asset Old size New size Diff Diff %
web3.min.js 629 KB 629 KB 78 bytes 0.01%
../lib/commonjs/index.d.ts 8.56 KB 8.56 KB 0 0.00%
../lib/commonjs/accounts.d.ts 3.67 KB 3.67 KB 0 0.00%
../lib/commonjs/types.d.ts 2.45 KB 2.45 KB 0 0.00%
../lib/commonjs/abi.d.ts 1000 bytes 1000 bytes 0 0.00%
../lib/commonjs/eth.exports.d.ts 280 bytes 280 bytes 0 0.00%
../lib/commonjs/providers.exports.d.ts 148 bytes 148 bytes 0 0.00%
../lib/commonjs/version.d.ts 60 bytes 60 bytes 0 0.00%

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 6, 2023

Copy link
Copy Markdown

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 16117e3
Status: ✅  Deploy successful!
Preview URL: https://daca4c18.web3-js-docs.pages.dev
Branch Preview URL: https://6223-eth-subscription-manage.web3-js-docs.pages.dev

View logs

@codecov

codecov Bot commented Jul 10, 2023

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (4.x@51bc03d). Click here to learn what that means.
The diff coverage is 77.96%.

Additional details and impacted files
@@          Coverage Diff           @@
##             4.x    #6262   +/-   ##
======================================
  Coverage       ?   88.71%           
======================================
  Files          ?      198           
  Lines          ?     7638           
  Branches       ?     2103           
======================================
  Hits           ?     6776           
  Misses         ?      862           
  Partials       ?        0           
Flag Coverage Δ
UnitTests 88.71% <77.96%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
web3 ∅ <ø> (?)
web3-core ∅ <ø> (?)
web3-errors ∅ <ø> (?)
web3-eth ∅ <ø> (?)
web3-eth-abi ∅ <ø> (?)
web3-eth-accounts ∅ <ø> (?)
web3-eth-contract ∅ <ø> (?)
web3-eth-ens ∅ <ø> (?)
web3-eth-iban ∅ <ø> (?)
web3-eth-personal ∅ <ø> (?)
web3-net ∅ <ø> (?)
web3-providers-http ∅ <ø> (?)
web3-providers-ipc ∅ <ø> (?)
web3-providers-ws ∅ <ø> (?)
web3-rpc-methods ∅ <ø> (?)
web3-utils ∅ <ø> (?)
web3-validator ∅ <ø> (?)

Comment on lines 81 to 83
error: Error;
connected: number;
connected: string;
data: EventLog;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

intersection type using existing CommonSubscriptionEvents, instead of redefining these fields?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry, this connected should be removed from here, along with error, because its related codes are in the base class. And I had done that just now.
However, regarding connected, it was not used, and there was no code related to it, in any place in this class or in the base class.

@Muhammad-Altabba
Muhammad-Altabba merged commit e143157 into 4.x Jul 14, 2023
@Muhammad-Altabba
Muhammad-Altabba deleted the 6223-eth-subscription-manager-does-not-allow-custom-subscriptions branch July 14, 2023 14:57
This was referenced Aug 3, 2023
sanyu1225 pushed a commit to blocto/web3.js that referenced this pull request Aug 30, 2023
* enable custom subscription
* refactor to simplify the inheritance from Web3Subscription
* add `CombinedEventMap` type to `Web3Subscription`
* remove unneeded casting inside `_buildSubscriptionParams`
* add a test
* fix "Version 4.x does not fire connected event for subscriptions. web3#6252"
* update CHANGELOG.md files
sanyu1225 pushed a commit to blocto/web3.js that referenced this pull request Aug 30, 2023
* enable custom subscription
* refactor to simplify the inheritance from Web3Subscription
* add `CombinedEventMap` type to `Web3Subscription`
* remove unneeded casting inside `_buildSubscriptionParams`
* add a test
* fix "Version 4.x does not fire connected event for subscriptions. web3#6252"
* update CHANGELOG.md files
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eth Subscription Manager does not allow custom subscriptions

3 participants