Skip to content

Commit

Permalink
Handle anyAddressInEra with onLeft
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Feb 8, 2023
1 parent 09c5c21 commit dd497b9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cardano-cli/src/Cardano/CLI/Shelley/Run/Transaction.hs
Expand Up @@ -729,9 +729,8 @@ runTxBuild era (AnyConsensusModeParams cModeParams) networkId mScriptValidity
firstExceptT ShelleyTxCmdQueryNotScriptLocked
. hoistEither $ notScriptLockedTxIns txinsc nodeEraUTxO

let cAddr = case anyAddressInEra era changeAddr of
Right addr -> addr
Left _ -> error $ "runTxBuild: Byron address used: " <> show changeAddr
cAddr <- pure (anyAddressInEra era changeAddr)
& onLeft (error $ "runTxBuild: Byron address used: " <> show changeAddr) -- should this throw instead?

-- Why do we cast the era? The user can specify an era prior to the era that the node is currently in.
-- We cannot use the user specified era to construct a query against a node because it may differ
Expand Down

0 comments on commit dd497b9

Please sign in to comment.