git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 6c9a7f1801d055fef0ca11b55a4047a6360bccd6

TestEnvironment: use Address type

Alex Beregszaszi committed on 8/16/2016, 11:12:39 PM
Parent: d3a050a5491cb0c8f228c86cf23e8cf4725e2038

Files changed

testEnvironment.jschanged
testEnvironment.jsView
@@ -1,6 +1,7 @@
11 const Environment = require('./environment.js')
22 const U256 = require('./u256.js')
3+const Address = require('./address.js')
34
45 module.exports = class TestEnvironment extends Environment {
56 constructor (data) {
67 super()
@@ -12,22 +13,22 @@
1213 let self = this
1314
1415 if (data.accounts) {
1516 data.accounts.forEach((account) => {
16- self.state.set(new Uint8Array(account[0]).toString(), account[1])
17+ self.state.set(new Address(new Uint8Array(account[0])).toString(), account[1])
1718 })
1819 }
1920
2021 if (data.address) {
21- self.address = new Uint8Array(data.address)
22+ self.address = new Address(new Uint8Array(data.address))
2223 }
2324
2425 if (data.origin) {
25- self.origin = new Uint8Array(data.origin)
26+ self.origin = new Address(new Uint8Array(data.origin))
2627 }
2728
2829 if (data.caller) {
29- self.caller = new Uint8Array(data.caller)
30+ self.caller = new Address(new Uint8Array(data.caller))
3031 }
3132
3233 if (data.coinbase) {
3334 self.coinbase = new Uint8Array(data.coinbase)

Built with git-ssb-web