-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1005 from IntersectMBO/smelc/transaction-txid-add…
…-output-flags transaction id: add --output-[json,text] flag to control format of the output
- Loading branch information
Showing
18 changed files
with
99 additions
and
4 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
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
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
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
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
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/Shelley/Transaction/Id.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.Shelley.Transaction.Id where | ||
|
||
import Test.Cardano.CLI.Util | ||
|
||
import Hedgehog (Property) | ||
import qualified Hedgehog.Extras.Test.Base as H | ||
import qualified Hedgehog.Extras.Test.Golden as H | ||
|
||
{- HLINT ignore "Use camelCase" -} | ||
|
||
-- Execute this test with: | ||
-- @cabal test cardano-cli-golden --test-options '-p "/golden shelley transaction id/"'@ | ||
hprop_golden_shelley_transaction_id :: Property | ||
hprop_golden_shelley_transaction_id = propertyOnce $ do | ||
txFile <- noteInputFile "test/cardano-cli-golden/files/input/shelley/tx-for-txid.json" | ||
|
||
let baseCmd = ["latest", "transaction", "txid", "--tx-file", txFile] | ||
|
||
output1 <- execCardanoCLI baseCmd | ||
goldenFile1 <- H.note "test/cardano-cli-golden/files/golden/shelley/transaction-id-flagless" | ||
H.diffVsGoldenFile output1 goldenFile1 | ||
|
||
output2 <- execCardanoCLI $ baseCmd ++ ["--output-text"] | ||
H.diffVsGoldenFile output2 goldenFile1 | ||
|
||
output3 <- execCardanoCLI $ baseCmd ++ ["--output-json"] | ||
goldenFile2 <- H.note "test/cardano-cli-golden/files/golden/shelley/transaction-id.json" | ||
H.diffVsGoldenFile output3 goldenFile2 |
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
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
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
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
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
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
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
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
1 change: 1 addition & 0 deletions
1
cardano-cli/test/cardano-cli-golden/files/golden/shelley/transaction-id-flagless
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 @@ | ||
345b88a38821ce10b1a19c41cbc9b48a55c26001cee4a7d2ad83fd9ddb157667 |
1 change: 1 addition & 0 deletions
1
cardano-cli/test/cardano-cli-golden/files/golden/shelley/transaction-id.json
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 @@ | ||
{"txhash":"345b88a38821ce10b1a19c41cbc9b48a55c26001cee4a7d2ad83fd9ddb157667"} |
5 changes: 5 additions & 0 deletions
5
cardano-cli/test/cardano-cli-golden/files/input/shelley/tx-for-txid.json
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 MaryEra", | ||
"description": "Ledger Cddl Format", | ||
"cborHex": "83a300818258202392d2b1200b5139fe555c81261697b29a8ccf561c5c783d46e78a479d977053000181825839016b837ca50316ee4e00033482ed128887d72c2bae5b0438d692dc1251b0c8b17595ebdb93c1f974be0a9b1ef26c474649d9c2ae766ed135cf1864020ca0f6" | ||
} |