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

fix(providers): unifying Solana chain_id #486

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SUPPORTED_CHAINS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Chain name with associated `chainId` query param to use.
- zkSync Era Testnet (`eip155:280`)
- Near (`near`)
- Gnosis Chain (`eip155:100`)
- Solana (`solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz` or `solana-mainnet`)
- Solana Mainnet (`solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz`)
- Base (`eip155:8453`)
- Base Goerli (`eip155:84531`)
- Zora (`eip155:7777777`)
Expand Down
6 changes: 2 additions & 4 deletions src/env/omnia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,9 @@ fn default_supported_chains() -> HashMap<String, (String, Weight)> {
"eip155:10".into(),
("op".into(), Weight::new(Priority::Normal).unwrap()),
),
// Solana
// Solana Mainnet
(
// TODO: consider changing from `solana-mainnet` to
// `solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz` like Pokt provider
"solana-mainnet".into(),
"solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz".into(),
("sol".into(), Weight::new(Priority::Normal).unwrap()),
),
// Avalanche C chain
Expand Down
8 changes: 7 additions & 1 deletion src/handlers/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ async fn handler_internal(
.validate_project_access_and_quota(&query_params.project_id)
.await?;

let chain_id = query_params.chain_id.to_lowercase();
// TODO: Remove the `solana-mainnet` chain_id alias for
// `solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz` when ready
let chain_id = if query_params.chain_id.to_lowercase() == "solana-mainnet" {
"solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz".to_string()
} else {
query_params.chain_id.to_lowercase()
};

let provider = state
.providers
Expand Down