Skip to content

Commit 4e99a78

Browse files
committed
Compare the witness and the assembled transaction against golden files
Replace the envelope-type substring assertions with byte-exact golden comparisons of both the witness and the assembled transaction, matching the Conway assemble test; the outputs are deterministic since the transaction fields are fixed and Ed25519 signing is deterministic.
1 parent 42db86c commit 4e99a78

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

cardano-cli/test/cardano-cli-golden/Test/Golden/Dijkstra/Transaction/Assemble.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ hprop_golden_dijkstra_transaction_assemble_witness_signing_key =
5353
, witnessFile
5454
]
5555

56-
H.assertFileOccurences 1 "TxWitness DijkstraEra" witnessFile
56+
goldenWitnessFile <- H.note "test/cardano-cli-golden/files/golden/dijkstra/transaction/witness_out"
57+
H.diffFileVsGoldenFile witnessFile goldenWitnessFile
5758

5859
-- Assemble the body and the witness back into a signed transaction
5960
signedTxFile <- noteTempFile tempDir "signed-tx"
@@ -70,4 +71,6 @@ hprop_golden_dijkstra_transaction_assemble_witness_signing_key =
7071
, signedTxFile
7172
]
7273

73-
H.assertFileOccurences 1 "Tx DijkstraEra" signedTxFile
74+
goldenSignedTxFile <-
75+
H.note "test/cardano-cli-golden/files/golden/dijkstra/transaction/assemble_out"
76+
H.diffFileVsGoldenFile signedTxFile goldenSignedTxFile
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "Tx DijkstraEra",
3+
"description": "Ledger Cddl Format",
4+
"cborHex": "83a300d90102818258202392d2b1200b5139fe555c81261697b29a8ccf561c5c783d46e78a479d977053000181825839016b837ca50316ee4e00033482ed128887d72c2bae5b0438d692dc1251b0c8b17595ebdb93c1f974be0a9b1ef26c474649d9c2ae766ed135cf1864020ca100d90102818258208dc60533b5dfa60a530955a696323a2ef4f14e8bc95a8f84cf6c441fea4234275840bb76dd0b00d3b7567437d659c6783245e97250d9b0d94d9136f9e1bc85dcc0b82a8ba9e4c225d6f78fb63f65452f2e6b3ce6ea9f8e637f1d6d499a8da48a1d0df6"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "TxWitness DijkstraEra",
3+
"description": "Key Witness ShelleyEra",
4+
"cborHex": "8258208dc60533b5dfa60a530955a696323a2ef4f14e8bc95a8f84cf6c441fea4234275840bb76dd0b00d3b7567437d659c6783245e97250d9b0d94d9136f9e1bc85dcc0b82a8ba9e4c225d6f78fb63f65452f2e6b3ce6ea9f8e637f1d6d499a8da48a1d0d"
5+
}

0 commit comments

Comments
 (0)