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 Mar 20, 2023
1 parent e13bd9d commit 8cf9027
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
Original file line number Diff line number Diff line change
Expand Up @@ -740,9 +740,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 8cf9027

Please sign in to comment.