Skip to content

Commit c5fe40b

Browse files
committed
fix build
1 parent beac7f4 commit c5fe40b

File tree

2 files changed

+21
-27
lines changed

2 files changed

+21
-27
lines changed

crates/anvil-polkadot/src/cmd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl NodeArgs {
150150
})
151151
.with_eth_rpc_url(self.evm.fork_url.map(|fork| fork.url))
152152
.fork_request_timeout(self.evm.fork_request_timeout.map(Duration::from_millis))
153-
.fork_request_retries(self.evm.fork_request_retries);
153+
.fork_request_retries(self.evm.fork_request_retries)
154154
// for my testing
155155
.with_fork_block_hash(self.fork.fork_block_hash);
156156

crates/anvil-polkadot/src/substrate_node/service/mod.rs

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -91,30 +91,24 @@ async fn resolve_fork_hash_http(client: &HttpClient, fork_block_hash: Option<Str
9191
Ok(res)
9292
}
9393

94-
async fn fetch_para_id(url: String) -> eyre::Result<u32> {
95-
// Connect to the node (adjust URL for your local foundry-polkadot/anvil-polkadot node)
96-
// let ws_url = "ws://127.0.0.1:9944"; // or appropriate RPC/WS endpoint
97-
let api = OnlineClient::<PolkadotConfig>::from_url(url).await?;
98-
99-
// Name of runtime API – check your runtime’s implementation, but typical is something like:
100-
let api_name = "ParachainInfo_parachainId";
101-
102-
// Call the runtime API at the latest block (None)
103-
let para_id: u32 = api
104-
.rpc()
105-
.call_runtime_api(api_name, None, ())
106-
.await?;
94+
// async fn fetch_para_id(url: String) -> eyre::Result<u32> {
95+
// // Connect to the node (adjust URL for your local foundry-polkadot/anvil-polkadot node)
96+
// // let ws_url = "ws://127.0.0.1:9944"; // or appropriate RPC/WS endpoint
97+
// let api = OnlineClient::<PolkadotConfig>::from_url(url).await?;
10798

108-
println!("Parachain ID: {}", para_id);
109-
Ok(())
110-
}
99+
// // Name of runtime API – check your runtime’s implementation, but typical is something like:
100+
// let api_name = "ParachainInfo_parachainId";
111101

112-
async fn fetch_methods(client: &HttpClient) -> eyre::Result<u32> {
113-
let res: String = client.request("system_chain", rpc_params![]).await?;
114-
print!("methods {:#?}", res);
115-
Ok(0)
102+
// // Call the runtime API at the latest block (None)
103+
// let para_id: u32 = api
104+
// .rpc()
105+
// .call_runtime_api(api_name, None, ())
106+
// .await?;
107+
108+
// println!("Parachain ID: {}", para_id);
109+
// Ok(())
110+
// }
116111

117-
}
118112

119113
async fn fetch_sync_spec_http(client: &HttpClient, at_hex_opt: Option<String>) -> eyre::Result<Vec<u8>> {
120114
let pb = ProgressBar::new_spinner();
@@ -343,9 +337,9 @@ pub fn new(
343337
anvil_config: &AnvilNodeConfig,
344338
mut config: Configuration,
345339
) -> Result<(Service, TaskManager), ServiceError> {
346-
let c;
340+
//let c;
347341
//let mut para_id = 0;
348-
if let Some(ref fork_url) = anvil_config.fork_url {
342+
if let Some(ref fork_url) = anvil_config.eth_rpc_url {
349343
let http_url = fork_url.clone();
350344
let fork_block_hash = anvil_config.fork_block_hash.clone();
351345
let spec_or_top = std::thread::spawn(move || -> eyre::Result<Result<Vec<u8>, Map<String, Value>>> {
@@ -363,7 +357,7 @@ pub fn new(
363357
let at_hex = resolve_fork_hash_http(&http, fork_block_hash).await?;
364358
// fetch_methods(&http).await;
365359
// let id = fetch_methods(&http).await?;
366-
fetch_para_id(fork_url).await?;
360+
// fetch_para_id(fork_url).await?;
367361
// para_id = id;
368362
let try_sync = fetch_sync_spec_http(&http, Some(at_hex.clone())).await;
369363
match try_sync {
@@ -386,12 +380,12 @@ pub fn new(
386380
sc_chain_spec::GenericChainSpec::from_json_bytes(spec_bytes)
387381
.map_err(|e| ServiceError::Other(format!("from_json_bytes failed: {e}")))?;
388382
config.chain_spec = Box::new(new_spec);
389-
c = new_spec;
383+
// c = new_spec;
390384

391385
}
392386
Err(top_map) => {
393387
config.chain_spec = build_forked_chainspec_from_raw_top(top_map)?;
394-
c = build_forked_chainspec_from_raw_top(top_map)?;
388+
// c = build_forked_chainspec_from_raw_top(top_map)?;
395389
}
396390
}
397391
}

0 commit comments

Comments
 (0)