From 1992922f28461b5707b524135b33b8492ef56eb1 Mon Sep 17 00:00:00 2001 From: KadenaFriend <241389759+kdafriend@users.noreply.github.com> Date: Fri, 13 Feb 2026 11:15:47 +0000 Subject: [PATCH] Handle properly empty Continuation chains --- haskell-src/exec/Chainweb/Server.hs | 4 ++-- haskell-src/lib/ChainwebDb/Queries.hs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/haskell-src/exec/Chainweb/Server.hs b/haskell-src/exec/Chainweb/Server.hs index 3ee810b..a0cbbda 100644 --- a/haskell-src/exec/Chainweb/Server.hs +++ b/haskell-src/exec/Chainweb/Server.hs @@ -290,7 +290,7 @@ dbToApiTxSummary s contHist = TxSummary , _txSummary_continuation = unPgJsonb <$> dtsContinuation s , _txSummary_result = maybe TxFailed (const TxSucceeded) $ dtsGoodResult s , _txSummary_initialCode = chCode contHist - , _txSummary_previousSteps = V.toList (chSteps contHist) <$ chCode contHist + , _txSummary_previousSteps = V.toList (fromMaybe mempty $ chSteps contHist) <$ chCode contHist } searchTxs @@ -385,7 +385,7 @@ toApiTxDetail tx contHist blk evs signers sigs = TxDetail , _txDetail_success = isJust $ _tx_goodResult tx , _txDetail_events = map toTxEvent evs , _txDetail_initialCode = chCode contHist - , _txDetail_previousSteps = V.toList (chSteps contHist) <$ chCode contHist + , _txDetail_previousSteps = V.toList (fromMaybe mempty $ chSteps contHist) <$ chCode contHist , _txDetail_signers = signers , _txDetail_sigs = sigs } diff --git a/haskell-src/lib/ChainwebDb/Queries.hs b/haskell-src/lib/ChainwebDb/Queries.hs index 11c64d4..02f0451 100644 --- a/haskell-src/lib/ChainwebDb/Queries.hs +++ b/haskell-src/lib/ChainwebDb/Queries.hs @@ -103,7 +103,7 @@ toDbTxSummary Transaction{..} = DbTxSummary data ContinuationHistoryT f = ContinuationHistory { chCode :: C f (Maybe Text) - , chSteps :: C f (Vector Text) + , chSteps :: C f (Maybe (Vector Text)) } deriving (Generic, Beamable) type ContinuationHistory = ContinuationHistoryT Identity