@@ -334,7 +334,7 @@ prop_make_transaction_body_autobalance_return_correct_fee_for_multi_asset = H.pr
334334 feeWithTxoutAsset === fee
335335
336336prop_make_transaction_body_autobalance_when_deregistering_certs :: Property
337- prop_make_transaction_body_autobalance_when_deregistering_certs = H. propertyOnce $ do
337+ prop_make_transaction_body_autobalance_when_deregistering_certs = H. property $ do
338338 let ceo = ConwayEraOnwardsConway
339339 beo = convert ceo
340340 sbe = convert beo
@@ -354,15 +354,22 @@ prop_make_transaction_body_autobalance_when_deregistering_certs = H.propertyOnce
354354 address = mkAddress sbe scriptHash
355355 deregDeposit = L. Coin 20_000_000
356356 txOutCoin = L. Coin 20_800_000
357-
358- -- that's the same stake credential as in UTXO
359- lStakeCred@ (L. KeyHashObj kh) <-
360- pure $ mkCredential " keyHash-ebe9de78a37f84cc819c0669791aa0474d4f0a764e54b9f90cfe2137"
361- let stakeCred = StakeCredentialByKey $ StakeKeyHash kh
357+ mkStakeKeyFromHash hashStr = do
358+ (L. KeyHashObj kh) <-
359+ pure $ mkCredential hashStr
360+ pure . StakeCredentialByKey $ StakeKeyHash kh
361+
362+ (expectedFee, stakeCred) <-
363+ forAll $
364+ Gen. choice
365+ -- expected fee is larger, when the certificate credential does not match the credential required when witnessing UTXO
366+ [ (180_901 ,) <$> genStakeCredential
367+ , (176_457 ,) <$> mkStakeKeyFromHash " keyHash-ebe9de78a37f84cc819c0669791aa0474d4f0a764e54b9f90cfe2137"
368+ ]
362369 let certs =
363370 [
364371 ( ConwayCertificate ceo $
365- L. ConwayTxCertDeleg (L. ConwayUnRegCert lStakeCred (L. SJust deregDeposit))
372+ L. ConwayTxCertDeleg (L. ConwayUnRegCert (toShelleyStakeCredential stakeCred) (L. SJust deregDeposit))
366373 , Nothing
367374 )
368375 ]
@@ -395,7 +402,7 @@ prop_make_transaction_body_autobalance_when_deregistering_certs = H.propertyOnce
395402 H. note_ " Sanity check: inputs == outputs"
396403 mconcat [deregDeposit, txInputsTotalCoin] === mconcat [txOutCoin, fee, changeCoin]
397404
398- 176_457 === fee
405+ expectedFee === fee
399406
400407prop_make_transaction_body_autobalance_multi_asset_collateral :: Property
401408prop_make_transaction_body_autobalance_multi_asset_collateral = H. propertyOnce $ do
0 commit comments