Skip to content

Conversation

@jacobmakarsky
Copy link
Contributor

Problem

Solution

  • Use pollingInterval in FallbackProvider creation
  • Do not allow WebSocketProvider in FallbackProvider creation

const providerURL = config.provider;
// Ensure providerURL exists and is a string
if (!isDefined(providerURL)) {
throw new Error('provider is required for single provider configuration');
Copy link
Contributor

Choose a reason for hiding this comment

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

Just as a reminder, lets try to make this errors look similar to #38

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you provide an example? Not clear what change is being asked for

} catch (cause) {
if (!(cause instanceof Error)) {
throw new Error(
'Non-error thrown from createFallbackProviderFromJsonConfig',
Copy link
Contributor

Choose a reason for hiding this comment

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

Might this be a typo!? this error message is createFallbackProviderFromJsonConfig, but the function is named createProviderFromJsonConfig, is this intended ?

@@ -0,0 +1,117 @@
import { FallbackProvider, JsonRpcProvider, WebSocketProvider } from 'ethers';
import { FallbackProviderConfig } from 'ethers/lib.commonjs/providers/provider-fallback';
Copy link
Contributor

Choose a reason for hiding this comment

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

I've did not notice we were importing this type from the internal structure of ethers!, given that any update on this might be a breaking change for us, is there any better way we can handle this type ? Mirroring this type with an interface of ours probably ?? or inferring the type.. idk 🤣

Copy link
Contributor

@bhflm bhflm left a comment

Choose a reason for hiding this comment

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

Overall looks good to me, just some comments regarding types imports and misc things

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.

3 participants