File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
plutus-pab/src/Plutus/PAB/Core/ContractInstance Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -58,20 +58,17 @@ startNodeClient socket mode slotConfig networkId instancesState = do
5858 case mode of
5959 MockNode ->
6060 void $ MockClient. runChainSync socket slotConfig
61- (\ block slot -> STM. atomically $ handleSyncAction $ processMockBlock instancesState env block slot)
61+ (\ block slot -> handleSyncAction $ processMockBlock instancesState env block slot)
6262 AlonzoNode -> do
6363 let resumePoints = []
6464 void $ Client. runChainSync socket slotConfig networkId resumePoints
65- (\ block slot -> STM. atomically $ handleSyncAction $ processChainSyncEvent env block slot)
65+ (\ block slot -> handleSyncAction $ processChainSyncEvent env block slot)
6666 pure env
6767
68- -- | Deal with errors. For now, we deal with them by simply failing the entire
69- -- application.
70- handleSyncAction :: STM (Either SyncActionFailure () ) -> STM ()
71- handleSyncAction a = a >>= f
72- where
73- f (Left e) = error $ " Sync action error: " <> show e
74- f _ = pure ()
68+ -- | Deal with sync action failures from running this STM action. For now, we
69+ -- deal with them by simply calling `error`; i.e. the application exits.
70+ handleSyncAction :: STM (Either SyncActionFailure () ) -> IO ()
71+ handleSyncAction action = STM. atomically action >>= either (error . show ) pure
7572
7673updateInstances :: IndexedBlock -> InstanceClientEnv -> STM ()
7774updateInstances IndexedBlock {ibUtxoSpent, ibUtxoProduced} InstanceClientEnv {ceUtxoSpentRequests, ceUtxoProducedRequests} = do
You can’t perform that action at this time.
0 commit comments