git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit c65080ed891e4874c7962a92eb7e6e331964adb3

fixed tests again

wanderer committed on 7/22/2016, 12:49:57 PM
Parent: 76b626ab5a6d24e48ccefffb8900dc9052b0b36d

Files changed

environment.jschanged
index.jschanged
interface.jschanged
tests/interfaceRunner.jschanged
environment.jsView
@@ -73,8 +73,23 @@
7373
7474 getBlockHash (height) {
7575 // STUB
7676 }
77+
78+ // kernal
79+ create (code, value) {
80+ // STUB
81+ }
82+
83+ call (gas, address, value, data) {
84+ // STUB
85+ return // result
86+ }
87+
88+ delegateCall (gas, address, data) {
89+ // STUB
90+ return // result
91+ }
7792 }
7893
7994 function hexStr2arrayBuf (string) {
8095 const ab = new ArrayBuffer(string.length / 2)
index.jsView
@@ -24,9 +24,9 @@
2424 this.environment = environment
2525 }
2626
2727 // handles running code.
28- static codeHandler (code, ethInterface) {
28+ static codeHandler (code, ethInterface = new Interface(new Environment())) {
2929 const instance = Wasm.instantiateModule(code, {
3030 'ethereum': ethInterface
3131 })
3232
interface.jsView
@@ -21,10 +21,10 @@
2121 memPrint () {
2222 console.log((new Uint8Array(MOD.exports.memory)).toString())
2323 }
2424
25- constructor (kernal) {
26- ENV = this.environment = kernal.environment
25+ constructor (environment, kernal) {
26+ ENV = this.environment = environment
2727 self = this
2828 }
2929
3030 setModule (mod) {
tests/interfaceRunner.jsView
@@ -19,10 +19,10 @@
1919 const buffer = fs.readFileSync(`${dir}/${testName}.wasm`)
2020 const envData = fs.readFileSync(`${dir}/${testName}.json`)
2121
2222 const environment = new Environment(envData)
23- const kernel = new Kernel(environment)
24- const ethInterface = new Interface(kernel)
23+ const kernel = new Kernel()
24+ const ethInterface = new Interface(environment, kernel)
2525
2626 try {
2727 const mod = Wasm.instantiateModule(buffer, {'ethereum': ethInterface})
2828 ethInterface.setModule(mod)

Built with git-ssb-web