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

update event emitter geth ipc tests #5874

Merged
merged 13 commits into from
Mar 1, 2023
Merged

update event emitter geth ipc tests #5874

merged 13 commits into from
Mar 1, 2023

Conversation

luu-alex
Copy link
Contributor

@luu-alex luu-alex commented Feb 26, 2023

Description

#5634
The inconsistent testcases happen because the eventlistener receives confirmationortransactionhashonly half the time. This only happens on the IPC test suite while using geth. I believe by changing geth settings tomine`
this will allow blocks to be mined properly and fix this issue.

Also includes a changelog update from pr #5819
Please include a summary of the changes and be sure to follow our Contribution Guidelines.

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 for 1.x:

  • 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 dtslint with success and extended the tests and types if necessary.
  • I ran npm run test:cov and my test cases cover all the lines and branches of the added code.
  • I ran npm run build with success.
  • I have tested the built 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.

Checklist for 4.x:

  • I have selected the correct 4.x base branch.
  • Within the description, the feature or issue is discussed in detail or an issue is linked.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added any required tests for the changes I made
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules.
  • I ran yarn successfully
  • I ran yarn lint successfully
  • I ran yarn build:web successfully
  • I ran yarn test:unit successfully
  • I ran yarn test:integration successfully
  • I ran compile:contracts successfully
  • I have tested my code.
  • I have updated the corresponding CHANGELOG.md file in the packages I have edited.

@github-actions github-actions bot temporarily deployed to Preview: (5634/geth-tests) February 26, 2023 04:34 Inactive
@cloudflare-pages
Copy link

cloudflare-pages bot commented Feb 26, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6d05d4f
Status: ✅  Deploy successful!
Preview URL: https://8ff3c5ab.web3-js-docs.pages.dev
Branch Preview URL: https://5634-geth-tests.web3-js-docs.pages.dev

View logs

@github-actions
Copy link

github-actions bot commented Feb 26, 2023

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 1.18 MB 1.06 MB -119 KB -9.90%
View detailed bundle breakdown

Added

Asset Old size New size Diff Diff %
../lib/eth.exports.d.ts.map 0 358 bytes 358 bytes -
../lib/eth.exports.d.ts 0 321 bytes 321 bytes -
../lib/providers.exports.d.ts.map 0 292 bytes 292 bytes -
../lib/providers.exports.d.ts 0 238 bytes 238 bytes -

Removed

No assets were removed

Bigger

Asset Old size New size Diff Diff %
../lib/index.d.ts 77 bytes 899 bytes 822 bytes 1067.53%
../lib/index.d.ts.map 155 bytes 919 bytes 764 bytes 492.90%

Smaller

Asset Old size New size Diff Diff %
web3.min.js 1.17 MB 1.05 MB -121 KB -10.18%
../lib/types.d.ts 1.92 KB 1.68 KB -253 bytes -12.84%
../lib/types.d.ts.map 1.75 KB 1.51 KB -241 bytes -13.46%

Unchanged

Asset Old size New size Diff Diff %
../lib/accounts.d.ts 3.42 KB 3.42 KB 0 0.00%
../lib/abi.d.ts 1020 bytes 999 bytes -18 bytes -1.77%
../lib/web3.d.ts 842 bytes 842 bytes 0 0.00%
../lib/web3.d.ts.map 693 bytes 694 bytes 1 bytes 0.14%
../lib/accounts.d.ts.map 528 bytes 528 bytes 0 0.00%
../lib/version.d.ts.map 140 bytes 140 bytes 0 0.00%
../lib/abi.d.ts.map 124 bytes 124 bytes 0 0.00%
../lib/version.d.ts 97 bytes 97 bytes 0 0.00%

@github-actions github-actions bot temporarily deployed to Preview: (5634/geth-tests) February 27, 2023 23:27 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (5634/geth-tests) February 28, 2023 16:34 Inactive
@codecov
Copy link

codecov bot commented Feb 28, 2023

Codecov Report

Merging #5874 (6d05d4f) into 4.x (a17f87e) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##              4.x    #5874   +/-   ##
=======================================
  Coverage   80.03%   80.03%           
=======================================
  Files         136      136           
  Lines        5899     5899           
  Branches     1537     1537           
=======================================
  Hits         4721     4721           
  Misses       1178     1178           
Flag Coverage Δ
UnitTests 80.03% <ø> (ø)

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

@github-actions github-actions bot temporarily deployed to Preview: (5634/geth-tests) February 28, 2023 17:23 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (5634/geth-tests) February 28, 2023 19:03 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (5634/geth-tests) February 28, 2023 19:04 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (5634/geth-tests) February 28, 2023 19:29 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (5634/geth-tests) February 28, 2023 20:01 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (5634/geth-tests) February 28, 2023 20:18 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (5634/geth-tests) February 28, 2023 20:43 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (5634/geth-tests) February 28, 2023 21:03 Inactive
@luu-alex luu-alex changed the title update geth binary tests update event emitter geth ipc tests Mar 1, 2023
@luu-alex luu-alex marked this pull request as ready for review March 1, 2023 09:04
@github-actions github-actions bot temporarily deployed to Preview: (5634/geth-tests) March 1, 2023 09:12 Inactive
Copy link
Contributor

@jdevcs jdevcs left a comment

Choose a reason for hiding this comment

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

As discussed in meeting that its related to node config and not with out lib.

we can keep this config so that our CI is green.

@jdevcs
Copy link
Contributor

jdevcs commented Mar 1, 2023

approved. and pls make sure CI ( specially for issue under discussion ) is passing before merging . Thanks,

@luu-alex luu-alex merged commit 676c6f2 into 4.x Mar 1, 2023
@luu-alex luu-alex deleted the 5634/geth-tests branch March 1, 2023 15:42
spacesailor24 pushed a commit that referenced this pull request Mar 9, 2023
* update geth binary tests

* update helper and changelog

* adding await

* update helper

* add await

* add await

* add await

* fix typings

* update tests

* update

* debug

* remove debugging
spacesailor24 added a commit that referenced this pull request Mar 9, 2023
* Add payload as optional argument for InvalidResponseError

* Init Transaction Error Scenarios tests

* Init ERR_TX_REVERT_TRANSACTION_CUSTOM_ERROR

* WIP

* WIP

* Update TransactionRevertedWithoutReasonError to handle receipts objects with BigInts

* Update sendTransaction revert tests

* Add contractAbi argument to getTransactionError

* sendTransation emits error for ContractExecutionError

* Add ContractExecutionError to SendTransactionEvents. Add contractAbi to SendTransactionOptions

* Replace use of contractExecutionError sendTransaction event with error

* Update contract_methods reverts test

* Update web3-errors test

* Update expected error mesage for contract_deploy_test

* Add expectedErrorObject based on test backend

* Correct web3-errors test snapshots

* fix (#5869)

* 5747 codecov (#5843)

* code cov integration for unit tests

* removed cov threshold

* code cov token

* by default collect coverage

* codecov with existing unittests

* jest config

* only analyze coverage for n v16 unit test runs

* node ver

* codecov paths config

* added layout

* common config

* flag names in ci

* flags under proj

* min CI for test

* build and test for u14 and 16

* validated yml

* components usage

* comment moved at end

* updated comments

* testing 90% cov target

* component cov target

* patch cov

* enable actions + remove old coverage check actions

* codecov config change

* remove unused scripts

* ens system tests (#5849)

* Expose registry events in ens class

* Add tests for events

* Check for socket

* Skip test

* Try to unskip test

* skip test again

* Update packages/web3-eth-ens/test/integration/ens.events.test.ts

Co-authored-by: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com>

* feedback

---------

Co-authored-by: Junaid <86780488+jdevcs@users.noreply.github.com>
Co-authored-by: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com>

* Disconnect function doesn't exists in types of currentProvider (#5865)

* fix disconnect function

* add link

* test types

* add disconnect function test

* fix eth tests

* test stuck

* trace

* fix

* check

* fix test

* add empty disconnect function

* add test for provider instances

* fix http unit test

* remove logs

* revert to throw error http provider

---------

Co-authored-by: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com>

* Nikos/fix ens event test (#5880)

* Expose registry events in ens class

* Add tests for events

* Check for socket

* Skip test

* Try to unskip test

* skip test again

* Update packages/web3-eth-ens/test/integration/ens.events.test.ts

Co-authored-by: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com>

* feedback

* Try fix

* Merge branch '4.x'

* Revert conf files

* Remove error for event

---------

Co-authored-by: Junaid <86780488+jdevcs@users.noreply.github.com>
Co-authored-by: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com>

* update event emitter geth ipc tests (#5874)

* update geth binary tests

* update helper and changelog

* adding await

* update helper

* add await

* add await

* add await

* fix typings

* update tests

* update

* debug

* remove debugging

* 4.x issue stale conf (#5878)

* Add documentation for catching provider events (#5886)

* show Ipc and WebSocket providers in the documentation

* add guides for providers and their events

* move the generic section of the providers guide from the migration guide

* edit some texts in the guides

* Fixing tests for WS and IPC

* Remove jest specific test code that doesn't work in Cypress

* Remove jest specific test code that doesn't work in Cypress

* Remove jest specific test code

* Add toLowerCase for address

* Rename TransactionRevertError to TransactionRevertInstructionError

* Add beforeAll for Transaction Error Scenario tests

* Add Transaction Error Scenario tests for call

* Add support for handleRevert in sendTransaction for geth

* Update tests and add test to verify event error is same as thrown error

* Correct test expected data

* Remove message from expectedThrownError for sendTransaction tests

* Add error refactors to sendSignedTransaction and init tests

* Remove call Transaction Error Scenario tests

* Fix type error

* Fix nonce issue in tests

* Fix error parsing bug for web3Eth.sendSignedTransaction

* Update expected error for send_signed_transaction error tests

* Revert ResponseError change to maintain 1.x parity

* Add web3-errors test for TransactionRevertWithCustomError

* Update expected error message for RespnoseError in web3-eth-contract tests

* Add example to dev comment for sendSignedTransaction

* Removed implemented TODO in packages/web3-eth/src/utils/get_transaction_error.ts

* Update CHANGELOGs

* Update CHANGELOG.md

* Init get_transaction_error tests

* Add mock to getRevertReason for get_transaction_error tests

* Init getRevertReason tests and parseTransactionError tests

* Add check for revert before sending tx

* Update web3-plugin-example test to account for getRevertReason check

* Turn off checkRevertBeforeSending for sendFewTxes helper

* Fix test data for send_signed_transaction tests

* Fix bug in get_transaction_error

* Fix send_transaction error test

* Add checkRevertBeforeSending: false to sendTransaction calls in Contract class

* Add checkRevertBeforeSending: false for send tx test helpers

* Remove getRevertReason mock

* A fix at `IpcProvider` and few changes at `SocketProvider` and its descendants (#5891)

* rename `_providerOptions` to `_socketOptions`

* pass `_socketOptions` from IpcProvider constructor to the underlying connection

* move a comment to its correct position at `SocketProvider`

* expose the getter of `SocketConnection` from `SocketProvider`.

* update CHANGELOG.md files

* add extremely simple unit test for SocketProvider

* Fix failed tx test for ganache

* Update expected transaction errors for ganache

* Fix method handler crashed (#5905)

* version fix

* use geth binary

* try 1.11.2

* Test fix

* Use `v1` instead of Short Sha for cloudflare/pages-action (#5909)

* use `v1` instead of short Sha for cloudflare/pages-action

---------

Co-authored-by: Oleksii Kosynskyi <oleksii.kosynskyi@gmail.com>
Co-authored-by: Junaid <86780488+jdevcs@users.noreply.github.com>
Co-authored-by: Nikos Iliakis <nikoulai@users.noreply.github.com>
Co-authored-by: Muhammad Altabba <24407834+Muhammad-Altabba@users.noreply.github.com>
Co-authored-by: Alex <alex.luu@mail.utoronto.ca>
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.

None yet

3 participants