From f29d8bc89778f462f45880664ff28680d7033699 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 29 Sep 2022 14:47:03 +0200 Subject: [PATCH] docs: document no param expectRevert change (#657) --- src/cheatcodes/expect-revert.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cheatcodes/expect-revert.md b/src/cheatcodes/expect-revert.md index d21b4e56a..0faefb659 100644 --- a/src/cheatcodes/expect-revert.md +++ b/src/cheatcodes/expect-revert.md @@ -24,7 +24,7 @@ This means, for example, we can call [`prank`](./prank.md) immediately before th There are 3 signatures: -- **Without parameters**: Asserts that the next call reverts **without** a message. +- **Without parameters**: Asserts that the next call reverts, regardless of the message. - **With `bytes4`**: Asserts that the next call reverts with the specified 4 bytes. - **With `bytes`**: Asserts that the next call reverts with the specified bytes. @@ -70,17 +70,17 @@ vm.expectRevert( ); ``` -If you need to assert that a function reverts _without_ a message, you can do so with `expectRevert()`. +If you need to assert that a function reverts _without_ a message, you can do so with `expectRevert(bytes(""))`. ```solidity function testExpectRevertNoReason() public { Reverter reverter = new Reverter(); - vm.expectRevert(); + vm.expectRevert(bytes("")); reverter.revertWithoutReason(); } ``` -You can also have multiple `expectRevert()` checks in a single test. +You can also have multiple `expectRevert()` checks in a single test. ```solidity function testMultipleExpectReverts() public {