Skip to content

Commit

Permalink
test[integration-tests]: l2geth call and creation OOG (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-chain authored May 11, 2021
1 parent c949803 commit 52d9e6b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions integration-tests/test/rpc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ describe('Basic RPC tests', () => {
expectedReverterRevertData = encodeSolidityRevertMessage(revertMessage)
})

it('should correctly identify call out-of-gas', async () => {
await expect(
provider.call({
...revertingTx,
gasLimit: 21_000,
})
).to.be.rejectedWith('out of gas')
})

it('should correctly return solidity revert data from a call', async () => {
const revertData = await provider.call(revertingTx)
const expectedRevertData = encodeSolidityRevertMessage(revertMessage)
Expand All @@ -151,6 +160,15 @@ describe('Basic RPC tests', () => {
expect(revertData).to.eq(expectedReverterRevertData)
})

it('should correctly identify contract creation out of gas', async () => {
await expect(
provider.call({
...revertingDeployTx,
gasLimit: 30_000,
})
).to.be.rejectedWith('out of gas')
})

it('should return the correct error message when attempting to deploy unsafe initcode', async () => {
// PUSH1 0x00 PUSH1 0x00 SSTORE
const unsafeCode = '0x6000600055'
Expand Down

0 comments on commit 52d9e6b

Please sign in to comment.