Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgenii Akentev committed Aug 4, 2023
1 parent b95ffcb commit 7d74f38
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Chainweb/Chainweb/Configuration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ import Chainweb.Time
import P2P.Node.Configuration
import Chainweb.Pact.Backend.DbCache (DbCacheLimitBytes)

import Pact.Parse (ParsedInteger(..))

-- -------------------------------------------------------------------------- --
-- Throttling Configuration

Expand Down Expand Up @@ -483,7 +485,7 @@ instance ToJSON ChainwebConfiguration where
, "reorgLimit" .= _configReorgLimit o
, "localRewindDepthLimit" .= _configLocalRewindDepthLimit o
, "preInsertCheckTimeout" .= _configPreInsertCheckTimeout o
, "localMaxGasLimit" .= _configLocalMaxGasLimit o
, "localMaxGasLimit" .= ((\(Mempool.GasLimit (ParsedInteger v)) -> v) <$> _configLocalMaxGasLimit o)
, "allowReadsInLocal" .= _configAllowReadsInLocal o
, "rosetta" .= _configRosetta o
, "serviceApi" .= _configServiceApi o
Expand Down
9 changes: 9 additions & 0 deletions src/Chainweb/Pact/Service/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import Pact.Types.Gas
import Pact.Types.Hash
import Pact.Types.Persistence
import Pact.Types.RowData
import Pact.Parse (ParsedInteger(..))

import qualified Pact.JSON.Encode as J

Expand Down Expand Up @@ -247,6 +248,14 @@ instance J.Encode PactException where
, "_localRewindRequestedDepth" J..= J.Aeson @Int (fromIntegral $ _rewindDepth $ _localRewindRequestedDepth o)
]
build LocalRewindGenesisExceeded = tagged "LocalRewindGenesisExceeded" J.null
build (LocalGasLimitExceeded {..}) =
let
GasLimit (ParsedInteger lmgl) = _localMaxGasLimit
GasLimit (ParsedInteger lrgl) = _localRequestedGasLimit
in tagged "LocalGasLimitExceeded" $ J.object
[ "_localMaxGasLimit" J..= J.Aeson lmgl
, "_localRequestedGasLimit" J..= J.Aeson lrgl
]

tagged :: J.Encode v => Text -> v -> J.Builder
tagged t v = J.object
Expand Down

0 comments on commit 7d74f38

Please sign in to comment.