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

6201 multi provider #6825

Merged
merged 8 commits into from
Feb 27, 2024
Merged

6201 multi provider #6825

merged 8 commits into from
Feb 27, 2024

Conversation

jdevcs
Copy link
Contributor

@jdevcs jdevcs commented Feb 21, 2024

Description

#6201

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.

@jdevcs jdevcs added the 4.x 4.0 related label Feb 21, 2024
Copy link

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 0 621 KB 621 KB -
View detailed bundle breakdown

Added

Asset Old size New size Diff Diff %
web3.min.js 0 603 KB 603 KB -
../lib/commonjs/index.d.ts 0 8.63 KB 8.63 KB -
../lib/commonjs/accounts.d.ts 0 3.89 KB 3.89 KB -
../lib/commonjs/types.d.ts 0 2.45 KB 2.45 KB -
../lib/commonjs/web3.d.ts 0 1.26 KB 1.26 KB -
../lib/commonjs/abi.d.ts 0 999 bytes 999 bytes -
../lib/commonjs/web3_eip6963.d.ts 0 922 bytes 922 bytes -
../lib/commonjs/eth.exports.d.ts 0 280 bytes 280 bytes -
../lib/commonjs/providers.exports.d.ts 0 148 bytes 148 bytes -
../lib/commonjs/version.d.ts 0 60 bytes 60 bytes -

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

No assets were unchanged

Copy link

github-actions bot commented Feb 21, 2024

Benchmark

Benchmark suite Current: 6fe67a7 Previous: 6c075db Ratio
processingTx 9675 ops/sec (±3.93%) 9301 ops/sec (±4.81%) 0.96
processingContractDeploy 38479 ops/sec (±7.51%) 39129 ops/sec (±7.62%) 1.02
processingContractMethodSend 20213 ops/sec (±6.63%) 19443 ops/sec (±5.19%) 0.96
processingContractMethodCall 40362 ops/sec (±5.86%) 38971 ops/sec (±6.34%) 0.97
abiEncode 46680 ops/sec (±6.61%) 44252 ops/sec (±6.92%) 0.95
abiDecode 30841 ops/sec (±8.35%) 30419 ops/sec (±8.89%) 0.99
sign 1629 ops/sec (±3.31%) 1656 ops/sec (±4.08%) 1.02
verify 381 ops/sec (±0.34%) 373 ops/sec (±0.78%) 0.98

This comment was automatically generated by workflow using github-action-benchmark.

window.addEventListener(
Eip6963EventName.eip6963announceProvider as any,
(event: EIP6963AnnounceProviderEvent) => {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not emitting eip6963:announceProvider event here via web3promi events as discussed in issue, because,

  • if user is listening to eip6963:announceProvider event after using this utility method then this utility method is just additional overlapping work also listening to same event and re-emitting without any need of processing,

  • EIP 6963 clearly specifies "... MUST use the window.dispatchEvent function to emit events and MUST use the window.addEventListener function to observe events ... ",

Copy link
Contributor

Choose a reason for hiding this comment

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

Should be stated somewhere that we return web3promievent for the users

Copy link
Contributor Author

Choose a reason for hiding this comment

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

web3promievent is not returned due to above reasons.

@jdevcs jdevcs changed the title Junaid/6201multiprovider 6201 multi provider Feb 21, 2024
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Merging #6825 (c7960e1) into 4.x (4358140) will increase coverage by 4.68%.
Report is 184 commits behind head on 4.x.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##              4.x    #6825      +/-   ##
==========================================
+ Coverage   87.37%   92.05%   +4.68%     
==========================================
  Files         197      215      +18     
  Lines        7548     8206     +658     
  Branches     2059     2208     +149     
==========================================
+ Hits         6595     7554     +959     
+ Misses        953      652     -301     
Flag Coverage Δ
UnitTests 92.05% <100.00%> (+4.68%) ⬆️

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 ∅ <ø> (∅)

Copy link
Contributor

@avkos avkos left a comment

Choose a reason for hiding this comment

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

LGTM. Also, it will be great to have some section in docs that explain how to use requestEIP6963Providers

@luu-alex
Copy link
Contributor

LGTM other than oleksii's feedback

@jdevcs jdevcs requested a review from avkos February 26, 2024 12:30
@github-actions github-actions bot requested a deployment to web3-js-docs (Preview) February 26, 2024 12:37 Abandoned
@jdevcs jdevcs merged commit 86447cd into 4.x Feb 27, 2024
51 of 53 checks passed
@jdevcs jdevcs deleted the junaid/6201multiprovider branch February 27, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants