Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update of ethereumjs-util to v6.0.0 #369

Merged
merged 3 commits into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/hooked.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function createHookedVm (opts, hooks) {
results._exists = results.nonce !== '0x0' || results.balance !== '0x0' || results._code !== '0x'
// console.log('fetch account results:', results)
var account = new Account(results)
// not used but needs to be anything but the default (ethUtil.SHA3_NULL)
// not used but needs to be anything but the default (ethUtil.KECCAK256_NULL)
// code lookups are handled by `codeStore`
account.codeHash = ZERO_BUFFER.slice()
cb(null, account)
Expand Down
2 changes: 1 addition & 1 deletion lib/stateManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ proto.accountIsEmpty = function (address, cb) {
return cb(err)
}

cb(null, account.nonce.toString('hex') === '' && account.balance.toString('hex') === '' && account.codeHash.toString('hex') === utils.SHA3_NULL_S)
cb(null, account.nonce.toString('hex') === '' && account.balance.toString('hex') === '' && account.codeHash.toString('hex') === utils.KECCAK256_NULL_S)
})
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"ethereumjs-account": "^2.0.3",
"ethereumjs-block": "~2.0.1",
"ethereumjs-common": "~0.4.0",
"ethereumjs-util": "^5.2.0",
"ethereumjs-util": "^6.0.0",
"fake-merkle-patricia-tree": "^1.0.1",
"functional-red-black-tree": "^1.0.1",
"merkle-patricia-tree": "^2.1.2",
Expand Down
4 changes: 2 additions & 2 deletions tests/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tape('VM with fake blockchain', (t) => {
t.test('should insantiate without params', (st) => {
const vm = new VM()
st.ok(vm.stateManager)
st.equal(vm.stateManager.trie.root, util.KECCAK256_RLP, 'it has default trie')
st.deepEqual(vm.stateManager.trie.root, util.KECCAK256_RLP, 'it has default trie')
st.ok(vm.blockchain.fake, 'it has fake blockchain by default')
st.end()
})
Expand Down Expand Up @@ -47,7 +47,7 @@ tape('VM with fake blockchain', (t) => {
tape('VM with blockchain', (t) => {
t.test('should instantiate', (st) => {
const vm = setupVM()
st.equal(vm.stateManager.trie.root, util.KECCAK256_RLP, 'it has default trie')
st.deepEqual(vm.stateManager.trie.root, util.KECCAK256_RLP, 'it has default trie')
st.notOk(vm.stateManager.fake, 'it doesn\'t have fake blockchain')
st.end()
})
Expand Down
4 changes: 2 additions & 2 deletions tests/api/stateManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ tape('StateManager', (t) => {
t.test('should instantiate', (st) => {
const stateManager = new StateManager()

st.equal(stateManager.trie.root, util.KECCAK256_RLP, 'it has default root')
st.deepEqual(stateManager.trie.root, util.KECCAK256_RLP, 'it has default root')
stateManager.getStateRoot((err, res) => {
st.error(err, 'getStateRoot returns no error')
st.equal(res, util.KECCAK256_RLP, 'it has default root')
st.deepEqual(res, util.KECCAK256_RLP, 'it has default root')
})

st.equal(stateManager._common.hardfork(), 'byzantium', 'it has default hardfork')
Expand Down