Skip to content

Commit

Permalink
feat(providers): adding providers for Mantle and Gnosis chains (#819)
Browse files Browse the repository at this point in the history
* feat(providers): adding additional providers for the Mantle chain

* feat: adding Gnosis to the publicnode
  • Loading branch information
geekbrother authored Nov 13, 2024
1 parent 0d19985 commit 06e2ae3
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 27 deletions.
8 changes: 8 additions & 0 deletions src/env/infura.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ fn default_supported_chains() -> HashMap<String, (String, Weight)> {
Weight::new(Priority::Normal).unwrap(),
),
),
// Mantle
(
"eip155:5000".into(),
(
"mantle-mainnet".into(),
Weight::new(Priority::Normal).unwrap(),
),
),
])
}

Expand Down
5 changes: 5 additions & 0 deletions src/env/publicnode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ fn default_supported_chains() -> HashMap<String, (String, Weight)> {
Weight::new(Priority::Normal).unwrap(),
),
),
// Gnosis Chain mainnet
(
"eip155:100".into(),
("gnosis-rpc".into(), Weight::new(Priority::Normal).unwrap()),
),
// Bitcoin mainnet
(
"bip122:000000000019d6689c085ae165831e93".into(),
Expand Down
49 changes: 22 additions & 27 deletions tests/functional/http/infura.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,32 @@ use {
#[tokio::test]
#[ignore]
async fn infura_provider(ctx: &mut ServerContext) {
let provider = ProviderKind::Infura;
// Ethereum mainnet
check_if_rpc_is_responding_correctly_for_supported_chain(
ctx,
&ProviderKind::Infura,
"eip155:1",
"0x1",
)
.await;
check_if_rpc_is_responding_correctly_for_supported_chain(ctx, &provider, "eip155:1", "0x1")
.await;

// Ethereum Sepolia
check_if_rpc_is_responding_correctly_for_supported_chain(
ctx,
&ProviderKind::Infura,
&provider,
"eip155:11155111",
"0xaa36a7",
)
.await;

// Polgyon mainnet
check_if_rpc_is_responding_correctly_for_supported_chain(
ctx,
&ProviderKind::Infura,
"eip155:137",
"0x89",
)
.await;
check_if_rpc_is_responding_correctly_for_supported_chain(ctx, &provider, "eip155:137", "0x89")
.await;

// Optimism mainnet
check_if_rpc_is_responding_correctly_for_supported_chain(
ctx,
&ProviderKind::Infura,
"eip155:10",
"0xa",
)
.await;
check_if_rpc_is_responding_correctly_for_supported_chain(ctx, &provider, "eip155:10", "0xa")
.await;

// Optimism Sepolia
check_if_rpc_is_responding_correctly_for_supported_chain(
ctx,
&ProviderKind::Infura,
&provider,
"eip155:11155420",
"0xaa37dc",
)
Expand All @@ -55,7 +41,7 @@ async fn infura_provider(ctx: &mut ServerContext) {
// Arbitrum mainnet
check_if_rpc_is_responding_correctly_for_supported_chain(
ctx,
&ProviderKind::Infura,
&provider,
"eip155:42161",
"0xa4b1",
)
Expand All @@ -64,7 +50,7 @@ async fn infura_provider(ctx: &mut ServerContext) {
// Arbitrum Sepolia
check_if_rpc_is_responding_correctly_for_supported_chain(
ctx,
&ProviderKind::Infura,
&provider,
"eip155:421614",
"0x66eee",
)
Expand All @@ -73,7 +59,7 @@ async fn infura_provider(ctx: &mut ServerContext) {
// Celo
check_if_rpc_is_responding_correctly_for_supported_chain(
ctx,
&ProviderKind::Infura,
&provider,
"eip155:42220",
"0xa4ec",
)
Expand All @@ -82,9 +68,18 @@ async fn infura_provider(ctx: &mut ServerContext) {
// Linea Mainnet
check_if_rpc_is_responding_correctly_for_supported_chain(
ctx,
&ProviderKind::Infura,
&provider,
"eip155:59144",
"0xe708",
)
.await;

// Mantle Mainnet
check_if_rpc_is_responding_correctly_for_supported_chain(
ctx,
&provider,
"eip155:5000",
"0x1388",
)
.await;
}
4 changes: 4 additions & 0 deletions tests/functional/http/publicnode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ async fn publicnode_provider(ctx: &mut ServerContext) {
"0x8274f",
)
.await;

// Gnosis
check_if_rpc_is_responding_correctly_for_supported_chain(ctx, &provider, "eip155:100", "0x64")
.await;
}

#[test_context(ServerContext)]
Expand Down

0 comments on commit 06e2ae3

Please sign in to comment.