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

Create constants for suported network names #39

Merged
merged 3 commits into from
Sep 30, 2024
Merged

Conversation

marcin-cb
Copy link
Contributor

What changed? Why?

  • Adding constants for supported network names
    • ethereum-holesky
    • ethereum-mainnet
    • solana-devnet
    • solana-mainnet

Qualified Impact

@cb-heimdall
Copy link

cb-heimdall commented Sep 30, 2024

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

EthereumHolesky = "ethereum-holesky"
EthereumMainnet = "ethereum-mainnet"

SolanaDevnet = "solana-devnet"
Copy link
Contributor

@drohit-cb drohit-cb Sep 30, 2024

Choose a reason for hiding this comment

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

should this be string(client.NETWORKIDENTIFIER_SOLANA_DEVNET) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't have a strong preference here, but I was following the same convention from the NodeJS constant setup. It uses strings and does not link back to the API enums.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see the mapping happen here

Basically I would like to rely on the server side constants to define what the network ids need to look like instead of us defining it again here.

Copy link
Contributor Author

@marcin-cb marcin-cb Sep 30, 2024

Choose a reason for hiding this comment

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

Ah I misread that syntax. Yeah you're right. So then we may not need them entirely, however, the way the constants are setup in the generate files, it creates an all caps. So I'll keep them in and do what you suggested initially.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup - the all caps thing is not great - plus its like a separate type - all our functions need a string networkID so doing string(client.NETWORKIDENTIFIER_SOLANA_DEVNET) makes the most sense to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like this idea 👍. I think Rohit's idea to limit the amount of "redefining" we do requires much less maintenance moving forward.

@marcin-cb marcin-cb merged commit 9fde58d into master Sep 30, 2024
5 checks passed
@marcin-cb marcin-cb deleted the marcin/const-updates branch September 30, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants