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

Upgrade to ethereumjs-util v6.2.0 #621

Merged
merged 1 commit into from
Nov 21, 2019
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"ethereumjs-blockchain": "^4.0.2",
"ethereumjs-common": "^1.3.2",
"ethereumjs-tx": "^2.1.1",
"ethereumjs-util": "~6.1.0",
"ethereumjs-util": "^6.2.0",
"fake-merkle-patricia-tree": "^1.0.1",
"functional-red-black-tree": "^1.0.1",
"merkle-patricia-tree": "^2.3.2",
Expand Down
22 changes: 11 additions & 11 deletions tests/api/bloom.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,42 +22,42 @@ tape('bloom', (t) => {
const vector = Buffer.from(hex, 'hex')

const b = new Bloom(vector)
st.true(b.check(utils.toBuffer('value 1')), 'should contain string "value 1"')
st.true(b.check(utils.toBuffer('value 2')), 'should contain string "value 2"')
st.true(b.check(Buffer.from('value 1', 'utf8')), 'should contain string "value 1"')
st.true(b.check(Buffer.from('value 2', 'utf8')), 'should contain string "value 2"')
st.end()
})

t.test('check shouldnt be tautology', (st) => {
const b = new Bloom()
st.false(b.check(utils.toBuffer('random value')), 'should not contain string "random value"')
st.false(b.check(Buffer.from('random value', 'utf8')), 'should not contain string "random value"')
st.end()
})

t.test('should correctly add value', (st) => {
const b = new Bloom()
b.add(utils.toBuffer('value'))
let found = b.check(utils.toBuffer('value'))
b.add(Buffer.from('value', 'utf8'))
let found = b.check(Buffer.from('value', 'utf8'))
st.true(found, 'should contain added value')
st.end()
})

t.test('should check multiple values', (st) => {
const b = new Bloom()
b.add(utils.toBuffer('value 1'))
b.add(utils.toBuffer('value 2'))
let found = b.multiCheck([utils.toBuffer('value 1'), utils.toBuffer('value 2')])
b.add(Buffer.from('value 1', 'utf8'))
b.add(Buffer.from('value 2', 'utf8'))
let found = b.multiCheck([Buffer.from('value 1'), Buffer.from('value 2')])
st.true(found, 'should contain both values')
st.end()
})

t.test('should or two filters', (st) => {
const b1 = new Bloom()
b1.add(utils.toBuffer('value 1'))
b1.add(Buffer.from('value 1', 'utf8'))
const b2 = new Bloom()
b2.add(utils.toBuffer('value 2'))
b2.add(Buffer.from('value 2', 'utf8'))

b1.or(b2)
st.true(b1.check(utils.toBuffer('value 2')), 'should contain "value 2" after or')
st.true(b1.check(Buffer.from('value 2', 'utf-8')), 'should contain "value 2" after or')
st.end()
})

Expand Down
2 changes: 1 addition & 1 deletion tests/api/istanbul/eip-1884.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tape('Istanbul: EIP-1884: SELFBALANCE', async (t) => {
const common = new Common(testCase.chain, testCase.hardfork)
const vm = new VM({ common })
const state = new PStateManager(vm.stateManager)
const account = createAccount('00', testCase.selfbalance)
const account = createAccount('0x00', testCase.selfbalance)
await state.putAccount(addr, account)
try {
const res = await vm.runCode(runCodeArgs)
Expand Down
2 changes: 1 addition & 1 deletion tests/api/istanbul/eip-2200.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tape('Istanbul: EIP-2200: net-metering SSTORE', async (t) => {
const vm = new VM({ common })
const state = new PStateManager(vm.stateManager)

const account = createAccount('00', '00')
const account = createAccount('0x00', '0x00')
await state.putAccount(addr, account)
await state.putContractCode(addr, Buffer.from(testCase.code, 'hex'))
if (!testCase.original.isZero()) {
Expand Down