{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
module Test.Cardano.Ledger.Api.Tx (spec) where
import qualified Cardano.Chain.Common as Byron
import Cardano.Ledger.Api.Era
import Cardano.Ledger.Api.PParams
import Cardano.Ledger.Api.Tx
import Cardano.Ledger.Binary
import Cardano.Ledger.Core (TxLevel (..))
import Cardano.Ledger.Hashes (extractHash, hashAnnotated, hashKey)
import Cardano.Ledger.Keys (makeBootstrapWitness)
import Cardano.Ledger.Val (Val ((<×>)))
import qualified Data.ByteString as BS
import qualified Data.Map.Strict as Map
import qualified Data.Set as Set
import Lens.Micro
import Numeric.Natural
import Test.Cardano.Ledger.Api.Arbitrary ()
import Test.Cardano.Ledger.Common
import Test.Cardano.Ledger.Core.KeyPair (ByronKeyPair (..), KeyPair (..), mkWitnessVKey)
txSpec ::
forall era.
( EraTx era
, Arbitrary (Tx TopTx era)
, Arbitrary (PParams era)
) =>
Spec
txSpec :: forall era.
(EraTx era, Arbitrary (Tx TopTx era), Arbitrary (PParams era)) =>
Spec
txSpec = String -> Spec -> Spec
forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe (forall era. Era era => String
eraName @era) (Spec -> Spec) -> Spec -> Spec
forall a b. (a -> b) -> a -> b
$ do
String -> Spec -> Spec
forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"estimateMinFeeTx" (Spec -> Spec) -> Spec -> Spec
forall a b. (a -> b) -> a -> b
$ do
String
-> (PParams era
-> Tx TopTx era -> [KeyPair (ZonkAny 0)] -> Property)
-> Spec
forall prop.
(HasCallStack, Testable prop) =>
String -> prop -> Spec
prop String
"no Bootstrap" ((PParams era -> Tx TopTx era -> [KeyPair (ZonkAny 0)] -> Property)
-> Spec)
-> (PParams era
-> Tx TopTx era -> [KeyPair (ZonkAny 0)] -> Property)
-> Spec
forall a b. (a -> b) -> a -> b
$ \(PParams era
pp :: PParams era) (Tx TopTx era
tx :: Tx TopTx era) [KeyPair (ZonkAny 0)]
keyPairsList ->
let
txBody :: TxBody TopTx era
txBody = Tx TopTx era
tx Tx TopTx era
-> Getting (TxBody TopTx era) (Tx TopTx era) (TxBody TopTx era)
-> TxBody TopTx era
forall s a. s -> Getting a s a -> a
^. Getting (TxBody TopTx era) (Tx TopTx era) (TxBody TopTx era)
forall era (l :: TxLevel).
EraTx era =>
Lens' (Tx l era) (TxBody l era)
forall (l :: TxLevel). Lens' (Tx l era) (TxBody l era)
bodyTxL
txBodyHash :: SafeHash EraIndependentTxBody
txBodyHash = TxBody TopTx era -> SafeHash EraIndependentTxBody
forall x i. HashAnnotated x i => x -> SafeHash i
hashAnnotated TxBody TopTx era
txBody
keyPairs :: Map (KeyHash (ZonkAny 0)) (KeyPair (ZonkAny 0))
keyPairs = [(KeyHash (ZonkAny 0), KeyPair (ZonkAny 0))]
-> Map (KeyHash (ZonkAny 0)) (KeyPair (ZonkAny 0))
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(VKey (ZonkAny 0) -> KeyHash (ZonkAny 0)
forall (kd :: KeyRole). VKey kd -> KeyHash kd
hashKey (VKey (ZonkAny 0) -> KeyHash (ZonkAny 0))
-> VKey (ZonkAny 0) -> KeyHash (ZonkAny 0)
forall a b. (a -> b) -> a -> b
$ KeyPair (ZonkAny 0) -> VKey (ZonkAny 0)
forall (kd :: KeyRole). KeyPair kd -> VKey kd
vKey KeyPair (ZonkAny 0)
kp, KeyPair (ZonkAny 0)
kp) | KeyPair (ZonkAny 0)
kp <- [KeyPair (ZonkAny 0)]
keyPairsList]
wits :: Set (WitVKey Witness)
wits = [WitVKey Witness] -> Set (WitVKey Witness)
forall a. Ord a => [a] -> Set a
Set.fromList ([WitVKey Witness] -> Set (WitVKey Witness))
-> [WitVKey Witness] -> Set (WitVKey Witness)
forall a b. (a -> b) -> a -> b
$ (KeyPair (ZonkAny 0) -> WitVKey Witness)
-> [KeyPair (ZonkAny 0)] -> [WitVKey Witness]
forall a b. (a -> b) -> [a] -> [b]
map (SafeHash EraIndependentTxBody
-> KeyPair (ZonkAny 0) -> WitVKey Witness
forall (kr :: KeyRole).
SafeHash EraIndependentTxBody -> KeyPair kr -> WitVKey Witness
mkWitnessVKey SafeHash EraIndependentTxBody
txBodyHash) ([KeyPair (ZonkAny 0)] -> [WitVKey Witness])
-> [KeyPair (ZonkAny 0)] -> [WitVKey Witness]
forall a b. (a -> b) -> a -> b
$ Map (KeyHash (ZonkAny 0)) (KeyPair (ZonkAny 0))
-> [KeyPair (ZonkAny 0)]
forall k a. Map k a -> [a]
Map.elems Map (KeyHash (ZonkAny 0)) (KeyPair (ZonkAny 0))
keyPairs
txSigned :: Tx TopTx era
txSigned = Tx TopTx era
tx Tx TopTx era -> (Tx TopTx era -> Tx TopTx era) -> Tx TopTx era
forall a b. a -> (a -> b) -> b
& ((TxWits era -> Identity (TxWits era))
-> Tx TopTx era -> Identity (Tx TopTx era)
forall era (l :: TxLevel).
EraTx era =>
Lens' (Tx l era) (TxWits era)
forall (l :: TxLevel). Lens' (Tx l era) (TxWits era)
witsTxL ((TxWits era -> Identity (TxWits era))
-> Tx TopTx era -> Identity (Tx TopTx era))
-> ((Set (WitVKey Witness) -> Identity (Set (WitVKey Witness)))
-> TxWits era -> Identity (TxWits era))
-> (Set (WitVKey Witness) -> Identity (Set (WitVKey Witness)))
-> Tx TopTx era
-> Identity (Tx TopTx era)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Set (WitVKey Witness) -> Identity (Set (WitVKey Witness)))
-> TxWits era -> Identity (TxWits era)
forall era.
EraTxWits era =>
Lens' (TxWits era) (Set (WitVKey Witness))
Lens' (TxWits era) (Set (WitVKey Witness))
addrTxWitsL ((Set (WitVKey Witness) -> Identity (Set (WitVKey Witness)))
-> Tx TopTx era -> Identity (Tx TopTx era))
-> Set (WitVKey Witness) -> Tx TopTx era -> Tx TopTx era
forall a s t. Monoid a => ASetter s t a a -> a -> s -> t
<>~ Set (WitVKey Witness)
wits)
in
PParams era -> Tx TopTx era -> Int -> Int -> Int -> Coin
forall era.
EraTx era =>
PParams era -> Tx TopTx era -> Int -> Int -> Int -> Coin
estimateMinFeeTx PParams era
pp Tx TopTx era
tx (Map (KeyHash (ZonkAny 0)) (KeyPair (ZonkAny 0)) -> Int
forall k a. Map k a -> Int
Map.size Map (KeyHash (ZonkAny 0)) (KeyPair (ZonkAny 0))
keyPairs) Int
0 Int
0
Coin -> Coin -> Property
forall a. (Eq a, Show a) => a -> a -> Property
=== (PParams era -> Tx TopTx era -> Int -> Tx TopTx era
forall era.
EraTx era =>
PParams era -> Tx TopTx era -> Int -> Tx TopTx era
setMinFeeTx PParams era
pp Tx TopTx era
txSigned Int
0 Tx TopTx era -> Getting Coin (Tx TopTx era) Coin -> Coin
forall s a. s -> Getting a s a -> a
^. (TxBody TopTx era -> Const Coin (TxBody TopTx era))
-> Tx TopTx era -> Const Coin (Tx TopTx era)
forall era (l :: TxLevel).
EraTx era =>
Lens' (Tx l era) (TxBody l era)
forall (l :: TxLevel). Lens' (Tx l era) (TxBody l era)
bodyTxL ((TxBody TopTx era -> Const Coin (TxBody TopTx era))
-> Tx TopTx era -> Const Coin (Tx TopTx era))
-> ((Coin -> Const Coin Coin)
-> TxBody TopTx era -> Const Coin (TxBody TopTx era))
-> Getting Coin (Tx TopTx era) Coin
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Coin -> Const Coin Coin)
-> TxBody TopTx era -> Const Coin (TxBody TopTx era)
forall era. EraTxBody era => Lens' (TxBody TopTx era) Coin
Lens' (TxBody TopTx era) Coin
feeTxBodyL)
String
-> (PParams era
-> Tx TopTx era
-> [KeyPair (ZonkAny 1)]
-> [(ByronKeyPair, AddrAttributes)]
-> Property)
-> Spec
forall prop.
(HasCallStack, Testable prop) =>
String -> prop -> Spec
prop String
"with Bootstrap" ((PParams era
-> Tx TopTx era
-> [KeyPair (ZonkAny 1)]
-> [(ByronKeyPair, AddrAttributes)]
-> Property)
-> Spec)
-> (PParams era
-> Tx TopTx era
-> [KeyPair (ZonkAny 1)]
-> [(ByronKeyPair, AddrAttributes)]
-> Property)
-> Spec
forall a b. (a -> b) -> a -> b
$ \(PParams era
pp :: PParams era) (Tx TopTx era
tx :: Tx TopTx era) [KeyPair (ZonkAny 1)]
keyPairsList [(ByronKeyPair, AddrAttributes)]
byronKeyPairsList ->
let
txBody :: TxBody TopTx era
txBody = Tx TopTx era
tx Tx TopTx era
-> Getting (TxBody TopTx era) (Tx TopTx era) (TxBody TopTx era)
-> TxBody TopTx era
forall s a. s -> Getting a s a -> a
^. Getting (TxBody TopTx era) (Tx TopTx era) (TxBody TopTx era)
forall era (l :: TxLevel).
EraTx era =>
Lens' (Tx l era) (TxBody l era)
forall (l :: TxLevel). Lens' (Tx l era) (TxBody l era)
bodyTxL
txBodyHash :: SafeHash EraIndependentTxBody
txBodyHash = TxBody TopTx era -> SafeHash EraIndependentTxBody
forall x i. HashAnnotated x i => x -> SafeHash i
hashAnnotated TxBody TopTx era
txBody
keyPairs :: Map (KeyHash (ZonkAny 1)) (KeyPair (ZonkAny 1))
keyPairs = [(KeyHash (ZonkAny 1), KeyPair (ZonkAny 1))]
-> Map (KeyHash (ZonkAny 1)) (KeyPair (ZonkAny 1))
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(VKey (ZonkAny 1) -> KeyHash (ZonkAny 1)
forall (kd :: KeyRole). VKey kd -> KeyHash kd
hashKey (VKey (ZonkAny 1) -> KeyHash (ZonkAny 1))
-> VKey (ZonkAny 1) -> KeyHash (ZonkAny 1)
forall a b. (a -> b) -> a -> b
$ KeyPair (ZonkAny 1) -> VKey (ZonkAny 1)
forall (kd :: KeyRole). KeyPair kd -> VKey kd
vKey KeyPair (ZonkAny 1)
kp, KeyPair (ZonkAny 1)
kp) | KeyPair (ZonkAny 1)
kp <- [KeyPair (ZonkAny 1)]
keyPairsList]
wits :: Set (WitVKey Witness)
wits = [WitVKey Witness] -> Set (WitVKey Witness)
forall a. Ord a => [a] -> Set a
Set.fromList ([WitVKey Witness] -> Set (WitVKey Witness))
-> [WitVKey Witness] -> Set (WitVKey Witness)
forall a b. (a -> b) -> a -> b
$ (KeyPair (ZonkAny 1) -> WitVKey Witness)
-> [KeyPair (ZonkAny 1)] -> [WitVKey Witness]
forall a b. (a -> b) -> [a] -> [b]
map (SafeHash EraIndependentTxBody
-> KeyPair (ZonkAny 1) -> WitVKey Witness
forall (kr :: KeyRole).
SafeHash EraIndependentTxBody -> KeyPair kr -> WitVKey Witness
mkWitnessVKey SafeHash EraIndependentTxBody
txBodyHash) ([KeyPair (ZonkAny 1)] -> [WitVKey Witness])
-> [KeyPair (ZonkAny 1)] -> [WitVKey Witness]
forall a b. (a -> b) -> a -> b
$ Map (KeyHash (ZonkAny 1)) (KeyPair (ZonkAny 1))
-> [KeyPair (ZonkAny 1)]
forall k a. Map k a -> [a]
Map.elems Map (KeyHash (ZonkAny 1)) (KeyPair (ZonkAny 1))
keyPairs
byronKeyPairs :: Map VerificationKey (SigningKey, Attributes AddrAttributes)
byronKeyPairs =
[(VerificationKey, (SigningKey, Attributes AddrAttributes))]
-> Map VerificationKey (SigningKey, Attributes AddrAttributes)
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
[ ( ByronKeyPair -> VerificationKey
bkpVerificationKey ByronKeyPair
kp
, (ByronKeyPair -> SigningKey
bkpSigningKey ByronKeyPair
kp, AddrAttributes -> Attributes AddrAttributes
forall h. h -> Attributes h
Byron.mkAttributes (AddrAttributes -> Attributes AddrAttributes)
-> AddrAttributes -> Attributes AddrAttributes
forall a b. (a -> b) -> a -> b
$ AddrAttributes
attrs {Byron.aaVKDerivationPath = Nothing})
)
| (ByronKeyPair
kp, AddrAttributes
attrs) <-
[(ByronKeyPair, AddrAttributes)]
byronKeyPairsList
]
byronWits :: Set BootstrapWitness
byronWits =
[BootstrapWitness] -> Set BootstrapWitness
forall a. Ord a => [a] -> Set a
Set.fromList ([BootstrapWitness] -> Set BootstrapWitness)
-> [BootstrapWitness] -> Set BootstrapWitness
forall a b. (a -> b) -> a -> b
$
((SigningKey, Attributes AddrAttributes) -> BootstrapWitness)
-> [(SigningKey, Attributes AddrAttributes)] -> [BootstrapWitness]
forall a b. (a -> b) -> [a] -> [b]
map ((SigningKey -> Attributes AddrAttributes -> BootstrapWitness)
-> (SigningKey, Attributes AddrAttributes) -> BootstrapWitness
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry (Hash HASH EraIndependentTxBody
-> SigningKey -> Attributes AddrAttributes -> BootstrapWitness
makeBootstrapWitness (SafeHash EraIndependentTxBody -> Hash HASH EraIndependentTxBody
forall i. SafeHash i -> Hash HASH i
extractHash SafeHash EraIndependentTxBody
txBodyHash))) (Map VerificationKey (SigningKey, Attributes AddrAttributes)
-> [(SigningKey, Attributes AddrAttributes)]
forall k a. Map k a -> [a]
Map.elems Map VerificationKey (SigningKey, Attributes AddrAttributes)
byronKeyPairs)
txSigned :: Tx TopTx era
txSigned =
Tx TopTx era
tx
Tx TopTx era -> (Tx TopTx era -> Tx TopTx era) -> Tx TopTx era
forall a b. a -> (a -> b) -> b
& ((TxWits era -> Identity (TxWits era))
-> Tx TopTx era -> Identity (Tx TopTx era)
forall era (l :: TxLevel).
EraTx era =>
Lens' (Tx l era) (TxWits era)
forall (l :: TxLevel). Lens' (Tx l era) (TxWits era)
witsTxL ((TxWits era -> Identity (TxWits era))
-> Tx TopTx era -> Identity (Tx TopTx era))
-> ((Set (WitVKey Witness) -> Identity (Set (WitVKey Witness)))
-> TxWits era -> Identity (TxWits era))
-> (Set (WitVKey Witness) -> Identity (Set (WitVKey Witness)))
-> Tx TopTx era
-> Identity (Tx TopTx era)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Set (WitVKey Witness) -> Identity (Set (WitVKey Witness)))
-> TxWits era -> Identity (TxWits era)
forall era.
EraTxWits era =>
Lens' (TxWits era) (Set (WitVKey Witness))
Lens' (TxWits era) (Set (WitVKey Witness))
addrTxWitsL ((Set (WitVKey Witness) -> Identity (Set (WitVKey Witness)))
-> Tx TopTx era -> Identity (Tx TopTx era))
-> Set (WitVKey Witness) -> Tx TopTx era -> Tx TopTx era
forall a s t. Monoid a => ASetter s t a a -> a -> s -> t
<>~ Set (WitVKey Witness)
wits)
Tx TopTx era -> (Tx TopTx era -> Tx TopTx era) -> Tx TopTx era
forall a b. a -> (a -> b) -> b
& ((TxWits era -> Identity (TxWits era))
-> Tx TopTx era -> Identity (Tx TopTx era)
forall era (l :: TxLevel).
EraTx era =>
Lens' (Tx l era) (TxWits era)
forall (l :: TxLevel). Lens' (Tx l era) (TxWits era)
witsTxL ((TxWits era -> Identity (TxWits era))
-> Tx TopTx era -> Identity (Tx TopTx era))
-> ((Set BootstrapWitness -> Identity (Set BootstrapWitness))
-> TxWits era -> Identity (TxWits era))
-> (Set BootstrapWitness -> Identity (Set BootstrapWitness))
-> Tx TopTx era
-> Identity (Tx TopTx era)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Set BootstrapWitness -> Identity (Set BootstrapWitness))
-> TxWits era -> Identity (TxWits era)
forall era.
EraTxWits era =>
Lens' (TxWits era) (Set BootstrapWitness)
Lens' (TxWits era) (Set BootstrapWitness)
bootAddrTxWitsL ((Set BootstrapWitness -> Identity (Set BootstrapWitness))
-> Tx TopTx era -> Identity (Tx TopTx era))
-> Set BootstrapWitness -> Tx TopTx era -> Tx TopTx era
forall a s t. Monoid a => ASetter s t a a -> a -> s -> t
<>~ Set BootstrapWitness
byronWits)
serializeByronAttrs :: Byron.Attributes Byron.AddrAttributes -> Natural
serializeByronAttrs :: Attributes AddrAttributes -> Natural
serializeByronAttrs = Int -> Natural
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Natural)
-> (Attributes AddrAttributes -> Int)
-> Attributes AddrAttributes
-> Natural
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> Int
BS.length (ByteString -> Int)
-> (Attributes AddrAttributes -> ByteString)
-> Attributes AddrAttributes
-> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Version -> Attributes AddrAttributes -> ByteString
forall a. EncCBOR a => Version -> a -> ByteString
serialize' Version
byronProtVer
assumedAttrs :: AddrAttributes
assumedAttrs =
Byron.AddrAttributes
{ aaVKDerivationPath :: Maybe HDAddressPayload
Byron.aaVKDerivationPath = Maybe HDAddressPayload
forall a. Maybe a
Nothing
, aaNetworkMagic :: NetworkMagic
Byron.aaNetworkMagic = Word32 -> NetworkMagic
Byron.NetworkTestnet Word32
forall a. Bounded a => a
maxBound
}
overestimations :: [Natural]
overestimations =
[ Attributes AddrAttributes -> Natural
serializeByronAttrs (AddrAttributes -> Attributes AddrAttributes
forall h. h -> Attributes h
Byron.mkAttributes AddrAttributes
assumedAttrs) Natural -> Natural -> Natural
forall a. Num a => a -> a -> a
- Attributes AddrAttributes -> Natural
serializeByronAttrs Attributes AddrAttributes
attrs
| (SigningKey
_, Attributes AddrAttributes
attrs) <- Map VerificationKey (SigningKey, Attributes AddrAttributes)
-> [(SigningKey, Attributes AddrAttributes)]
forall k a. Map k a -> [a]
Map.elems Map VerificationKey (SigningKey, Attributes AddrAttributes)
byronKeyPairs
]
in
let
overestimatedMinFeeA :: Coin
overestimatedMinFeeA = Natural -> Integer
forall a. Integral a => a -> Integer
toInteger ([Natural] -> Natural
forall a. Num a => [a] -> a
forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum [Natural]
overestimations) Integer -> Coin -> Coin
forall i. Integral i => i -> Coin -> Coin
forall t i. (Val t, Integral i) => i -> t -> t
<×> PParams era
pp PParams era -> Getting Coin (PParams era) Coin -> Coin
forall s a. s -> Getting a s a -> a
^. Getting Coin (PParams era) Coin
forall era.
(EraPParams era, HasCallStack) =>
Lens' (PParams era) Coin
Lens' (PParams era) Coin
ppMinFeeAL
estimation :: Coin
estimation = PParams era -> Tx TopTx era -> Int -> Int -> Int -> Coin
forall era.
EraTx era =>
PParams era -> Tx TopTx era -> Int -> Int -> Int -> Coin
estimateMinFeeTx PParams era
pp Tx TopTx era
tx (Map (KeyHash (ZonkAny 1)) (KeyPair (ZonkAny 1)) -> Int
forall k a. Map k a -> Int
Map.size Map (KeyHash (ZonkAny 1)) (KeyPair (ZonkAny 1))
keyPairs) (Map VerificationKey (SigningKey, Attributes AddrAttributes) -> Int
forall k a. Map k a -> Int
Map.size Map VerificationKey (SigningKey, Attributes AddrAttributes)
byronKeyPairs) Int
0
actual :: Coin
actual = PParams era -> Tx TopTx era -> Int -> Tx TopTx era
forall era.
EraTx era =>
PParams era -> Tx TopTx era -> Int -> Tx TopTx era
setMinFeeTx PParams era
pp Tx TopTx era
txSigned Int
0 Tx TopTx era -> Getting Coin (Tx TopTx era) Coin -> Coin
forall s a. s -> Getting a s a -> a
^. (TxBody TopTx era -> Const Coin (TxBody TopTx era))
-> Tx TopTx era -> Const Coin (Tx TopTx era)
forall era (l :: TxLevel).
EraTx era =>
Lens' (Tx l era) (TxBody l era)
forall (l :: TxLevel). Lens' (Tx l era) (TxBody l era)
bodyTxL ((TxBody TopTx era -> Const Coin (TxBody TopTx era))
-> Tx TopTx era -> Const Coin (Tx TopTx era))
-> ((Coin -> Const Coin Coin)
-> TxBody TopTx era -> Const Coin (TxBody TopTx era))
-> Getting Coin (Tx TopTx era) Coin
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Coin -> Const Coin Coin)
-> TxBody TopTx era -> Const Coin (TxBody TopTx era)
forall era. EraTxBody era => Lens' (TxBody TopTx era) Coin
Lens' (TxBody TopTx era) Coin
feeTxBodyL
in
String -> [String] -> Bool -> Property
forall prop.
Testable prop =>
String -> [String] -> prop -> Property
tabulate String
"Attrs overestimation in bytes" ((Natural -> String) -> [Natural] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map Natural -> String
forall a. Show a => a -> String
show [Natural]
overestimations) (Bool -> Property) -> Bool -> Property
forall a b. (a -> b) -> a -> b
$
Coin
estimation Coin -> Coin -> Bool
forall a. Ord a => a -> a -> Bool
>= Coin
actual Coin -> Coin -> Coin
forall a. Semigroup a => a -> a -> a
<> Coin
overestimatedMinFeeA
spec :: Spec
spec :: Spec
spec = do
forall era.
(EraTx era, Arbitrary (Tx TopTx era), Arbitrary (PParams era)) =>
Spec
txSpec @ShelleyEra
forall era.
(EraTx era, Arbitrary (Tx TopTx era), Arbitrary (PParams era)) =>
Spec
txSpec @AllegraEra
forall era.
(EraTx era, Arbitrary (Tx TopTx era), Arbitrary (PParams era)) =>
Spec
txSpec @MaryEra
forall era.
(EraTx era, Arbitrary (Tx TopTx era), Arbitrary (PParams era)) =>
Spec
txSpec @AlonzoEra
forall era.
(EraTx era, Arbitrary (Tx TopTx era), Arbitrary (PParams era)) =>
Spec
txSpec @BabbageEra
forall era.
(EraTx era, Arbitrary (Tx TopTx era), Arbitrary (PParams era)) =>
Spec
txSpec @ConwayEra
forall era.
(EraTx era, Arbitrary (Tx TopTx era), Arbitrary (PParams era)) =>
Spec
txSpec @DijkstraEra