Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
faheelsattar committed Dec 31, 2024
1 parent bc6c357 commit d1bd6e7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/rbuilder/src/utils/bls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,16 @@ pub fn generate_random_bls_address() -> [u8; 48] {
let sk = SecretKey::key_gen(&ikm, &[]).unwrap();
let pk = sk.sk_to_pk();
return pk.compress();
}


#[cfg(test)]
mod tests {
use crate::utils::bls::generate_random_bls_address;

#[test]
fn test_generate_random_bls_address() {
let bls_address = generate_random_bls_address();
assert_eq!(bls_address.len(), 48, "BLS address should be of 48 length");
}
}

0 comments on commit d1bd6e7

Please sign in to comment.