Skip to content

Commit

Permalink
Delete use of AnyConsensusMode
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Nov 20, 2023
1 parent 4943b90 commit 74cc58b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cardano-submit-api/src/Cardano/TxSubmit/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module Cardano.TxSubmit.Types
, renderTxCmdError
) where

import Cardano.Api (AnyCardanoEra, AnyConsensusMode (..), Error (..), TxId, textShow)
import Cardano.Api (AnyCardanoEra, Error (..), TxId, textShow)
import Cardano.Binary (DecoderError)
import Data.Aeson (ToJSON (..), Value (..))
import Data.ByteString.Char8 (ByteString)
Expand Down Expand Up @@ -54,7 +54,7 @@ newtype EnvSocketError = CliEnvVarLookup Text deriving (Eq, Show)

data TxCmdError
= TxCmdSocketEnvError EnvSocketError
| TxCmdEraConsensusModeMismatch !AnyConsensusMode !AnyCardanoEra
| TxCmdEraConsensusModeMismatch !AnyCardanoEra
| TxCmdTxReadError !RawCborDecodeError
| TxCmdTxSubmitError !Text
| TxCmdTxSubmitErrorEraMismatch !EraMismatch
Expand All @@ -67,7 +67,7 @@ convertJson = String . renderTxSubmitWebApiError

renderTxCmdError :: TxCmdError -> Text
renderTxCmdError (TxCmdSocketEnvError socketError) = "socket env error " <> textShow socketError
renderTxCmdError (TxCmdEraConsensusModeMismatch mode era) = "era consensus mode mismatch" <> textShow mode <> " " <> textShow era
renderTxCmdError (TxCmdEraConsensusModeMismatch era) = "era consensus mode mismatch " <> textShow era
renderTxCmdError (TxCmdTxReadError envelopeError) = "transaction read error " <> textShow envelopeError
renderTxCmdError (TxCmdTxSubmitError msg) = "transaction submit error " <> msg
renderTxCmdError (TxCmdTxSubmitErrorEraMismatch eraMismatch) = "transaction submit era mismatch" <> textShow eraMismatch
Expand Down
3 changes: 1 addition & 2 deletions cardano-submit-api/src/Cardano/TxSubmit/Web.hs
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,8 @@ txSubmitPost
txSubmitPost trace metrics (AnyConsensusModeParams cModeParams) networkId socketPath txBytes =
handle $ do
InAnyCardanoEra era tx <- readByteStringTx txBytes
let cMode = AnyConsensusMode $ consensusModeOnly cModeParams
eraInMode <- hoistMaybe
(TxCmdEraConsensusModeMismatch cMode (AnyCardanoEra era))
(TxCmdEraConsensusModeMismatch (AnyCardanoEra era))
(toEraInMode era $ consensusModeOnly cModeParams)
let txInMode = TxInMode tx eraInMode
localNodeConnInfo = LocalNodeConnectInfo
Expand Down

0 comments on commit 74cc58b

Please sign in to comment.