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

refactor: integrate FailoverProvider #1263

Merged
merged 5 commits into from
Oct 15, 2024
Merged

refactor: integrate FailoverProvider #1263

merged 5 commits into from
Oct 15, 2024

Conversation

jtourkos
Copy link
Collaborator

No description provided.

Copy link

railway-app bot commented Oct 14, 2024

🚅 Previously deployed to Railway in the Drips App project. Environment has been deleted.

} else if (provider === 'alchemy') {
const alchemyKey = getOptionalEnvVar('ALCHEMY_KEY');
assert(alchemyKey, 'ALCHEMY_KEY is required');
rpcUrl = `https://${alchemyNetworkMap[network as keyof typeof alchemyNetworkMap]}.g.alchemy.com/v2/${alchemyKey}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

The typecast here could be unsafe if provider is alchemy but network is filecoin-mainnet. Generally I think typecasting should be avoided unless absolutely necessary. I would assert explicitly here that network is included in alchemyNetworkMap

Copy link
Contributor

Choose a reason for hiding this comment

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

oh also, i think the entire block would be neater as a switch statement

.env.template Outdated
Comment on lines 4 to 9
# Optional Infura key.
INFURA_KEY=string
# Optional Alchemy key.
ALCHEMY_KEY=string
# Optional Filecoin key.
FILECOIN_KEY=string
Copy link
Contributor

Choose a reason for hiding this comment

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

could you just add a sentence explaining that values for at least one of the providers are required?

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