Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let assignScriptRedeemers take Ledger.UTxO #4038

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/wallet/src/Cardano/Wallet/Write/Tx/Balance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,8 @@ balanceTransactionWithSelectionStrategyAndNoZeroAdaAdjustment
where
unUTxO (Cardano.UTxO u) = u

combinedLedgerUTxO = fromCardanoUTxO combinedUTxO

combinedUTxO :: Cardano.UTxO era
combinedUTxO = Cardano.UTxO $ mconcat
-- The @Cardano.UTxO@ can contain strictly more information than
Expand Down Expand Up @@ -798,7 +800,7 @@ balanceTransactionWithSelectionStrategyAndNoZeroAdaAdjustment
tx' <- left ErrBalanceTxUpdateError $ updateTx partialTx update
left ErrBalanceTxAssignRedeemers $
assignScriptRedeemers
pp timeTranslation combinedUTxO redeemers tx'
pp timeTranslation combinedLedgerUTxO redeemers tx'

guardConflictingWithdrawalNetworks
(Cardano.Tx (Cardano.TxBody body) _) = do
Expand Down
6 changes: 3 additions & 3 deletions lib/wallet/src/Cardano/Wallet/Write/Tx/Redeemers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import Cardano.Wallet.Write.Tx
, RecentEraLedgerConstraints
, ShelleyLedgerEra
, StandardCrypto
, UTxO
, fromCardanoTx
, fromCardanoUTxO
, shelleyBasedEra
, txBody
, withConstraints
Expand Down Expand Up @@ -97,7 +97,7 @@ assignScriptRedeemers
:: forall era. IsRecentEra era
=> PParams (ShelleyLedgerEra era)
-> TimeTranslation
-> Cardano.UTxO era
-> UTxO (ShelleyLedgerEra era)
-> [Redeemer]
-> Cardano.Tx era
-> Either ErrAssignRedeemers (Cardano.Tx era)
Expand Down Expand Up @@ -163,7 +163,7 @@ assignScriptRedeemers pparams timeTranslation utxo redeemers tx =
(Map Alonzo.RdmrPtr (Either ErrAssignRedeemers Alonzo.ExUnits))
evaluateExecutionUnits indexedRedeemers ledgerTx =
Ledger.evalTxExUnits
pparams ledgerTx (fromCardanoUTxO utxo) epochInformation systemStart
pparams ledgerTx utxo epochInformation systemStart
& bimap
ErrAssignRedeemersTranslationError
(hoistScriptFailure indexedRedeemers)
Expand Down
Loading