diff --git a/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/Byron/Mempool.hs b/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/Byron/Mempool.hs index ca7b93fe144..c5a034f3415 100644 --- a/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/Byron/Mempool.hs +++ b/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/Byron/Mempool.hs @@ -106,12 +106,6 @@ instance ApplyTx ByronBlock where where validationMode = CC.ValidationMode CC.NoBlockValidation Utxo.TxValidationNoCrypto - reapplyTxSameState cfg tx st = - validationErrorImpossible $ - applyByronGenTx validationMode cfg tx st - where - validationMode = CC.ValidationMode CC.NoBlockValidation Utxo.NoTxValidation - instance HasTxId (GenTx ByronBlock) where data TxId (GenTx ByronBlock) = ByronTxId !Utxo.TxId diff --git a/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/ByronSpec/Mempool.hs b/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/ByronSpec/Mempool.hs index 318565c74dd..d2c8630fc19 100644 --- a/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/ByronSpec/Mempool.hs +++ b/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/ByronSpec/Mempool.hs @@ -50,11 +50,4 @@ instance ApplyTx ByronSpecBlock where (byronSpecLedgerState st) -- Byron spec doesn't have multiple validation modes - - reapplyTx cfg tx = applyTx cfg tx - reapplyTxSameState cfg tx = dontExpectError . applyTx cfg tx - where - dontExpectError :: Except a b -> b - dontExpectError mb = case runExcept mb of - Left _ -> error "reapplyTxSameState: unexpected error" - Right b -> b + reapplyTx = applyTx diff --git a/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/Dual.hs b/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/Dual.hs index 7e6b4024a26..26ee9c783fd 100644 --- a/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/Dual.hs +++ b/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/Dual.hs @@ -443,25 +443,6 @@ instance Bridge m a => ApplyTx (DualBlock m a) where dualLedgerStateBridge } - reapplyTxSameState DualLedgerConfig{..} - tx@DualGenTx{..} - (TickedLedgerState slot DualLedgerState{..}) = - TickedLedgerState slot DualLedgerState { - dualLedgerStateMain = tickedLedgerState $ - reapplyTxSameState - dualLedgerConfigMain - dualGenTxMain - (TickedLedgerState slot dualLedgerStateMain) - , dualLedgerStateAux = tickedLedgerState $ - reapplyTxSameState - dualLedgerConfigAux - dualGenTxAux - (TickedLedgerState slot dualLedgerStateAux) - , dualLedgerStateBridge = updateBridgeWithTx - tx - dualLedgerStateBridge - } - instance Bridge m a => HasTxId (GenTx (DualBlock m a)) where -- We don't need a pair of IDs, as long as we can unique ID the transaction newtype TxId (GenTx (DualBlock m a)) = DualGenTxId { diff --git a/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/Mock/Block.hs b/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/Mock/Block.hs index 73c5315be8e..f7381c36aaa 100644 --- a/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/Mock/Block.hs +++ b/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/Mock/Block.hs @@ -284,12 +284,8 @@ instance (SimpleCrypto c, Typeable ext, SupportedBlock (SimpleBlock c ext)) type ApplyTxErr (SimpleBlock c ext) = MockError (SimpleBlock c ext) - applyTx = \_ -> updateSimpleUTxO - reapplyTx = \_ -> updateSimpleUTxO - reapplyTxSameState = \_ -> (mustSucceed . runExcept) .: updateSimpleUTxO - where - mustSucceed (Left _) = error "reapplyTxSameState: unexpected error" - mustSucceed (Right st) = st + applyTx = const updateSimpleUTxO + reapplyTx = const updateSimpleUTxO instance HasTxId (GenTx (SimpleBlock c ext)) where newtype TxId (GenTx (SimpleBlock c ext)) = SimpleGenTxId diff --git a/ouroboros-consensus/src/Ouroboros/Consensus/Mempool/API.hs b/ouroboros-consensus/src/Ouroboros/Consensus/Mempool/API.hs index f6bdb45e8ab..028fd24e959 100644 --- a/ouroboros-consensus/src/Ouroboros/Consensus/Mempool/API.hs +++ b/ouroboros-consensus/src/Ouroboros/Consensus/Mempool/API.hs @@ -69,17 +69,6 @@ class ( UpdateLedger blk -> TickedLedgerState blk -> Except (ApplyTxErr blk) (TickedLedgerState blk) - -- | Re-apply a transaction to the very same state it was applied in before - -- - -- In this case no error can occur. - -- - -- See also 'ldbConfReapply' for comments on implementing this function. - reapplyTxSameState :: HasCallStack - => LedgerConfig blk - -> GenTx blk - -> TickedLedgerState blk - -> TickedLedgerState blk - -- | Transactions with an identifier -- -- The mempool will use these to locate transactions, so two different