Skip to content

Commit

Permalink
binary-merkle-tree: Do not spam test output (#5376)
Browse files Browse the repository at this point in the history
The CI isn't happy with the amount of output:
https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7035621/raw

---------

Co-authored-by: Shawn Tabrizi <[email protected]>
  • Loading branch information
bkchr and shawntabrizi authored Aug 18, 2024
1 parent feac7a5 commit 3fe22d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
3 changes: 3 additions & 0 deletions prdoc/pr_5376.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
crates:
- name: binary-merkle-tree
bump: none
9 changes: 0 additions & 9 deletions substrate/utils/binary-merkle-tree/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ mod tests {
#[test]
fn should_generate_empty_root() {
// given
sp_tracing::init_for_tests();
let data: Vec<[u8; 1]> = Default::default();

// when
Expand All @@ -372,7 +371,6 @@ mod tests {
#[test]
fn should_generate_single_root() {
// given
sp_tracing::init_for_tests();
let data = vec![array_bytes::hex2array_unchecked::<_, 20>(
"E04CC55ebEE1cBCE552f250e85c57B70B2E2625b",
)];
Expand All @@ -390,7 +388,6 @@ mod tests {
#[test]
fn should_generate_root_pow_2() {
// given
sp_tracing::init_for_tests();
let data = vec![
array_bytes::hex2array_unchecked::<_, 20>("E04CC55ebEE1cBCE552f250e85c57B70B2E2625b"),
array_bytes::hex2array_unchecked::<_, 20>("25451A4de12dcCc2D166922fA938E900fCc4ED24"),
Expand All @@ -408,7 +405,6 @@ mod tests {

#[test]
fn should_generate_root_complex() {
sp_tracing::init_for_tests();
let test = |root, data| {
assert_eq!(array_bytes::bytes2hex("", &merkle_root::<Keccak256, _>(data)), root);
};
Expand Down Expand Up @@ -437,7 +433,6 @@ mod tests {
#[test]
fn should_generate_and_verify_proof_simple() {
// given
sp_tracing::init_for_tests();
let data = vec!["a", "b", "c"];

// when
Expand Down Expand Up @@ -501,7 +496,6 @@ mod tests {
#[test]
fn should_generate_and_verify_proof_complex() {
// given
sp_tracing::init_for_tests();
let data = vec!["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"];

for l in 0..data.len() {
Expand All @@ -521,7 +515,6 @@ mod tests {
#[test]
fn should_generate_and_verify_proof_large() {
// given
sp_tracing::init_for_tests();
let mut data = vec![];
for i in 1..16 {
for c in 'a'..'z' {
Expand All @@ -548,7 +541,6 @@ mod tests {
#[test]
fn should_generate_and_verify_proof_large_tree() {
// given
sp_tracing::init_for_tests();
let mut data = vec![];
for i in 0..6000 {
data.push(format!("{}", i));
Expand All @@ -571,7 +563,6 @@ mod tests {
#[test]
#[should_panic]
fn should_panic_on_invalid_leaf_index() {
sp_tracing::init_for_tests();
merkle_proof::<Keccak256, _, _>(vec!["a"], 5);
}

Expand Down

0 comments on commit 3fe22d1

Please sign in to comment.