You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use witnet_crypto::{hash::{calculate_sha256,Sha256}, hash, merkle::{merkle_tree_root as crypto_merkle_tree_root,ProgressiveMerkleTree}, signature::{PublicKey,Signature, verify}};
14
+
use witnet_crypto::{
15
+
hash,
16
+
hash::{calculate_sha256,Sha256},
17
+
merkle::{merkle_tree_root as crypto_merkle_tree_root,ProgressiveMerkleTree},
// Test that the old keypair prefix is detected and omitted
2400
+
let old = backwards_compatible_keypair_decoding(&hex::decode("20000000000000001837c1be8e2995ec11cda2b066151be2cfb48adf9e47b151d46adab3a21cdf6720000000000000007923408dadd3c7b56eed15567707ae5e5dca089de972e07f3b860450e2a3b70e").unwrap());
2401
+
let new = backwards_compatible_keypair_decoding(&hex::decode("1837c1be8e2995ec11cda2b066151be2cfb48adf9e47b151d46adab3a21cdf6720000000000000007923408dadd3c7b56eed15567707ae5e5dca089de972e07f3b860450e2a3b70e").unwrap());
2402
+
assert_eq!(old, new);
2403
+
2404
+
// Test that shorter strings don't get clipped or panic
2405
+
let short = hex::decode("fabadaacabadaa").unwrap();
2406
+
let compatible = backwards_compatible_keypair_decoding(&short);
0 commit comments