Skip to content

Commit

Permalink
Simplify options in StateManager
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Feb 3, 2018
1 parent 4d01603 commit fe82d0b
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions lib/stateManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,13 @@ const rlp = utils.rlp

module.exports = StateManager

function StateManager (opts) {
function StateManager (opts = {}) {
var self = this

var trie = opts.trie
if (!trie) {
trie = new Trie(trie)
}

var blockchain = opts.blockchain
if (!blockchain) {
blockchain = fakeBlockchain
}

self.blockchain = blockchain
self.trie = trie
self.blockchain = opts.blockchain || fakeBlockchain
self.trie = opts.trie || new Trie()
self._storageTries = {} // the storage trie cache
self.cache = new Cache(trie)
self.cache = new Cache(self.trie)
self.touched = []
}

Expand Down

0 comments on commit fe82d0b

Please sign in to comment.