-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add golden test for conway transaction assemble
- Loading branch information
1 parent
581fe89
commit 6e368ca
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
cardano-cli/test/cardano-cli-golden/Test/Golden/Conway/Transaction/Assemble.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
|
||
module Test.Golden.Conway.Transaction.Assemble where | ||
|
||
import Control.Monad (void) | ||
|
||
import Test.Cardano.CLI.Util | ||
|
||
import Hedgehog (Property) | ||
import qualified Hedgehog.Extras.Test.Base as H | ||
import qualified Hedgehog.Extras.Test.File as H | ||
|
||
{- HLINT ignore "Use camelCase" -} | ||
|
||
-- Check that we can assemble a txbody and a tx witness to form a transaction | ||
|
||
hprop_golden_conwayTransactionAssembleWitness_SigningKey :: Property | ||
hprop_golden_conwayTransactionAssembleWitness_SigningKey = propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do | ||
witnessTx <- noteTempFile tempDir "single-signing-key-witness-tx" | ||
txBodyFile <- noteInputFile "test/cardano-cli-golden/files/input/conway/txbody" | ||
signingKeyWitnessFile <- noteInputFile "test/cardano-cli-golden/files/input/conway/singleSigningKeyWitness" | ||
void $ execCardanoCLI | ||
[ "conway", "transaction", "assemble" | ||
, "--tx-body-file", txBodyFile | ||
, "--witness-file", signingKeyWitnessFile | ||
, "--witness-file", signingKeyWitnessFile | ||
, "--out-file", witnessTx | ||
] | ||
|
||
H.assertFileOccurences 1 "Witnessed Tx ConwayEra" witnessTx |
5 changes: 5 additions & 0 deletions
5
cardano-cli/test/cardano-cli-golden/files/input/conway/singleSigningKeyWitness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "TxWitness ConwayEra", | ||
"description": "Key Witness ShelleyEra", | ||
"cborHex": "825820c16f6bf723e38013f88588539fbbf1cd6b57bbbd8bb2cf318e641f00dcd527875840e62f3050bf7ee1d1547badd6f8346c00957b20c8d8f201fc8cf9d64485b3b3c944392afe00619516a00d98c6ccfa44a7de8c1a093efdc10832bb6fdf4cde8e08" | ||
} |
5 changes: 5 additions & 0 deletions
5
cardano-cli/test/cardano-cli-golden/files/input/conway/txbody
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "Unwitnessed Tx ConwayEra", | ||
"description": "Ledger Cddl Format", | ||
"cborHex": "84a5008182582054b5f2d5ed0fa142e724c9a982864d9e080b10648a66c8f7956eb3cc2cf16c0000018182581d6052e63f22c5107ed776b70f7b92248b02552fd08f3e747bc7450994411b0000000235cfef6d021a0002ff51031a0099d1dd04828a03581ce6eb963e591bc66401b5e1c763f4c9bc27adf58eb720f63c809981d75820dacc52f2d73542ab0fc3b1f8051d00b0e50f1130935e5a21982bd289705852ae1b000000174876e8001b00000002540be400d81e82010a581de05e35891efec9c4a4e08d2a6a6d03598056d014e287618548e2556f8c81581c5e35891efec9c4a4e08d2a6a6d03598056d014e287618548e2556f8c818400190bb9447f000001f682783268747470733a2f2f6d792d69702e61742f746573742f636f6e77617974657374706f6f6c2e6d657461646174612e6a736f6e58207cd083e6682892afc2b4e315fca93784f43dccde8bae1daa81db0b587e27155f83028200581c5e35891efec9c4a4e08d2a6a6d03598056d014e287618548e2556f8c581ce6eb963e591bc66401b5e1c763f4c9bc27adf58eb720f63c809981d7a0f5f6" | ||
} |