Skip to content

Commit

Permalink
runTransactionCalculateMinValueCmd was never Byron compatible
Browse files Browse the repository at this point in the history
Remove support for Byron by only accepting shelley based tx outputs
  • Loading branch information
Jimbo4350 committed Nov 14, 2023
1 parent a90dc81 commit 86ae4b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cardano-cli/src/Cardano/CLI/EraBased/Commands/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ data TransactionCalculateMinFeeCmdArgs = TransactionCalculateMinFeeCmdArgs
} deriving Show

data TransactionCalculateMinValueCmdArgs era = TransactionCalculateMinValueCmdArgs
{ eon :: !(CardanoEra era)
{ eon :: !(ShelleyBasedEra era)
, protocolParamsFile :: !ProtocolParamsFile
, txOut :: !TxOutAnyEra
, txOut :: !TxOutShelleyBasedEra
} deriving Show

newtype TransactionHashScriptDataCmdArgs = TransactionHashScriptDataCmdArgs
Expand Down
14 changes: 7 additions & 7 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1023,14 +1023,14 @@ runTransactionCalculateMinValueCmd
, txOut
} = do
pp <- firstExceptT TxCmdProtocolParamsError (readProtocolParameters protocolParamsFile)
out <- toTxOutInAnyEra eon txOut
out <- toTxOutInShelleyBasedEra eon txOut
-- TODO: shouldn't we just require shelley based era here instead of error-ing for byron?
forEraInEon eon (error "runTransactionCalculateMinValueCmd: Byron era not implemented yet") $ \sbe -> do
firstExceptT TxCmdPParamsErr . hoistEither
$ checkProtocolParameters sbe pp
pp' <- hoistEither . first TxCmdProtocolParamsConverstionError $ toLedgerPParams sbe pp
let minValue = calculateMinimumUTxO sbe out pp'
liftIO . IO.print $ minValue

firstExceptT TxCmdPParamsErr . hoistEither
$ checkProtocolParameters eon pp
pp' <- hoistEither . first TxCmdProtocolParamsConverstionError $ toLedgerPParams eon pp
let minValue = calculateMinimumUTxO eon out pp'
liftIO . IO.print $ minValue

runTransactionPolicyIdCmd :: ()
=> Cmd.TransactionPolicyIdCmdArgs
Expand Down

0 comments on commit 86ae4b9

Please sign in to comment.