Skip to content

Commit

Permalink
Fix events treatments for txs endpoint
Browse files Browse the repository at this point in the history
In the presensence of orphans, we can have multiple executions of the same transaction yielding different events every time.

This commit makes sure that each execution gets associated with its own events only.
  • Loading branch information
enobayram committed Dec 19, 2023
1 parent 158637f commit b9417a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion haskell-src/exec/Chainweb/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,10 @@ queryTxsByKey logger rk c =
, Api._signer_capList = caps
}
let sigs = Api.Sig . unSignature . _signer_sig <$> dbSigners
sameBlock tx ev = (unBlockId $ _tx_block tx) == (unBlockId $ _ev_block ev)

return $ (`fmap` r) $ \(tx,contHist, blk) ->
toApiTxDetail tx contHist blk evs signers sigs
toApiTxDetail tx contHist blk (filter (sameBlock tx) evs) signers sigs

queryTxsByPactId :: LogFunctionIO Text -> Limit -> Text -> Connection -> IO [TxSummary]
queryTxsByPactId logger limit pactid c =
Expand Down

0 comments on commit b9417a0

Please sign in to comment.