-
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 #681 from IntersectMBO/smelc/fix-same-action-id-vo…
…te-losing Throw an error on identical action-ids in votes of one voter
- Loading branch information
Showing
7 changed files
with
96 additions
and
15 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
34 changes: 34 additions & 0 deletions
34
cardano-cli/test/cardano-cli-test/Test/Cli/Shelley/Transaction/Build.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,34 @@ | ||
module Test.Cli.Shelley.Transaction.Build where | ||
|
||
import Data.List (isInfixOf) | ||
import System.Exit (ExitCode (..)) | ||
|
||
import Test.Cardano.CLI.Util (execDetailCardanoCLI, propertyOnce) | ||
|
||
import Hedgehog | ||
import qualified Hedgehog as H | ||
import qualified Hedgehog.Extras.Test.Base as H | ||
|
||
{- HLINT ignore "Use camelCase" -} | ||
{- HLINT ignore "Redundant bracket" -} | ||
|
||
-- | This is a test of https://github.com/IntersectMBO/cardano-cli/issues/662 | ||
-- Execute me with: | ||
-- @cabal test cardano-cli-test --test-options '-p "/conway transaction build one voter many votes/"'@ | ||
hprop_conway_transaction_build_one_voter_many_votes :: Property | ||
hprop_conway_transaction_build_one_voter_many_votes = propertyOnce $ H.moduleWorkspace "tmp" $ \tempDir -> do | ||
outFile <- H.noteTempFile tempDir "tx.traw" | ||
|
||
(exitCode, _stdout, stderr) <- H.noteShowM $ execDetailCardanoCLI | ||
[ "conway", "transaction", "build-raw" | ||
, "--tx-in", "6e8c947816e82627aeccb55300074f2894a2051332f62a1c8954e7b588a18be7#0" | ||
, "--tx-out", "addr_test1vpfwv0ezc5g8a4mkku8hhy3y3vp92t7s3ul8g778g5yegsgalc6gc+24910487859" | ||
, "--invalid-hereafter", "24325742" | ||
, "--fee" , "178569" | ||
, "--vote-file", "test/cardano-cli-test/files/input/shelley/transaction/vote1.drep.json" | ||
, "--vote-file", "test/cardano-cli-test/files/input/shelley/transaction/vote2.drep.json" | ||
, "--out-file", outFile | ||
] | ||
|
||
exitCode H.=== (ExitFailure 1) | ||
H.assertWith stderr ("This would cause ignoring some of the votes" `isInfixOf`) |
5 changes: 5 additions & 0 deletions
5
cardano-cli/test/cardano-cli-test/files/input/shelley/transaction/vote1.drep.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": "Governance voting procedures", | ||
"description": "", | ||
"cborHex": "a18202581c8f4fefcf28017a57b41517a67d56ef4c0dc04181a11d35178dd53f4ca1825820704e5c60c51dd0f3732991980b273402fbad0581c3407d682f8ea5b808a530fc008201f6" | ||
} |
5 changes: 5 additions & 0 deletions
5
cardano-cli/test/cardano-cli-test/files/input/shelley/transaction/vote2.drep.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": "Governance voting procedures", | ||
"description": "", | ||
"cborHex": "a18202581c8f4fefcf28017a57b41517a67d56ef4c0dc04181a11d35178dd53f4ca1825820704e5c60c51dd0f3732991980b273402fbad0581c3407d682f8ea5b808a530fc008200f6" | ||
} |