git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit f8c9ead18a27b0962868bf70b4fa256cb3fb1606

added sstore test

wanderer committed on 7/14/2016, 10:03:05 PM
Parent: 2c04524fc8e9b757c060e0e2cf80d26d6d411e57

Files changed

README.mdchanged
environment.jschanged
index.jschanged
interface.jschanged
package.jsonchanged
tests/sstore.jsonadded
tests/sstore.wastadded
debugInterface.jsadded
README.mdView
@@ -1,14 +1,13 @@
11 # SYNOPSIS - WIP
22 [![Gitter](https://img.shields.io/gitter/room/ethereum/ethereumjs-lib.svg?style=flat-square)](https://gitter.im/ethereum/ethereumjs-lib) or #ethereumjs on freenode
3-
43 [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
54
65 This is a JS prototype of the [eWASM kernal](https://github.com/ethereum/evm2.0-design).
76
87
98 # INSTALL
10-You need to compile [nodejs](https://github.com/nodejs/node) from master to run
9+You need to compile [nodejs](https://github.com/nodejs/node) from master to run
1110 ~~`npm install ewasm-kernal`~~
1211
1312 clone and run `npm install`
1413
environment.jsView
@@ -3,26 +3,32 @@
33
44 module.exports = class Environment {
55 constructor (data) {
66 const defaults = {
7+ // gas tank
78 gasCounter: 0, // TODO: gasCounter is only 53 bits
89 gas: 0, // The amount of gas this contract has
910 gasPrice: 0,
1011 gasLimit: 0, // The gas limit for the block
12+ // call infromation
1113 address: new Uint8Array(20),
1214 origin: new Uint8Array(20),
1315 coinbase: new Uint8Array(20),
1416 difficulty: new Uint8Array(20),
1517 caller: new Uint8Array(20),
1618 callValue: new Uint8Array(MAX_BAL_BYTES),
1719 callData: new ArrayBuffer(),
20+ // the ROM
1821 code: new ArrayBuffer(), // the current running code
22+ // output calls
1923 logs: [],
20- returnValue: new ArrayBuffer(),
2124 suicideAddress: new ArrayBuffer(),
22- accounts: new Map()
25+ // more output calls
26+ returnValue: new ArrayBuffer()
2327 }
2428
29+ this.state = new Graph()
30+
2531 if (data) {
2632 data = JSON.parse(data)
2733 Object.assign(this, defaults, data)
2834 } else {
@@ -31,9 +37,8 @@
3137
3238 if (data.accounts) {
3339 this.accounts = new Graph()
3440 const self = this
35- debugger
3641 data.accounts.forEach((account) => {
3742 self.accounts.set(new Uint8Array(account[0]).toString(), account[1])
3843 })
3944 }