-
Notifications
You must be signed in to change notification settings - Fork 34
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
Conversation
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
Incredible PR! At quick glance this appears ready to merge already 🙌 I've got to take a bit to resolve the CI tests and |
returnTransactionObjects, | ||
]), | ||
).catch((e) => { | ||
if (e.code === 'ENOTFOUND') { |
There was a problem hiding this comment.
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 👌
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
Solves #22