git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 63c9d288b4797cd12ec12e080e84ed2559b14e63

Use constants in Environment

Alex Beregszaszi committed on 8/3/2016, 10:09:22 PM
Parent: cb095bce6e57caeb9ca92d94f1ec0b3c44f08c08

Files changed

environment.jschanged
environment.jsView
@@ -1,6 +1,6 @@
11 const Graph = require('generic-digraph')
2-const MAX_BAL_BYTES = require('./constants.js').MAX_BAL_BYTES
2+const constants = require('./constants.js')
33
44 module.exports = class Environment {
55 constructor (data) {
66 const defaults = {
@@ -8,14 +8,14 @@
88 gasPrice: 0,
99 gasLimit: 0, // The gas limit for the block
1010 gasRefund: 0,
1111 // call infromation
12- address: new Uint8Array(20),
13- origin: new Uint8Array(20),
14- coinbase: new Uint8Array(20),
12+ address: new Uint8Array(constants.ADD_SIZE_BYTES),
13+ origin: new Uint8Array(constants.ADD_SIZE_BYTES),
14+ coinbase: new Uint8Array(constants.ADD_SIZE_BYTES),
1515 difficulty: new Uint8Array(20),
16- caller: new Uint8Array(20),
17- callValue: new Uint8Array(MAX_BAL_BYTES),
16+ caller: new Uint8Array(constants.ADD_SIZE_BYTES),
17+ callValue: new Uint8Array(constants.MAX_BAL_BYTES),
1818 callData: new ArrayBuffer(),
1919 // the ROM
2020 code: new ArrayBuffer(), // the current running code
2121 // output calls

Built with git-ssb-web