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

added the functionality to introduce different timeout value for Web3… #6336

Merged
merged 4 commits into from
Aug 17, 2023

Conversation

shubhamshd
Copy link
Contributor

…BatchRequest

Description

This change adds the functionality in execute method of Web3BatchRequest class to set timeout value other than the default one.

Fixes #6190

Type of change

  • New feature (non-breaking change which adds functionality)

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.

if (this.requests.length === 0) {
return Promise.resolve([]);
}

const request = new Web3DeferredPromise<JsonRpcBatchResponse<unknown, unknown>>({
timeout: DEFAULT_BATCH_REQUEST_TIMEOUT,
timeout: options?.timeout ?? DEFAULT_BATCH_REQUEST_TIMEOUT,
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for your contribution. This should be mentioned in changelog.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

apologies @jdevcs are you suggesting any change?

Copy link

Choose a reason for hiding this comment

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

@jdevcs Was the checklist not necessary? I couldn't even build the project and therefore abandoned the task.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@jdevcs Was the checklist not necessary? I couldn't even build the project and therefore abandoned the task.

Could you share problems you were stuck? Most of items are also checks in CI ( lint, build, tests etc)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

apologies @jdevcs are you suggesting any change?

This should be added in changelog files : https://github.com/shubhamshd/web3.js/blob/4.x/packages/web3-core/CHANGELOG.md and https://github.com/shubhamshd/web3.js/blob/4.x/packages/web3/CHANGELOG.md

Ok I just need to update the changelog files right ? under unreleased section?
I'll just create new commit and update the existing pr thanks @jdevcs

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, please update these changelog files

Copy link
Contributor Author

@shubhamshd shubhamshd Aug 14, 2023

Choose a reason for hiding this comment

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

done, please review @avkos @jdevcs

Copy link
Contributor

Choose a reason for hiding this comment

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

Due to recent release there are some file conflicts,
could you see those, or one of our team member can fix if you dnt have time. I am approving PR but I'll merge PR after fixes. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jdevcs I have resolved the conflict and updated the pr
Could you please review this now and merge, thanks!!!

@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Merging #6336 (7771e77) into 4.x (7a38fee) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##              4.x    #6336   +/-   ##
=======================================
  Coverage   89.10%   89.11%           
=======================================
  Files         199      199           
  Lines        7722     7723    +1     
  Branches     2127     2128    +1     
=======================================
+ Hits         6881     6882    +1     
  Misses        841      841           
Flag Coverage Δ
UnitTests 89.11% <100.00%> (+<0.01%) ⬆️

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

if (this.requests.length === 0) {
return Promise.resolve([]);
}

const request = new Web3DeferredPromise<JsonRpcBatchResponse<unknown, unknown>>({
timeout: DEFAULT_BATCH_REQUEST_TIMEOUT,
timeout: options?.timeout ?? DEFAULT_BATCH_REQUEST_TIMEOUT,
Copy link
Contributor

Choose a reason for hiding this comment

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

yes, please update these changelog files

@jdevcs jdevcs requested a review from avkos August 16, 2023 07:52
@jdevcs jdevcs merged commit d41a49e into web3:4.x Aug 17, 2023
60 of 63 checks passed
@jdevcs jdevcs mentioned this pull request Aug 18, 2023
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.

Cannot change the default value of the batch request timeout
5 participants