Create a test history entry with a deterministic hash. The hash is created from the hash_str so that when compared with a ChangelistEntry using the same string, they will match.
(sequence: u64, hash_str: &str)
| 767 | /// The hash is created from the hash_str so that when compared with |
| 768 | /// a ChangelistEntry using the same string, they will match. |
| 769 | fn create_test_entry(sequence: u64, hash_str: &str) -> HistoryEntry { |
| 770 | // Create a hash that will produce the expected base32 string |
| 771 | // For testing, we use a hash derived from the string itself |
| 772 | let hash = Hash::of(hash_str.as_bytes()); |
| 773 | HistoryEntry { |
| 774 | sequence, |
| 775 | hash, |
| 776 | state: Merkle::ZERO, |
| 777 | node_id: NodeId::from(sequence), |
| 778 | header: None, |
| 779 | is_tagged: false, |
| 780 | } |
| 781 | } |
| 782 | |
| 783 | /// Create a test changelist entry. |
| 784 | /// The hash should be the base32 encoding of the same hash used in create_test_entry. |