mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 12:49:23 +00:00
Optimize decoy selection
Saves roughly 0.8s when running the tests, which took 16.6s and now take 15.8 (5%). Removes the larger sample size, which replaced the closest selected decoy with the real spend, per advice of Rucknium.
This commit is contained in:
@@ -25,10 +25,8 @@ pub async fn rpc() -> Rpc {
|
||||
PublicKey { point: (&random_scalar(&mut OsRng) * &ED25519_BASEPOINT_TABLE).compress() }
|
||||
).to_string();
|
||||
|
||||
// Mine enough blocks decoy selection doesn't fail
|
||||
for _ in 0 .. 1 {
|
||||
mine_block(&rpc, &addr).await.unwrap();
|
||||
}
|
||||
// Mine 10 blocks so we have 10 decoys so decoy selection doesn't fail
|
||||
mine_block(&rpc, &addr).await.unwrap();
|
||||
|
||||
rpc
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user