Commit 12253c96876b01e4b82360ffc0099bd87c512338
remove accounts
wanderer committed on 8/9/2016, 2:33:24 PMParent: b4e8a5ed32bd227804b2d620deb826ce64724ec9
Files changed
environment.js | changed |
package.json | changed |
environment.js | ||
---|---|---|
@@ -1,5 +1,4 @@ | ||
1 | -const Graph = require('generic-digraph') | |
2 | 1 | const constants = require('./constants.js') |
3 | 2 | |
4 | 3 | module.exports = class Environment { |
5 | 4 | constructor (data) { |
@@ -34,12 +33,11 @@ | ||
34 | 33 | } |
35 | 34 | |
36 | 35 | Object.assign(this, defaults, data) |
37 | 36 | if (data.accounts) { |
38 | - this.accounts = new Graph() | |
39 | 37 | const self = this |
40 | 38 | 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]) | |
42 | 40 | }) |
43 | 41 | } |
44 | 42 | |
45 | 43 | if (data.address) { |
@@ -63,9 +61,9 @@ | ||
63 | 61 | } |
64 | 62 | } |
65 | 63 | |
66 | 64 | getBalance (address) { |
67 | - return this.accounts.getValue(address.toString()).balance | |
65 | + return this.state.get(address.toString()).balance | |
68 | 66 | } |
69 | 67 | |
70 | 68 | getCode (address) { |
71 | 69 | // STUB |
Built with git-ssb-web