diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index 545a40daec..9ad505463a 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -388,6 +388,7 @@ test-suite cardano-cli-golden Test.Golden.CreateStaked Test.Golden.CreateTestnetData Test.Golden.Conway.Transaction.Assemble + Test.Golden.Conway.Transaction.BuildRaw Test.Golden.EraBased.Governance.AnswerPoll Test.Golden.EraBased.Governance.CreatePoll Test.Golden.EraBased.Governance.VerifyPoll diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Conway/Transaction/BuildRaw.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Conway/Transaction/BuildRaw.hs index 9d7e60ea19..0af7b156ff 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Conway/Transaction/BuildRaw.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Conway/Transaction/BuildRaw.hs @@ -34,3 +34,40 @@ hprop_golden_conway_build_raw_treasury_donation = propertyOnce . H.moduleWorkspa H.diffFileVsGoldenFile outFile goldenFile +-- Negative test: Missing --current-treasury-value +-- | Execute me with: +-- @cabal test cardano-cli-golden --test-options '-p "/golden conway build raw donation no current treasury value/"'@ +hprop_golden_conway_build_raw_donation_no_current_treasury_value :: Property +hprop_golden_conway_build_raw_donation_no_current_treasury_value = propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do + + -- Key filepaths + outFile <- noteTempFile tempDir "out.json" + + void $ execDetailCardanoCLI + [ "conway", "transaction", "build-raw" + , "--tx-in", "f62cd7bc15d8c6d2c8519fb8d13c57c0157ab6bab50af62bc63706feb966393d#0" + , "--tx-out", "addr_test1qpmxr8d8jcl25kyz2tz9a9sxv7jxglhddyf475045y8j3zxjcg9vquzkljyfn3rasfwwlkwu7hhm59gzxmsyxf3w9dps8832xh+1199989833223" + , "--tx-out", "addr_test1vpqgspvmh6m2m5pwangvdg499srfzre2dd96qq57nlnw6yctpasy4+10000000" + , "--treasury-donation", "1000343" + , "--fee", "166777" + , "--out-file", outFile + ] + +-- Negative test: Missing --current-treasury-value +-- | Execute me with: +-- @cabal test cardano-cli-golden --test-options '-p "/ggolden conway build raw donation no treasury donation/"'@ +hprop_golden_conway_build_raw_donation_no_treasury_donation :: Property +hprop_golden_conway_build_raw_donation_no_treasury_donation = propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do + + -- Key filepaths + outFile <- noteTempFile tempDir "out.json" + + void $ execDetailCardanoCLI + [ "conway", "transaction", "build-raw" + , "--tx-in", "f62cd7bc15d8c6d2c8519fb8d13c57c0157ab6bab50af62bc63706feb966393d#0" + , "--tx-out", "addr_test1qpmxr8d8jcl25kyz2tz9a9sxv7jxglhddyf475045y8j3zxjcg9vquzkljyfn3rasfwwlkwu7hhm59gzxmsyxf3w9dps8832xh+1199989833223" + , "--tx-out", "addr_test1vpqgspvmh6m2m5pwangvdg499srfzre2dd96qq57nlnw6yctpasy4+10000000" + , "--current-treasury-value", "543" + , "--fee", "166777" + , "--out-file", outFile + ] \ No newline at end of file