Skip to content

Commit

Permalink
Debug tx proposal script witness
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 committed Feb 16, 2024
1 parent 42a44b4 commit 97be687
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cardano-cli/src/Cardano/CLI/Types/Errors/TxValidationError.hs
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,13 @@ convToTxProposalProcedures
:: Ledger.EraPParams (ShelleyLedgerEra era)
=> [(Proposal era, Maybe (ScriptWitness WitCtxStake era))]
-> TxProposalProcedures BuildTx era
convToTxProposalProcedures proposalProcedures =
convToTxProposalProcedures proposalProcedures = do
-- TODO: Ledger does not export snoc so we can't fold here.
let proposals = OSet.fromFoldable $ map (unProposal . fst) proposalProcedures
sWitMap = BuildTxWith $ foldl sWitMapFolder Map.empty proposalProcedures
in TxProposalProcedures proposals sWitMap
case Map.size sWitMap of
0 -> error "convToTxProposalProcedures: No script witness found for proposal."
_ -> TxProposalProcedures proposals $ BuildTxWith sWitMap
where
sWitMap = foldl sWitMapFolder Map.empty proposalProcedures
sWitMapFolder sWitMapAccum nextSWit = sWitMapAccum `Map.union` uncurry proposingScriptWitnessSingleton nextSWit

0 comments on commit 97be687

Please sign in to comment.