https://github.com/kalloc/smock-reverts-bug
https://github.com/kalloc/smock-reverts-bug
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/kalloc/smock-reverts-bug
- Owner: kalloc
- Created: 2022-12-18T19:41:46.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-18T21:20:34.000Z (over 3 years ago)
- Last Synced: 2025-02-07T20:13:06.426Z (over 1 year ago)
- Language: TypeScript
- Size: 164 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# The feature reverting with message is not working yet
Expected successful revert with a message for the nested contract call.
Using very simple contracts:
```solidity
contract B {
int counter;
function test()
public
returns(int) {
counter+=1;
return counter;
}
}
contract A {
address public b;
constructor(address dep) {
b = dep;
}
function test() public returns(bool) {
return B(b).test() > 0;
}
}
```
Example test below:
```typescript
fakeB.test.reverts(`Message`);
await expect(contract.test())
.to.be.revertedWith("Message");
```
But got error:
```bash
$ hardhat test
Test
A
1) should be reverted with message
0 passing (684ms)
1 failing
1) Test
A
should be reverted with message:
AssertionError: Expected transaction to be reverted with reason 'Message', but it reverted without a reason
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Context. (test/alphazilla.ts:36:17)
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```
Update: reported https://github.com/defi-wonderland/smock/issues/152