-
Notifications
You must be signed in to change notification settings - Fork 214
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
SCP-3073: emulated ledger #336
Conversation
600eefe
to
f25ae01
Compare
17628af
to
f468d79
Compare
# Conflicts: # plutus-contract/src/Plutus/Contract/Wallet.hs # plutus-contract/src/Wallet/Emulator/Wallet.hs # plutus-contract/test/Spec/Emulator.hs # plutus-contract/test/Spec/golden/traceOutput - pubKeyTransactions.txt # plutus-contract/test/Spec/golden/traceOutput - pubKeyTransactions2.txt # plutus-contract/test/Spec/golden/traceOutput - wait1.txt # plutus-ledger/src/Ledger/Tx/CardanoAPI.hs # plutus-pab/src/Cardano/Node/Types.hs # plutus-pab/src/Cardano/Wallet/Mock/Handlers.hs # plutus-pab/src/Cardano/Wallet/Mock/Server.hs # plutus-pab/src/Plutus/PAB/Run/Cli.hs # plutus-use-cases/test/Spec/crowdfundingEmulatorTestOutput.txt
let requiredSigners = Map.keys (U.unBalancedTxRequiredSignatories utx) | ||
theFee <- either (throwError . WAPI.ToCardanoError) pure $ evaluateTransactionFee requiredSigners tx | ||
tx' <- handleBalanceTx utxo (utx & U.tx . Ledger.fee .~ theFee) | ||
cTx <- either (throwError . WAPI.ToCardanoError) pure $ fromPlutusTx requiredSigners tx' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to convert to CardanoApi's tx?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only place where this is possible since we have the required signers here.
I have added an explanation in the note that explains why we have the Both constructor.
@koslambrou Thanks, this was one of those times where I ran out of stamina and forgot about the documentation. |
LGTM! Thanks for the clarification @sjoerdvisscher :) |
…o-ledger (#336) * Detect validation errors with cardano-ledger-specs * Calculate (almost) correct fees * Include hashScriptIntegrity in TxBody * Change CardanoTx from Either to These, and adopt it further * Validate validityrange * Make ledger validation errors fail the emulator validation * Ada-only outputs for collateral * Better fee calc, separate out CardanoTx signing * Fix all use-cases tests (except 1 which is now disabled) Co-authored-by: Jann Müller <j-mueller@users.noreply.github.com>
Pre-submit checklist: