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

Use provider.request() when available #3625

Merged
merged 6 commits into from
Jul 8, 2020
Merged

Use provider.request() when available #3625

merged 6 commits into from
Jul 8, 2020

Conversation

ryanio
Copy link
Collaborator

@ryanio ryanio commented Jul 7, 2020

Description

This PR modifies RequestManager.send to prefer to use provider.request() when available, otherwise falling back to sendAsync and send.

To learn more, see EIP-1193.

Type of change

  • EIP-1193 functionality (non-breaking change)

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 dtslint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success.
  • 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 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.

@ryanio ryanio added 1.x 1.0 related issues EIP-1193 labels Jul 7, 2020
@ryanio ryanio marked this pull request as draft July 7, 2020 20:10
@coveralls
Copy link

coveralls commented Jul 7, 2020

Coverage Status

Coverage increased (+0.09%) to 90.254% when pulling 397f28a on use-provider-request into 10b7365 on 1.x.

@ryanio ryanio marked this pull request as ready for review July 8, 2020 16:36
Copy link
Collaborator

@cgewecke cgewecke left a comment

Choose a reason for hiding this comment

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

Looks solid! Good work. 🥇

assert.equal(error.message, 'Provider does not have a request or send method to use.');
}
});
});
Copy link
Collaborator

@cgewecke cgewecke Jul 8, 2020

Choose a reason for hiding this comment

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

Nice tests 💯

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks!

@ryanio ryanio merged commit 8c94ca8 into 1.x Jul 8, 2020
@ryanio ryanio mentioned this pull request Jul 9, 2020
14 tasks
@GregTheGreek GregTheGreek deleted the use-provider-request branch July 26, 2020 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants