Skip to content

Commit

Permalink
Fix off by one error in gas payer
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcardon committed Sep 24, 2024
1 parent dd0c77e commit 25ce65d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Chainweb/Pact5/TransactionExec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,9 @@ enrichedMsgBodyForGasPayer cmd = case (_pPayload $ _cmdPayload cmd) of
-- Drop until the start line, and take (endLine - startLine). Note:
-- Span info locations are absolute, so `endLine` is not relative to start line, but
-- relative to the whole file.
lineSpan = take (endLine - startLine) $ drop startLine code
--
-- Note: we take `end - start + 1` since end is inclusive.
lineSpan = take (endLine - startLine + 1) $ drop startLine code
in T.concat (over _head (T.drop startCol) . over _last (T.take endCol) $ lineSpan)
Continuation cont ->
PObject $ Map.fromList
Expand Down

0 comments on commit 25ce65d

Please sign in to comment.