git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 3e76d33a7cef629ec34b59cf2d48fb0561fe2bc7

Kernel: support the identity precompile

Alex Beregszaszi committed on 8/28/2016, 1:15:40 AM
Parent: e40cb39472f8609adea6dbe71bd08f434fa64f5c

Files changed

index.jschanged
precompile.jschanged
index.jsView
@@ -24,8 +24,9 @@
2424 const Utils = require('./utils.js')
2525 const Transaction = require('./transaction.js')
2626 const Precompile = require('./precompile.js')
2727
28+const identityContract = new Address('0x0000000000000000000000000000000000000004')
2829 const meteringContract = new Address('0x000000000000000000000000000000000000000A')
2930 const transcompilerContract = new Address('0x000000000000000000000000000000000000000B')
3031
3132 module.exports = class Kernel {
@@ -72,8 +73,10 @@
7273 if (call.to.equals(meteringContract)) {
7374 return Precompile.meteringInjector(call)
7475 } else if (call.to.equals(transcompilerContract)) {
7576 return Precompile.transcompiler(call)
77+ } else if (call.to.equals(identityContract)) {
78+ return Precompile.identity(call)
7679 }
7780
7881 let account = this.environment.state.get(call.to.toString())
7982 if (!account) {
precompile.jsView
@@ -15,4 +15,10 @@
1515 // returnValue: evm2wasm.compileEVM(call.data).slice(0)
1616 returnValue: call.data.slice(0)
1717 }
1818 }
19+
20+module.exports.identity = function (call) {
21+ return {
22+ returnValue: call.data.slice(0)
23+ }
24+}

Built with git-ssb-web