File tree Expand file tree Collapse file tree
deku-p/src/core/crypto/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ struct
2222 List. for_all (fun sk -> Secret. equal sk sk) secret_keys
2323 end
2424
25+ module Key_hash_data = struct
26+ let key_hashes = List. map (fun id -> id.public_key_hash) ids
27+ let compared_key_hashes = List. sort Key_hash. compare key_hashes
28+ end
29+
2530 module Test_secret_key_data = struct
2631 let public_keys () =
2732 let public_keys =
@@ -47,4 +52,16 @@ struct
4752 ~expected: Tezos_data. equality_secret_keys
4853 ~actual: Secret_key_data. equality_secret_keys
4954 end
55+
56+ module Test_key_hash_data = struct
57+ let compare () =
58+ let compared_key_hashes =
59+ List. map
60+ (fun kh -> Key_hash. to_b58 kh)
61+ Key_hash_data. compared_key_hashes
62+ in
63+ Alcotest. (check' (list string ))
64+ ~msg: " key hash comparison works"
65+ ~expected: Tezos_data. compared_key_hashes ~actual: compared_key_hashes
66+ end
5067end
Original file line number Diff line number Diff line change @@ -88,4 +88,5 @@ let run () =
8888 test_case " compare" `Quick Test_secret_key_data. compare;
8989 test_case " equality" `Quick Test_secret_key_data. equality;
9090 ] );
91+ (" Key hash" , [ test_case " compare" `Quick Test_key_hash_data. compare ]);
9192 ]
You can’t perform that action at this time.
0 commit comments