Commit b725bc7ad54293c26697f1601c814ec603dc26fc
Environment: add isAccountPresent
Alex Beregszaszi committed on 8/28/2016, 11:54:31 AMParent: cd54c9d2a59c3fbfe2477fd39f5493ec90eebb6b
Files changed
environment.js | changed |
environment.js | ||
---|---|---|
@@ -40,8 +40,17 @@ | ||
40 | 40 | account.set('storage', trie.storage || new Map()) |
41 | 41 | this.state.set(address.toString(), account) |
42 | 42 | } |
43 | 43 | |
44 | + isAccountPresent (address) { | |
45 | + const account = this.state.get(address.toString()) | |
46 | + if (account) { | |
47 | + return true | |
48 | + } else { | |
49 | + return false | |
50 | + } | |
51 | + } | |
52 | + | |
44 | 53 | getBalance (address) { |
45 | 54 | const account = this.state.get(address.toString()) |
46 | 55 | if (account) { |
47 | 56 | return account.get('balance') |
Built with git-ssb-web