git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 149ab676e7bbe8b9f0100bacfa0aca71c6a1ca27

TestEnvironment: set balances properly

Alex Beregszaszi committed on 8/17/2016, 12:53:57 AM
Parent: 953c34e7f7eb6e1ff41fa8f1cd161a1f62909b34

Files changed

testEnvironment.jschanged
testEnvironment.jsView
@@ -1,7 +1,8 @@
11 const Environment = require('./environment.js')
22 const U256 = require('./u256.js')
33 const Address = require('./address.js')
4+const BN = require('bn.js')
45
56 module.exports = class TestEnvironment extends Environment {
67 constructor (data) {
78 super()
@@ -13,9 +14,12 @@
1314 let self = this
1415
1516 if (data.accounts) {
1617 data.accounts.forEach((account) => {
17- self.state.set(new Address(new Uint8Array(account[0])).toString(), account[1])
18+ let tmp = account[1]
19+ self.state.set(new Address(new Uint8Array(account[0])).toString(), {
20+ balance: new U256(new BN(tmp.balance, 16, 'le'))
21+ })
1822 })
1923 }
2024
2125 if (data.address) {

Built with git-ssb-web