Skip to content

Commit

Permalink
fix(providers): unifying Solana chain_id (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
geekbrother authored Jan 23, 2024
1 parent dcddb88 commit 9100ab7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
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

0 comments on commit 9100ab7

Please sign in to comment.