diff --git a/src/Chainweb/Pact5/Backend/ChainwebPactDb.hs b/src/Chainweb/Pact5/Backend/ChainwebPactDb.hs index abacd685f..6deed7cf2 100644 --- a/src/Chainweb/Pact5/Backend/ChainwebPactDb.hs +++ b/src/Chainweb/Pact5/Backend/ChainwebPactDb.hs @@ -369,9 +369,14 @@ doReadRow mlim d k = do Nothing -> return Nothing Just (encodedValue, decodedValue) -> do case d of - Pact.DModules -> + Pact.DModules -> do BlockHandler $ lift $ lift $ Pact.chargeGasM (Pact.GModuleOp (Pact.MOpLoadModule (BS.length encodedValue))) + bsPendingTx . _Just . _1 . pendingWrites %= + InMemDb.insert d k (InMemDb.ReadEntry encodedValue decodedValue) + Pact.DUserTables {} -> do + bsPendingTx . _Just . _1 . pendingWrites %= + InMemDb.insert d k (InMemDb.ReadEntry encodedValue decodedValue) _ -> return () return (Just decodedValue) where diff --git a/test/unit/Chainweb/Test/Pact5/TransactionExecTest.hs b/test/unit/Chainweb/Test/Pact5/TransactionExecTest.hs index b3e22edfd..bf4add6fc 100644 --- a/test/unit/Chainweb/Test/Pact5/TransactionExecTest.hs +++ b/test/unit/Chainweb/Test/Pact5/TransactionExecTest.hs @@ -476,6 +476,12 @@ applyCmdSpec rdb = readFromAfterGenesis v rdb $ do P.match InMemDb._WriteEntry P.succeed ] ] + + , P.fun InMemDb.modules + ? P.alignExact ? Map.fromList + [ ModuleName "coin" Nothing :=> + P.match InMemDb._ReadEntry P.succeed + ] ] quirkSpec :: RocksDb -> IO ()