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

Paul/add pokt #610

Merged
merged 2 commits into from
Sep 1, 2023
Merged

Paul/add pokt #610

merged 2 commits into from
Sep 1, 2023

Conversation

paullinator
Copy link
Member

@paullinator paullinator commented Aug 29, 2023

CHANGELOG

added: Pokt network RPC servers

Dependencies

none

Description

none

if (typeof apiKey === 'string') {
url = url.replace(match[0], apiKey)
} else {
throw new Error('Incorrect apikey type for RPC')
Copy link
Collaborator

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}`

Copy link
Member Author

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

@paullinator paullinator force-pushed the paul/addPokt branch 2 times, most recently from 54b8c91 to 63a8996 Compare August 30, 2023 00:29
Copy link
Collaborator

@samholmes samholmes left a 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')
Copy link
Collaborator

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

Copy link
Member Author

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.

Copy link
Collaborator

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

@paullinator
Copy link
Member Author

/rebase

@paullinator paullinator merged commit a754ba2 into master Sep 1, 2023
3 checks passed
@paullinator paullinator deleted the paul/addPokt branch September 1, 2023 18:32
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