diff --git a/cardano-cli/src/Cardano/CLI/Shelley/Run/Transaction.hs b/cardano-cli/src/Cardano/CLI/Shelley/Run/Transaction.hs index 4616715ab50..a87d49813da 100644 --- a/cardano-cli/src/Cardano/CLI/Shelley/Run/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/Shelley/Run/Transaction.hs @@ -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