Skip to content

Commit

Permalink
Add golden test: calculate-min-fee for babbage tx
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeFlerovsky committed Dec 29, 2023
1 parent 0d5f14b commit 27981c1
Show file tree
Hide file tree
Showing 4 changed files with 417 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,8 @@ test-suite cardano-cli-golden
build-tool-depends: cardano-cli:cardano-cli
, tasty-discover:tasty-discover

other-modules: Test.Golden.Byron.SigningKeys
other-modules: Test.Golden.Babbage.Transaction.CalculateMinFee
Test.Golden.Byron.SigningKeys
Test.Golden.Byron.Tx
Test.Golden.Byron.TxBody
Test.Golden.Byron.UpdateProposal
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{-# LANGUAGE OverloadedStrings #-}

module Test.Golden.Babbage.Transaction.CalculateMinFee
where

import Test.Cardano.CLI.Util

import Hedgehog (Property)
import qualified Hedgehog as H

{- HLINT ignore "Use camelCase" -}

hprop_golden_shelley_transaction_calculate_min_fee :: Property
hprop_golden_shelley_transaction_calculate_min_fee = propertyOnce $ do
protocolParamsJsonFile <- noteInputFile "test/cardano-cli-golden/files/input/babbage/transaction-calculate-min-fee/protocol-params.json"
txBodyFile <- noteInputFile "test/cardano-cli-golden/files/input/babbage/tx/txbody"

minFeeTxt <- execCardanoCLI
[ "transaction","calculate-min-fee"
, "--witness-count", "1"
, "--protocol-params-file", protocolParamsJsonFile
, "--tx-body-file", txBodyFile
]

H.diff minFeeTxt (==) "165633 Lovelace\n"
Loading

0 comments on commit 27981c1

Please sign in to comment.