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 option for fallback RPC URLs #44

Merged
merged 3 commits into from
Mar 29, 2022

Conversation

arimgibson
Copy link
Contributor

Solves #22

  • Change JsonRPCProvider to accept string or array of strings
  • Convert JsonRPCProvider input into array of strings
  • Init rpcUrlCounter var to track which URLs in array have been called
  • Update Contract.ts to expect array and accept fallback

Solves #22
* Change JsonRPCProvider to accept string or array of strings
* Convert JsonRPCProvider input into array of strings
* Init rpcUrlCounter var to track which URLs in array have been called
* Update Contract.ts to expect array and accept fallback
@dawsbot
Copy link
Owner

dawsbot commented Mar 29, 2022

Incredible PR! At quick glance this appears ready to merge already 🙌

I've got to take a bit to resolve the CI tests and package-lock diff, but this should be quick on my end and we'll get this merged :)

returnTransactionObjects,
]),
).catch((e) => {
if (e.code === 'ENOTFOUND') {
Copy link
Owner

Choose a reason for hiding this comment

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

It seems like this could be DRY'd up since all our requests are passing through this same post function.

TODO after this is merged 👌

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking about that but wasn't sure what the best approach would be. I'll dive into the post function more; wasn't sure of everything that depends on it. My first instinct was to create a new handler function, but I think it would've been impractical. My thought was that it would've had to pass in the _rpcUrlCounter, get(), and catch error, and then also return an incremented counter value

Copy link
Owner

@dawsbot dawsbot left a comment

Choose a reason for hiding this comment

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

👌

@dawsbot dawsbot merged commit c0646d2 into master Mar 29, 2022
@dawsbot dawsbot deleted the feature/fallback-urls-jsonrpcprovider branch March 29, 2022 06:01
dawsbot added a commit that referenced this pull request Apr 3, 2022
@dawsbot dawsbot mentioned this pull request Apr 3, 2022
dawsbot added a commit that referenced this pull request Apr 3, 2022
* revert #44

* extend jest timeout
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.

2 participants