-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95c223a
commit e7a7da5
Showing
3 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// This test ensures that label can be set for an address | ||
interface CheatCodes { | ||
function label(address, string memory) external; | ||
} | ||
|
||
contract LabelContract { | ||
function testLabel() public { | ||
assert(false); | ||
} | ||
} | ||
|
||
contract TestContract { | ||
|
||
function test() public { | ||
// Obtain our cheat code contract reference. | ||
CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D); | ||
|
||
// Create a contract | ||
LabelContract alice = new LabelContract(); | ||
|
||
// set label and verify. | ||
cheats.label(address(alice), "Alice"); | ||
alice.testLabel(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters