Skip to content

Commit

Permalink
Add missing constraints within Write.Tx.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles authored and erikd committed Mar 16, 2023
1 parent 29b9772 commit b4614ab
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions lib/wallet/src/Cardano/Wallet/Write/Tx.hs
Expand Up @@ -883,13 +883,13 @@ evaluateMinimumFee era pp tx kwc =
-- is not automatically the minimum fee.
--
evaluateTransactionBalance
:: Babbage.ShelleyEraTxBody (ShelleyLedgerEra era)
=> RecentEra era
:: RecentEra era
-> Core.PParams (Cardano.ShelleyLedgerEra era)
-> Shelley.UTxO (Cardano.ShelleyLedgerEra era)
-> Core.TxBody (Cardano.ShelleyLedgerEra era)
-> Core.Value (Cardano.ShelleyLedgerEra era)
evaluateTransactionBalance era pp utxo txBody' =
withShelleyEraTxBodyConstraint era $
withCLIConstraint era $
Shelley.evaluateTransactionBalance pp utxo isNewPool txBody'
where
Expand All @@ -903,19 +903,29 @@ evaluateTransactionBalance era pp utxo txBody' =
-- Module-internal helpers
--------------------------------------------------------------------------------

withShelleyEraTxBodyConstraint
:: RecentEra era
-> ((Babbage.ShelleyEraTxBody (ShelleyLedgerEra era)) => a)
-> a
withShelleyEraTxBodyConstraint era a = case era of
RecentEraAlonzo -> a
RecentEraBabbage -> a
RecentEraConway -> a

withStandardCryptoConstraint
:: RecentEra era
-> ((Crypto (Cardano.ShelleyLedgerEra era) ~ StandardCrypto) => a)
-> a
withStandardCryptoConstraint era a = case era of
RecentEraBabbage -> a
RecentEraAlonzo -> a
RecentEraBabbage -> a
RecentEraConway -> a

withCLIConstraint
:: RecentEra era
-> (CLI (ShelleyLedgerEra era) => a)
-> a
withCLIConstraint era a = case era of
RecentEraConway -> a
RecentEraBabbage -> a
RecentEraAlonzo -> a
RecentEraBabbage -> a
RecentEraConway -> a

0 comments on commit b4614ab

Please sign in to comment.