mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-12-22 11:39:30 +00:00
fixes
This commit is contained in:
parent
7cd3254477
commit
8acb166639
5 changed files with 12 additions and 11 deletions
|
@ -163,6 +163,7 @@ pretty_assertions = { version = "1" }
|
||||||
proptest = { version = "1" }
|
proptest = { version = "1" }
|
||||||
proptest-derive = { version = "0.5" }
|
proptest-derive = { version = "0.5" }
|
||||||
tokio-test = { version = "0.4" }
|
tokio-test = { version = "0.4" }
|
||||||
|
reqwest = { version = "0.12" }
|
||||||
|
|
||||||
## TODO:
|
## TODO:
|
||||||
## Potential dependencies.
|
## Potential dependencies.
|
||||||
|
|
|
@ -9,7 +9,7 @@ hex = { workspace = true, features = ["serde", "std"] }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
serde_json = { workspace = true, features = ["std"] }
|
serde_json = { workspace = true, features = ["std"] }
|
||||||
tokio = { workspace = true, features = ["full"] }
|
tokio = { workspace = true, features = ["full"] }
|
||||||
reqwest = { version = "0.12", features = ["json"] }
|
reqwest = { workspace = true, features = ["json"] }
|
||||||
rayon = { workspace = true }
|
rayon = { workspace = true }
|
||||||
futures = { workspace = true, features = ["std"] }
|
futures = { workspace = true, features = ["std"] }
|
||||||
|
|
||||||
|
|
|
@ -256,12 +256,12 @@ impl RpcClient {
|
||||||
assert_eq!(reward, block_reward, "{info}");
|
assert_eq!(reward, block_reward, "{info}");
|
||||||
assert_eq!(timestamp, block.header.timestamp, "{info}");
|
assert_eq!(timestamp, block.header.timestamp, "{info}");
|
||||||
|
|
||||||
let block_count = TESTED_BLOCK_COUNT.fetch_add(1, Ordering::Release) + 1;
|
let progress = TESTED_BLOCK_COUNT.fetch_add(1, Ordering::Release) + 1;
|
||||||
let tx_count = TESTED_TX_COUNT.fetch_add(num_txes, Ordering::Release) + 1;
|
let tx_count = TESTED_TX_COUNT.fetch_add(num_txes, Ordering::Release) + 1;
|
||||||
let percent = (block_count as f64 / top_height as f64) * 100.0;
|
let percent = (progress as f64 / top_height as f64) * 100.0;
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
"block_count | {block_count}/{top_height} ({percent:.2}%)
|
"progress | {progress}/{top_height} ({percent:.2}%)
|
||||||
tx_count | {tx_count}
|
tx_count | {tx_count}
|
||||||
hash | {}
|
hash | {}
|
||||||
miner_tx_hash | {}
|
miner_tx_hash | {}
|
||||||
|
|
|
@ -14,7 +14,7 @@ hex = { workspace = true, features = ["serde", "std"] }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
serde_json = { workspace = true, features = ["std"] }
|
serde_json = { workspace = true, features = ["std"] }
|
||||||
tokio = { workspace = true, features = ["full"] }
|
tokio = { workspace = true, features = ["full"] }
|
||||||
reqwest = { version = "0.12", features = ["json"] }
|
reqwest = { workspace = true, features = ["json"] }
|
||||||
rayon = { workspace = true }
|
rayon = { workspace = true }
|
||||||
randomx-rs = { workspace = true }
|
randomx-rs = { workspace = true }
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ impl RpcClient {
|
||||||
});
|
});
|
||||||
|
|
||||||
let top_height = client
|
let top_height = client
|
||||||
.get(&rpc_url)
|
.get(format!("{rpc_url}/json_rpc"))
|
||||||
.json(&request)
|
.json(&request)
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
|
@ -103,7 +103,9 @@ impl RpcClient {
|
||||||
"params": {"height": height, "fill_pow_hash": true}
|
"params": {"height": height, "fill_pow_hash": true}
|
||||||
});
|
});
|
||||||
|
|
||||||
tokio::task::spawn(self.client.get(&self.rpc_url).json(&request).send())
|
let rpc_url = format!("{}/json_rpc", self.rpc_url);
|
||||||
|
|
||||||
|
tokio::task::spawn(self.client.get(rpc_url).json(&request).send())
|
||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -169,16 +171,14 @@ impl RpcClient {
|
||||||
|
|
||||||
let count = TESTED_BLOCK_COUNT.fetch_add(1, Ordering::Release) + 1;
|
let count = TESTED_BLOCK_COUNT.fetch_add(1, Ordering::Release) + 1;
|
||||||
|
|
||||||
let hex_header = hex::encode(header.pow_hash);
|
let hash = hex::encode(pow_hash);
|
||||||
let hex_hash = hex::encode(pow_hash);
|
|
||||||
let percent = (count as f64 / top_height as f64) * 100.0;
|
let percent = (count as f64 / top_height as f64) * 100.0;
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
"progress | {count}/{top_height} ({percent:.2}%)
|
"progress | {count}/{top_height} ({percent:.2}%)
|
||||||
height | {height}
|
height | {height}
|
||||||
algo | {name}
|
algo | {name}
|
||||||
header | {hex_header}
|
hash | {hash}\n"
|
||||||
hash | {hex_hash}\n"
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue