From 5a5541050009376145873ef447a2a182b89d7279 Mon Sep 17 00:00:00 2001 From: Sasha Bogicevic Date: Mon, 13 May 2024 09:39:13 +0200 Subject: [PATCH] Don't guard on txId when parsing from json --- hydra-node/src/Hydra/Ledger/Cardano.hs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/hydra-node/src/Hydra/Ledger/Cardano.hs b/hydra-node/src/Hydra/Ledger/Cardano.hs index 5cce5801b33..3c0fd972eea 100644 --- a/hydra-node/src/Hydra/Ledger/Cardano.hs +++ b/hydra-node/src/Hydra/Ledger/Cardano.hs @@ -152,13 +152,9 @@ instance FromJSON Tx where bytes <- decodeBase16 hexText case deserialiseFromCBOR (proxyToAsType (Proxy @Tx)) bytes of Left e -> fail $ show e - Right tx -> - (o .:? "txId") >>= \case - Nothing -> pure tx - Just txid' -> do - guard (txType tx == ty) - guard (txid' == txId tx) - pure tx + Right tx -> do + guard (txType tx == ty) + pure tx instance Arbitrary Tx where -- TODO: shrinker!