Skip to content
This repository was archived by the owner on Jan 5, 2019. It is now read-only.

Commit 4bd4810

Browse files
authored
Merge pull request #265 from ewasm/disable-interface-metering
Do not charge gas for interface methods
2 parents a019356 + 4327ad3 commit 4bd4810

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,11 @@ exports.evm2wast = function (evmCode, opts = {
189189
if (opts.chargePerOp) {
190190
segment += `(call $useGas (i64.const ${op.fee})) `
191191
}
192-
gasCount += op.fee
192+
// do not charge gas for interface methods
193+
// TODO: implement proper gas charging and enable this here
194+
if (opint < 0x30 || (opint > 0x45 && opint < 0xa0)) {
195+
gasCount += op.fee
196+
}
193197

194198
segmentStackDelta += op.on
195199
if (segmentStackDelta > segmentStackHigh) {

0 commit comments

Comments
 (0)