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)
| 528 | /// The hash is created from the hash_str so that when compared with |
| 529 | /// a ChangelistEntry using the same string, they will match. |
| 530 | fn create_test_entry(sequence: u64, hash_str: &str) -> HistoryEntry { |
| 531 | // Create a hash that will produce the expected base32 string |
| 532 | // For testing, we use a hash derived from the string itself |
| 533 | let hash = Hash::of(hash_str.as_bytes()); |
| 534 | HistoryEntry { |
| 535 | sequence, |
| 536 | hash, |
| 537 | state: Merkle::ZERO, |
| 538 | node_id: NodeId::from(sequence), |
| 539 | header: None, |
| 540 | is_tagged: false, |
| 541 | } |
| 542 | } |
| 543 | |
| 544 | /// Create a test changelist entry. |
| 545 | /// The hash should be the base32 encoding of the same hash used in create_test_entry. |