Skip to content

Commit 013c7ec

Browse files
vm: fix tests
1 parent ef0e70c commit 013c7ec

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

packages/vm/test/api/EIPs/eip-3855.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
2-
import { EVMErrorMessage } from '@ethereumjs/evm'
2+
import { EVMErrorCode } from '@ethereumjs/evm'
33
import { hexToBytes } from '@ethereumjs/util'
44
import { assert, describe, it } from 'vitest'
55

@@ -65,7 +65,7 @@ describe('EIP 3855 tests', () => {
6565
gasLimit: BigInt(10000),
6666
})
6767

68-
assert.equal(result.exceptionError?.error, EVMErrorMessage.STACK_OVERFLOW)
68+
assert.equal(result.exceptionError?.type.code, EVMErrorCode.STACK_OVERFLOW)
6969
})
7070

7171
it('push0 is not available if EIP3855 is not activated', async () => {
@@ -76,6 +76,6 @@ describe('EIP 3855 tests', () => {
7676
gasLimit: BigInt(10000),
7777
})
7878

79-
assert.equal(result.exceptionError!.error, EVMErrorMessage.INVALID_OPCODE)
79+
assert.equal(result.exceptionError!.type.code, EVMErrorCode.INVALID_OPCODE)
8080
})
8181
})

packages/vm/test/api/EIPs/eip-3860.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('EIP 3860 tests', () => {
4040
).sign(pkey)
4141
const result = await runTx(vm, { tx })
4242
assert.ok(
43-
(result.execResult.exceptionError?.error as string) === 'initcode exceeds max initcode size',
43+
result.execResult.exceptionError?.type.code === 'initcode exceeds max initcode size',
4444
'initcode exceeds max size',
4545
)
4646
})

packages/vm/test/api/istanbul/eip-1344.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
2-
import { EVMErrorMessage } from '@ethereumjs/evm'
2+
import { EVMErrorCode } from '@ethereumjs/evm'
33
import { bytesToBigInt, hexToBytes } from '@ethereumjs/util'
44
import { assert, describe, it } from 'vitest'
55

66
import { createVM } from '../../../src/index.js'
77

88
const testCases = [
99
{ chain: Mainnet, hardfork: Hardfork.Istanbul, chainId: BigInt(1) },
10-
{ chain: Mainnet, hardfork: Hardfork.Constantinople, err: EVMErrorMessage.INVALID_OPCODE },
10+
{ chain: Mainnet, hardfork: Hardfork.Constantinople, err: EVMErrorCode.INVALID_OPCODE },
1111
]
1212

1313
// CHAINID PUSH8 0x00 MSTORE8 PUSH8 0x01 PUSH8 0x00 RETURN
@@ -27,7 +27,7 @@ describe('Istanbul: EIP-1344', () => {
2727
try {
2828
const res = await vm.evm.runCode!(runCodeArgs)
2929
if (testCase.err !== undefined) {
30-
assert.equal(res.exceptionError?.error, testCase.err)
30+
assert.equal(res.exceptionError?.type.code, testCase.err)
3131
} else {
3232
assert.ok(res.exceptionError === undefined)
3333
assert.equal(testCase.chainId, bytesToBigInt(res.returnValue))

packages/vm/test/api/istanbul/eip-1884.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
2-
import { EVMErrorMessage } from '@ethereumjs/evm'
2+
import { EVMErrorCode } from '@ethereumjs/evm'
33
import { Address, bytesToBigInt, hexToBytes } from '@ethereumjs/util'
44
import { assert, describe, it } from 'vitest'
55

@@ -8,7 +8,7 @@ import { createAccountWithDefaults } from '../utils.js'
88

99
const testCases = [
1010
{ chain: Mainnet, hardfork: Hardfork.Istanbul, selfbalance: '0xf1' },
11-
{ chain: Mainnet, hardfork: Hardfork.Constantinople, err: EVMErrorMessage.INVALID_OPCODE },
11+
{ chain: Mainnet, hardfork: Hardfork.Constantinople, err: EVMErrorCode.INVALID_OPCODE },
1212
]
1313

1414
// SELFBALANCE PUSH8 0x00 MSTORE8 PUSH8 0x01 PUSH8 0x00 RETURN
@@ -35,7 +35,7 @@ describe('Istanbul: EIP-1884', () => {
3535
try {
3636
const res = await vm.evm.runCode!(runCodeArgs)
3737
if (testCase.err !== undefined) {
38-
assert.equal(res.exceptionError?.error, testCase.err)
38+
assert.equal(res.exceptionError?.type.code, testCase.err)
3939
} else {
4040
assert.ok(res.exceptionError === undefined)
4141
assert.ok(BigInt(testCase.selfbalance!) === bytesToBigInt(res.returnValue))

packages/vm/test/api/runTx.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ describe('runTx() -> runtime errors', () => {
492492
const res = await runTx(vm, { tx })
493493

494494
assert.equal(
495-
res.execResult!.exceptionError!.error,
495+
res.execResult!.exceptionError!.type.code,
496496
'value overflow',
497497
`result should have 'value overflow' error set (${txType.name})`,
498498
)
@@ -520,7 +520,7 @@ describe('runTx() -> runtime errors', () => {
520520
const res = await runTx(vm, { tx })
521521

522522
assert.equal(
523-
res.execResult!.exceptionError!.error,
523+
res.execResult!.exceptionError!.type.code,
524524
'value overflow',
525525
`result should have 'value overflow' error set (${txType.name})`,
526526
)

0 commit comments

Comments
 (0)