Skip to content

Commit

Permalink
Merge pull request #48 from vechain/add_tests
Browse files Browse the repository at this point in the history
test: test for pre-shanghai
  • Loading branch information
leszek-vechain authored Aug 14, 2024
2 parents f9ebbb6 + 63046ce commit 1fb8c2c
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions test/evm/individual-opcodes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,22 @@ describe('Individual OpCodes', () => {
},
)

it.e2eTest(
'should give the correct output for opcode: BASEFEE',
'all',
async () => {
const debugged = await traceContractCall(
opcodesInterface.encodeFunctionData('BASEFEE'),
'BASEFEE',
true,
)

expect(
debugged.structLogs[debugged.structLogs.length - 1].error,
).toBe('invalid opcode 0x48')
},
)

it.e2eTest(
'should give the correct output for opcode: INVALID',
'all',
Expand Down Expand Up @@ -567,4 +583,26 @@ describe('Individual OpCodes', () => {
expect(simulation.body?.[0]?.vmError).toEqual('invalid opcode 0x5f')
},
)

it.e2eTest(
'should be possible to deploy contract starting with 0xEF',
'all',
async () => {
const contractBytecode = '0x60ef60005360016000f3'
const clauses = [
{
to: null,
value: '0x0',
data: contractBytecode,
},
]

const simulation = await Client.raw.executeAccountBatch({
clauses,
caller,
})

expect(simulation.body?.[0]?.vmError).toBeEmpty()
},
)
})

0 comments on commit 1fb8c2c

Please sign in to comment.