Skip to content

Commit 5a8fef9

Browse files
fix(probe): keep Ethereum probeable through the inspector registry
Main gained an Ethereum inspector while this branch was replacing the chain match with a registry, so the two met with Ethereum missing from the registry, the RpcInspector enum and both of its dispatches. The registry gap compiles and simply stops probing Ethereum. Also repoints Ethereum's manual test at foreign-chain-rpc-client, which now builds the HTTP clients.
1 parent eebadc3 commit 5a8fef9

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

crates/foreign-chain-health-check/src/probe.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ fn find_inspector_builder(chain: ForeignChain) -> Option<InspectorBuilder> {
181181
timeout_of(chain_config),
182182
)?)))
183183
},
184-
// Ethereum, Solana and Ton have no inspector to probe them with.
184+
// Solana and Ton have no inspector to probe them with.
185185
_ => return None,
186186
})
187187
}
@@ -241,6 +241,7 @@ impl NetworkFingerprintInspector for RpcInspector {
241241
Self::Avalanche(inspector) => inspector.canonical_fingerprint(fingerprint),
242242
Self::Base(inspector) => inspector.canonical_fingerprint(fingerprint),
243243
Self::Bnb(inspector) => inspector.canonical_fingerprint(fingerprint),
244+
Self::Ethereum(inspector) => inspector.canonical_fingerprint(fingerprint),
244245
Self::HyperEvm(inspector) => inspector.canonical_fingerprint(fingerprint),
245246
Self::Polygon(inspector) => inspector.canonical_fingerprint(fingerprint),
246247
Self::Bitcoin(inspector) => inspector.canonical_fingerprint(fingerprint),

crates/foreign-chain-inspector/tests/ethereum_rpc_manual.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
use assert_matches::assert_matches;
22
use foreign_chain_inspector::{
3-
EthereumFinality, ForeignChainInspector, NetworkFingerprintInspector, RpcAuthentication,
3+
EthereumFinality, ForeignChainInspector, NetworkFingerprintInspector,
44
ethereum::{
55
EthereumBlockHash, EthereumTransactionHash, MAINNET_CHAIN_ID,
66
inspector::{EthereumExtractedValue, EthereumExtractor, EthereumInspector},
77
},
88
};
9+
use foreign_chain_rpc_client::RpcAuthentication;
910

1011
const ETHEREUM_RPC_URL: &str = "https://ethereum-rpc.publicnode.com";
1112

@@ -26,7 +27,7 @@ async fn inspector_extracts_block_hash_against_live_rpc_provider() {
2627
.parse()
2728
.unwrap();
2829

29-
let http_client = foreign_chain_inspector::build_http_client(
30+
let http_client = foreign_chain_rpc_client::build_http_client(
3031
ETHEREUM_RPC_URL.to_string(),
3132
RpcAuthentication::KeyInUrl,
3233
)
@@ -62,7 +63,7 @@ const EXPECTED_NETWORK_FINGERPRINT: u64 = MAINNET_CHAIN_ID;
6263
#[ignore = "manual test to sanity check against live Ethereum RPC provider"]
6364
async fn network_fingerprint_matches_the_shipped_config_value_against_live_rpc_provider() {
6465
// given
65-
let http_client = foreign_chain_inspector::build_http_client(
66+
let http_client = foreign_chain_rpc_client::build_http_client(
6667
ETHEREUM_RPC_URL.to_string(),
6768
RpcAuthentication::KeyInUrl,
6869
)

0 commit comments

Comments
 (0)