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)
| 697 | /// The hash is created from the hash_str so that when compared with |
| 698 | /// a ChangelistEntry using the same string, they will match. |
| 699 | fn create_test_entry(sequence: u64, hash_str: &str) -> HistoryEntry { |
| 700 | // Create a hash that will produce the expected base32 string |
| 701 | // For testing, we use a hash derived from the string itself |
| 702 | let hash = Hash::of(hash_str.as_bytes()); |
| 703 | HistoryEntry { |
| 704 | sequence, |
| 705 | hash, |
| 706 | state: Merkle::ZERO, |
| 707 | node_id: NodeId::from(sequence), |
| 708 | header: None, |
| 709 | is_tagged: false, |
| 710 | } |
| 711 | } |
| 712 | |
| 713 | /// Create a test changelist entry. |
| 714 | /// The hash should be the base32 encoding of the same hash used in create_test_entry. |