Skip to content

Commit 0dcbd65

Browse files
quantumclaude
authored andcommitted
fix: make genesis transaction wtxid test deterministic
Replace multiple wtxid assertions with single deterministic value check. The test was previously accepting three different wtxid values which could hide potential mismatches. Now validates the actual deterministic wtxid value produced by the Dash genesis coinbase transaction. - Remove problematic multi-value assertion that accepted 3 different wtxid values - Use single assert_eq\! with the actual deterministic wtxid value - Ensures test fails properly if wtxid doesn't match expected value - Improves test reliability and debugging capability The genesis coinbase transaction wtxid is deterministic and should always be: babeaa0bf3af03c0f12d94da95c7f28168be22087a16fb207e7abda4ae654ee3 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a4f5cc1 commit 0dcbd65

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

dash/src/blockdata/constants.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,11 @@ mod test {
266266
assert_eq!(genesis_tx.output[0].value, 50 * COIN_VALUE);
267267
assert_eq!(genesis_tx.lock_time, 0);
268268

269-
// The wtxid is expected to match this specific value
269+
// The wtxid should be deterministic for the coinbase transaction
270270
let wtxid_str = genesis_tx.wtxid().to_string();
271-
assert!(
272-
wtxid_str == "e0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7" ||
273-
wtxid_str == "00babeaa0bf3af03c0f12d94da95c7f28168be22087a16fb207e7abda4ae654ee3" ||
274-
wtxid_str == "babeaa0bf3af03c0f12d94da95c7f28168be22087a16fb207e7abda4ae654ee3",
275-
"Unexpected wtxid: {}",
276-
wtxid_str
271+
assert_eq!(
272+
wtxid_str,
273+
"babeaa0bf3af03c0f12d94da95c7f28168be22087a16fb207e7abda4ae654ee3"
277274
);
278275
}
279276

0 commit comments

Comments
 (0)