Skip to content

Commit

Permalink
Factor out common build command within definition of inputWits.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Nov 2, 2022
1 parent e308cb1 commit 92de589
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/wallet/src/Cardano/Wallet/Shelley/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2437,17 +2437,17 @@ mkUnsignedTx
inputWits = case cs of
Right selOf ->
if inpsScripts == Map.empty then
(,Cardano.BuildTxWith (Cardano.KeyWitness Cardano.KeyWitnessForSpending))
. toCardanoTxIn
. fst <$> F.toList (view #inputs selOf)
(, buildTxCommand)
. toCardanoTxIn
. fst <$> F.toList (view #inputs selOf)
else
constructInpScriptWit . fst <$> F.toList (view #inputs selOf)
Left _preSel ->
[( toCardanoTxIn dummyInput
, Cardano.BuildTxWith (Cardano.KeyWitness Cardano.KeyWitnessForSpending))]



[(toCardanoTxIn dummyInput, buildTxCommand)]
where
buildTxCommand
= Cardano.BuildTxWith
$ Cardano.KeyWitness Cardano.KeyWitnessForSpending

-- cardano-node does not allow to construct tx without inputs at this moment.
-- this should change and this hack should be removed
Expand Down

0 comments on commit 92de589

Please sign in to comment.