Skip to content

Commit

Permalink
some more tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
freemanzMrojo committed Nov 1, 2024
1 parent ae88a55 commit 983eac2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions test/shard1/paymaster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ describe('EntryPoint with paymaster', function () {
}, accountOwner, entryPoint)
await expect(entryPoint.callStatic.handleOps([op], beneficiaryAddress, {
gasLimit: 1e7
}).catch(rethrow())).to.revertedWith('TokenPaymaster: no balance')
})).to.revertedWith('FailedOp').withArgs(0, 'AA33 reverted: TokenPaymaster: no balance (pre-create)')
})

it('should succeed to create account with tokens', async () => {
Expand Down Expand Up @@ -193,7 +193,7 @@ describe('EntryPoint with paymaster', function () {
if (!created) this.skip()
await expect(entryPoint.callStatic.handleOps([createOp], beneficiaryAddress, {
gasLimit: 1e7
})).to.revertedWith('sender already constructed')
})).to.revertedWith('FailedOp').withArgs(0, 'AA10 sender already constructed')
})

it('batched request should each pay for its share', async function () {
Expand Down
12 changes: 6 additions & 6 deletions test/shard2/entrypoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ describe('EntryPoint', function () {
// using wrong nonce
const op = await fillAndSign({ sender: account.address, nonce: 1234 }, accountOwner, entryPoint)
await expect(entryPoint.callStatic.simulateValidation(op)).to
.revertedWith('AA25 invalid account nonce')
.revertedWith('FailedOp').withArgs(0, 'AA25 invalid account nonce')
})

it('should report signature failure without revert', async () => {
Expand All @@ -362,13 +362,13 @@ describe('EntryPoint', function () {
verificationGasLimit: 1000
}, accountOwner, entryPoint)
await expect(entryPoint.callStatic.simulateValidation(op)).to
.revertedWith('AA20 account not deployed')
.revertedWith('FailedOp').withArgs(0, 'AA20 account not deployed')
})

it('should revert on oog if not enough verificationGas', async () => {
const op = await fillAndSign({ sender: account.address, verificationGasLimit: 1000 }, accountOwner, entryPoint)
await expect(entryPoint.callStatic.simulateValidation(op)).to
.revertedWith('AA23 reverted (or OOG)')
.revertedWith('FailedOp').withArgs(0, 'AA23 reverted (or OOG)')
})

it('should succeed if validateUserOp succeeds', async () => {
Expand Down Expand Up @@ -435,7 +435,7 @@ describe('EntryPoint', function () {
}, accountOwner1, entryPoint)
await expect(
entryPoint.callStatic.simulateValidation(op)
).to.revertedWith('gas values overflow')
).to.revertedWith('AA94 gas values overflow')
})

it('should fail creation for wrong sender', async () => {
Expand All @@ -445,7 +445,7 @@ describe('EntryPoint', function () {
verificationGasLimit: 3e6
}, accountOwner1, entryPoint)
await expect(entryPoint.callStatic.simulateValidation(op1))
.to.revertedWith('AA14 initCode must return sender')
.to.revertedWith('FailedOp').withArgs(0, 'AA14 initCode must return sender')
})

it('should report failure on insufficient verificationGas (OOG) for creation', async () => {
Expand All @@ -469,7 +469,7 @@ describe('EntryPoint', function () {
maxFeePerGas: 0
}, accountOwner1, entryPoint)
await expect(entryPoint.callStatic.simulateValidation(op1, { gasLimit: 1e6 }))
.to.revertedWith('AA13 initCode failed or OOG')
.to.revertedWith('FailedOp').withArgs(0, 'AA13 initCode failed or OOG')
})

it('should succeed for creating an account', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/shard3/entrypoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ describe('EntryPoint', function () {

await expect(entryPoint.callStatic.handleOps([createOp], beneficiaryAddress, {
gasLimit: 1e7
})).to.revertedWith('sender already constructed')
})).to.revertedWith('FailedOp').withArgs(0, 'AA10 sender already constructed')
})
})

Expand Down

0 comments on commit 983eac2

Please sign in to comment.