Skip to content

Commit

Permalink
contracts: removed confusing tx reversion tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CedarMist committed Oct 30, 2023
1 parent 66c8ab8 commit 419d64d
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions contracts/test/semantics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ describe('EVM Semantics', () => {
}
});

// Apparently `expect().to.be.revertedWithCustomError` doesn't work sometimes
// Otherwise we could do this:
//expect(c.testCustomRevert()).to.be.revertedWithCustomError(c, 'CustomError').withArgs(errorNum);
//expect(c.testCustomViewRevert()).to.be.revertedWithCustomError(c, 'CustomError').withArgs(errorNum);

it('Error string in view call', async () => {
try {
await c.testViewRevert();
Expand All @@ -45,19 +40,6 @@ describe('EVM Semantics', () => {
}
});

it('Error string in tx', async () => {
// Perform transaction which is expected to revert
try {
const tx = await c.testRevert();
await tx.wait();
expect(false).to.be.true;
} catch (x: any) {
expect(x.data).eq(
'0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000d546869734973416e4572726f7200000000000000000000000000000000000000',
);
}
});

it('Custom revert in view call', async () => {
// Perform view call, which is expected to revert
try {
Expand All @@ -68,15 +50,4 @@ describe('EVM Semantics', () => {
expect(x.errorName).to.eq('CustomError');
}
});

it('Custom error in tx', async () => {
// Perform transaction which is expected to revert
try {
const tx = await c.testCustomRevert();
await tx.wait();
expect(false).to.be.true;
} catch (x: any) {
expect(x.data).eq('0x110b3655' + ERROR_NUM.slice(2));
}
});
});

0 comments on commit 419d64d

Please sign in to comment.