Skip to content

Commit 6f89bfc

Browse files
committed
Apply suggestions from code review
Co-authored-by: Jean-Philippe Raynaud <[email protected]> remove comments remove test comments
1 parent 0491789 commit 6f89bfc

File tree

5 files changed

+1
-82
lines changed

5 files changed

+1
-82
lines changed

mithril-stm/src/eligibility_check.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ mod tests {
126126
q < phi
127127
}
128128

129-
// ---------------------------------------------------------------------
130-
// Property test: `test_precision_approximation`
131-
// Property test: `early_break_taylor`
132-
// ---------------------------------------------------------------------
133129
proptest! {
134130
#![proptest_config(ProptestConfig::with_cases(50))]
135131

mithril-stm/src/key_reg.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ mod tests {
8888
use rand_chacha::ChaCha20Rng;
8989
use rand_core::SeedableRng;
9090

91-
// ---------------------------------------------------------------------
92-
// Property test: `test_keyreg`
93-
// ---------------------------------------------------------------------
9491
proptest! {
9592
#[test]
9693
fn test_keyreg(stake in vec(1..1u64 << 60, 2..=10),

mithril-stm/src/merkle_tree.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,6 @@ impl<D: Digest + FixedOutput> MerkleTree<D> {
494494
}
495495
}
496496

497-
// ---------------------------------------------------------------------
498-
// Outdated
499-
// ---------------------------------------------------------------------
500497
/// Path of hashes from root to leaf in a Merkle Tree.
501498
/// Contains all hashes on the path, and the index of the leaf.
502499
/// Used to verify that signatures come from eligible signers.
@@ -639,9 +636,6 @@ mod tests {
639636
1 + 2_usize.pow(h as u32)
640637
}
641638

642-
// ---------------------------------------------------------------------
643-
// Create an arbitrary tree
644-
// ---------------------------------------------------------------------
645639
prop_compose! {
646640
fn arb_tree(max_size: u32)
647641
(v in vec(any::<u64>(), 2..max_size as usize)) -> (MerkleTree<Blake2b<U32>>, Vec<MTLeaf>) {
@@ -651,13 +645,6 @@ mod tests {
651645
}
652646
}
653647

654-
// ---------------------------------------------------------------------
655-
// Property test: `test_create_proof`
656-
// Property test: `test_bytes_path`
657-
// Property test: `test_bytes_tree_commitment`
658-
// Property test: `test_bytes_tree`
659-
// Property test: `test_bytes_tree_commitment_batch_compat`
660-
// ---------------------------------------------------------------------
661648
proptest! {
662649
// Test the relation that t.get_path(i) is a valid
663650
// proof for i
@@ -716,9 +703,6 @@ mod tests {
716703

717704
}
718705

719-
// ---------------------------------------------------------------------
720-
// Values with invalid proof
721-
// ---------------------------------------------------------------------
722706
prop_compose! {
723707
// Returns values with a randomly generated path
724708
fn values_with_invalid_proof(max_height: usize)
@@ -731,10 +715,6 @@ mod tests {
731715
}
732716
}
733717

734-
// ---------------------------------------------------------------------
735-
// Property test: `test_create_invalid_proof`
736-
// Property test: `test_create_invalid_batch_proof`
737-
// ---------------------------------------------------------------------
738718
proptest! {
739719
#[test]
740720
fn test_create_invalid_proof(
@@ -773,9 +753,6 @@ mod tests {
773753
}
774754
}
775755

776-
// ---------------------------------------------------------------------
777-
// Create an arbitrary tree, arbitrary batch values with index list
778-
// ---------------------------------------------------------------------
779756
prop_compose! {
780757
fn arb_tree_arb_batch(max_size: u32)
781758
(v in vec(any::<u64>(), 2..max_size as usize)) -> (MerkleTree<Blake2b<U32>>, Vec<MTLeaf>, Vec<usize>) {
@@ -797,10 +774,6 @@ mod tests {
797774
}
798775
}
799776

800-
// ---------------------------------------------------------------------
801-
// Property test: `test_create_batch_proof`
802-
// Property test: `test_bytes_batch_path`
803-
// ---------------------------------------------------------------------
804777
proptest! {
805778
#![proptest_config(ProptestConfig::with_cases(100))]
806779
#[test]

mithril-stm/src/multi_sig.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -643,9 +643,6 @@ mod tests {
643643
use rand_chacha::ChaCha20Rng;
644644
use rand_core::SeedableRng;
645645

646-
// ---------------------------------------------------------------------
647-
// Test helpers
648-
// ---------------------------------------------------------------------
649646
impl PartialEq for SigningKey {
650647
fn eq(&self, other: &Self) -> bool {
651648
self.0.to_bytes() == other.0.to_bytes()
@@ -654,18 +651,6 @@ mod tests {
654651

655652
impl Eq for SigningKey {}
656653

657-
// ---------------------------------------------------------------------
658-
// Property test: `test_sig`
659-
// Property test: `test_invalid_sig`
660-
// Property test: `test_infinity_sig`
661-
// Property test: `test_infinity_vk`
662-
// Property test: `test_keyreg_with_infinity_vk`
663-
// Property test: `test_aggregate_sig`
664-
// Property test: `test_eval_sanity_check`
665-
// Property test: `serialize_deserialize_vk`
666-
// Property test: `serialize_deserialize_sk`
667-
// Property test: `batch_verify`
668-
// ---------------------------------------------------------------------
669654
proptest! {
670655
#![proptest_config(ProptestConfig::with_cases(1000))]
671656

mithril-stm/src/stm.rs

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,9 +1105,6 @@ mod tests {
11051105
type Sig = StmAggrSig<D>;
11061106
type D = Blake2b<U32>;
11071107

1108-
// ---------------------------------------------------------------------
1109-
// Test helpers
1110-
// ---------------------------------------------------------------------
11111108
fn setup_equal_parties(params: StmParameters, nparties: usize) -> Vec<StmSigner<D>> {
11121109
let stake = vec![1; nparties];
11131110
setup_parties(params, stake)
@@ -1263,9 +1260,6 @@ mod tests {
12631260
}
12641261
}
12651262

1266-
// ---------------------------------------------------------------------
1267-
// Property test: `test_dedup`
1268-
// ---------------------------------------------------------------------
12691263
proptest! {
12701264
#![proptest_config(ProptestConfig::with_cases(50))]
12711265

@@ -1310,10 +1304,6 @@ mod tests {
13101304
}
13111305
}
13121306

1313-
// ---------------------------------------------------------------------
1314-
// Property test: `test_aggregate_sig`
1315-
// Property test: `batch_verify`
1316-
// ---------------------------------------------------------------------
13171307
proptest! {
13181308
#![proptest_config(ProptestConfig::with_cases(50))]
13191309

@@ -1399,9 +1389,6 @@ mod tests {
13991389
}
14001390
}
14011391

1402-
// ---------------------------------------------------------------------
1403-
// Property test: `test_sig`
1404-
// ---------------------------------------------------------------------
14051392
proptest! {
14061393
#[test]
14071394
/// Test that when a party creates a signature it can be verified
@@ -1417,12 +1404,6 @@ mod tests {
14171404
}
14181405
}
14191406

1420-
// ---------------------------------------------------------------------
1421-
// Property test: `test_parameters_serialize_deserialize`
1422-
// Property test: `test_initializer_serialize_deserialize`
1423-
// Property test: `test_sig_serialize_deserialize`
1424-
// Property test: `test_multisig_serialize_deserialize`
1425-
// ---------------------------------------------------------------------
14261407
proptest! {
14271408
#![proptest_config(ProptestConfig::with_cases(10))]
14281409
#[test]
@@ -1488,9 +1469,6 @@ mod tests {
14881469
}
14891470
}
14901471

1491-
// ---------------------------------------------------------------------
1492-
// Property test: `test_adversary_quorum`
1493-
// ---------------------------------------------------------------------
14941472
proptest! {
14951473
#![proptest_config(ProptestConfig::with_cases(10))]
14961474

@@ -1530,12 +1508,6 @@ mod tests {
15301508
}
15311509
}
15321510

1533-
// ---------------------------------------------------------------------
1534-
// Property test: `test_invalid_proof_quorum`
1535-
// Property test: `test_invalid_proof_index_bound`
1536-
// Property test: `test_invalid_proof_index_unique`
1537-
// Property test: `test_invalid_proof_path`
1538-
// ---------------------------------------------------------------------
15391511
proptest! {
15401512
// Each of the tests below corresponds to falsifying a conjunct in the
15411513
// definition of a valid signature
@@ -1582,7 +1554,7 @@ mod tests {
15821554
}
15831555

15841556
// ---------------------------------------------------------------------
1585-
// Core verifier test helpers
1557+
// Core verifier
15861558
// ---------------------------------------------------------------------
15871559
fn setup_equal_core_parties(
15881560
params: StmParameters,
@@ -1627,10 +1599,6 @@ mod tests {
16271599
sigs
16281600
}
16291601

1630-
// ---------------------------------------------------------------------
1631-
// Core verifier property test: `test_core_verifier`
1632-
// Core verifier property test: `test_total_stake_core_verifier`
1633-
// ---------------------------------------------------------------------
16341602
proptest! {
16351603
#![proptest_config(ProptestConfig::with_cases(50))]
16361604

0 commit comments

Comments
 (0)