git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 9b5545940cea05703845fc350781ee577ca2e326

Kernel: only do metering if it is a WASM code

Alex Beregszaszi committed on 8/26/2016, 9:40:45 PM
Parent: 1039324df6ed695b396944c8d6f5f4157f3bf6ce

Files changed

index.jschanged
index.jsView
@@ -125,10 +125,14 @@
125125 }
126126 }
127127
128128 createHandler (create) {
129+ let code = create.data
130+
129131 // Inject metering
130- const code = this.callHandler({ to: meteringContract, data: code }).returnValue
132+ if (Utils.isWASMCode(code)) {
133+ code = this.callHandler({ to: meteringContract, data: code }).returnValue
134+ }
131135
132136 let address = Utils.newAccountAddress(create.from, code)
133137
134138 this.environment.addAccount(address.toString(), {

Built with git-ssb-web