-
Notifications
You must be signed in to change notification settings - Fork 36
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
Paul/add pokt #610
Paul/add pokt #610
Conversation
src/ethereum/EthereumNetwork.ts
Outdated
if (typeof apiKey === 'string') { | ||
url = url.replace(match[0], apiKey) | ||
} else { | ||
throw new Error('Incorrect apikey type for RPC') |
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.
If the apiKey
is one of the values in initOptions
of cleanKey
, and if cleanKey
is a key in the initOptions
, then the error message should state something like:
`Missing ${apiKey} in 'initOptions' for ${pluginId}`
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.
apiKey can also be an array, that's what this clause was meant to catch. But i'll add another for the case of null
54b8c91
to
63a8996
Compare
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.
One more thing
} else if (apiKey == null) { | ||
throw new Error( | ||
`Missing ${cleanKey} in 'initOptions' for ${this.ethEngine.currencyInfo.pluginId}` | ||
) | ||
} else { | ||
throw new Error('Incorrect apikey type for RPC') |
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 looked at the type for apiKey
and it looks like it could be an array of strings. Shouldn't we handle this case for evmScanApiKey
? Maybe a simple random pick of one the keys
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.
No. Evmscan servers are not an RPC servers but a completely different "type". This PR is only for RPC servers and I don't want to scope creep the PR. That would also require another hour of testing.
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.
Ah, didn’t catch that difference. Thanks for correcting me here
63a8996
to
92d1d39
Compare
/rebase |
92d1d39
to
066db4d
Compare
066db4d
to
b16faaa
Compare
CHANGELOG
added: Pokt network RPC servers
Dependencies
noneDescription
none