Test hashes honour Formatter::precision

Test that the new version of `hex` honours `Formatter::precision` for
new wrapped hash types (ie, types created with `hashes::hash_newtype`).

Fix: #2494
This commit is contained in:
Tobin C. Harding 2024-02-28 10:10:46 +11:00
parent 4bfb466bb9
commit 0cea90d505
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 4 additions and 0 deletions

View File

@ -1960,6 +1960,10 @@ mod tests {
format!("{:x}", tx.compute_txid()), format!("{:x}", tx.compute_txid()),
"9652aa62b0e748caeec40c4cb7bc17c6792435cc3dfe447dd1ca24f912a1c6ec" "9652aa62b0e748caeec40c4cb7bc17c6792435cc3dfe447dd1ca24f912a1c6ec"
); );
assert_eq!(
format!("{:.10x}", tx.compute_txid()),
"9652aa62b0"
);
assert_eq!(tx.weight(), Weight::from_wu(2718)); assert_eq!(tx.weight(), Weight::from_wu(2718));
// non-segwit tx from my mempool // non-segwit tx from my mempool