Skip to content

Commit

Permalink
do not charge gas in encodeRowData on writes
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcardon committed Aug 6, 2024
1 parent 161d2e5 commit 9cd2e38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions pact-tests/gas-goldens/builtinGas.golden
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ enumerate: 230
exp: 10000
filter: 1461
floor: 50
fold-db: 100383577
fold-db: 100383575
fold: 790
format-time: 6041
format: 1801
Expand All @@ -60,12 +60,12 @@ hyperlane-decode-token-message: 2175
hyperlane-encode-token-message: 2475
hyperlane-message-id: 2743
identity: 25
insert: 60383377
insert: 60383375
install-capability: 60002693
int-to-str: 602
is-charset: 1788
is-principal: 447
keys: 100383377
keys: 100383375
keyset-ref-guard: 44231
length: 576
ln: 12000
Expand All @@ -89,14 +89,14 @@ read-integer: 128
read-keyset: 37239
read-msg: 128
read-string: 128
read: 60393377
read: 60393375
remove: 261
require-capability: 60002675
resume: 60006674
reverse: 601
round: 50
scalar-mult: 360225
select: 100383527
select: 100383525
shift: 4
show: 4002
sort: 1002
Expand All @@ -108,12 +108,12 @@ time: 2000
tx-hash: 25
typeof-principal: 647
typeof: 25
update: 60516584
update: 60516580
validate-principal: 4940
where: 1079
with-default-read: 60405927
with-read: 60394452
write: 60383377
with-default-read: 60405925
with-read: 60394450
write: 60383375
xor: 2000
yield: 60002446
zip: 3822
Expand Down
2 changes: 1 addition & 1 deletion pact/Pact/Core/Serialise.hs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ serialisePact = PactSerialise

gEncodeRowData :: RowData -> GasM b i ByteString
gEncodeRowData rd = do
encodedRow <- V1.encodeRowData rd
let encodedRow = V1.encodeRowDataNoGas rd
pure $ toStrictByteString $ encodeVersion V1_CBOR <> S.encodeBytes encodedRow

liftReplBuiltin :: ModuleData CoreBuiltin a -> ModuleData ReplCoreBuiltin a
Expand Down

0 comments on commit 9cd2e38

Please sign in to comment.