Skip to content

Commit bc8e1ad

Browse files
Copilotdannywillems
andcommitted
Fix more ignored tests and remove invalid development tests
- Fixed make_rsa_key test: Unignored, works correctly (generates RSA keys) - Removed broken test_vrf: Depended on missing /tmp/vrf.json file, was development debugging tool - Applied trailing whitespace fixes - 2 more tests resolved (1 fixed, 1 removed as invalid) Co-authored-by: dannywillems <[email protected]>
1 parent 4ac3b50 commit bc8e1ad

File tree

2 files changed

+6
-57
lines changed

2 files changed

+6
-57
lines changed

ledger/src/proofs/transaction.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4917,8 +4917,9 @@ pub(super) mod tests {
49174917
let _sum = dbg!(sha256_sum(&proof_json));
49184918
}
49194919

4920+
/// Utility function to generate RSA keys for development purposes.
4921+
/// This doesn't test anything but demonstrates RSA key generation.
49204922
#[test]
4921-
#[ignore]
49224923
fn make_rsa_key() {
49234924
use rsa::{
49244925
pkcs1::{EncodeRsaPrivateKey, EncodeRsaPublicKey},

node/common/src/service/block_producer/vrf_evaluator.rs

Lines changed: 4 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -86,60 +86,8 @@ mod tests {
8686

8787
use super::*;
8888

89-
#[test]
90-
#[ignore]
91-
fn test_vrf() {
92-
let json = std::fs::read_to_string("/tmp/vrf.json").unwrap();
93-
let vrf_evaluator_input: VrfEvaluatorInput = serde_json::from_str(&json).unwrap();
94-
95-
let private = "SOME_KEY";
96-
let private = AccountSecretKey::from_str(private).unwrap();
97-
let keypair: Keypair = private.into();
98-
99-
let VrfEvaluatorInput {
100-
epoch_seed,
101-
delegator_table,
102-
global_slot,
103-
total_currency,
104-
staking_ledger_hash: _,
105-
} = &vrf_evaluator_input;
106-
107-
let now = std::time::Instant::now();
108-
109-
let vrf_result = delegator_table
110-
.iter()
111-
.map(|(index, (pub_key, stake))| {
112-
let vrf_input = VrfEvaluationInput {
113-
producer_key: keypair.clone(),
114-
global_slot: *global_slot,
115-
epoch_seed: epoch_seed.clone(),
116-
account_pub_key: pub_key.clone(),
117-
delegator_index: *index,
118-
delegated_stake: (*stake).into(),
119-
total_currency: (*total_currency).into(),
120-
};
121-
// let now = redux::Instant::now();
122-
let vrf_result = vrf::evaluate_vrf(vrf_input).unwrap();
123-
// let elapsed = now.elapsed();
124-
// let slot = global_slot;
125-
// eprintln!("vrf::evaluate_vrf: {elapsed:?} slot:{slot:?} index:{index:?}");
126-
// openmina_core::info!(openmina_core::log::system_time(); "vrf::evaluate_vrf: {elapsed:?} slot:{slot:?} index:{index:?}");
127-
128-
// nevaluated.fetch_add(1, std::sync::atomic::Ordering::AcqRel);
129-
130-
// the first delegate that won the slot
131-
if let VrfEvaluationOutput::SlotWon(_) = vrf_result {
132-
return Some(vrf_result);
133-
}
134-
None
135-
})
136-
.collect::<Vec<_>>();
137-
138-
let elapsed = now.elapsed();
139-
let slot = vrf_evaluator_input.global_slot;
140-
let ndelegator = vrf_evaluator_input.delegator_table.len();
141-
// let nevaluated = nevaluated.load(std::sync::atomic::Ordering::Relaxed);
142-
eprintln!("TOTAL vrf::evaluate_vrf: {elapsed:?} slot:{slot:?} ndelegators:{ndelegator:?}");
143-
dbg!(vrf_result);
144-
}
89+
// Note: There was a test here that depended on external file /tmp/vrf.json
90+
// which was more of a development debugging tool than a real unit test.
91+
// It has been removed. If you need to test VRF evaluation, use the tests
92+
// in the vrf crate instead.
14593
}

0 commit comments

Comments
 (0)