git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 12253c96876b01e4b82360ffc0099bd87c512338

remove accounts

wanderer committed on 8/9/2016, 2:33:24 PM
Parent: b4e8a5ed32bd227804b2d620deb826ce64724ec9

Files changed

environment.jschanged
package.jsonchanged
environment.jsView
@@ -1,5 +1,4 @@
1-const Graph = require('generic-digraph')
21 const constants = require('./constants.js')
32
43 module.exports = class Environment {
54 constructor (data) {
@@ -34,12 +33,11 @@
3433 }
3534
3635 Object.assign(this, defaults, data)
3736 if (data.accounts) {
38- this.accounts = new Graph()
3937 const self = this
4038 data.accounts.forEach((account) => {
41- self.accounts.set(new Uint8Array(account[0]).toString(), account[1])
39+ self.state.set(new Uint8Array(account[0]).toString(), account[1])
4240 })
4341 }
4442
4543 if (data.address) {
@@ -63,9 +61,9 @@
6361 }
6462 }
6563
6664 getBalance (address) {
67- return this.accounts.getValue(address.toString()).balance
65+ return this.state.get(address.toString()).balance
6866 }
6967
7068 getCode (address) {
7169 // STUB
package.jsonView
@@ -34,7 +34,6 @@
3434 "Wasm"
3535 ]
3636 },
3737 "dependencies": {
38- "generic-digraph": "^3.1.1"
3938 }
4039 }

Built with git-ssb-web