Add ReentrancyGuard status getter (#3714)

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
zhiqiangxu
2022-10-17 20:43:45 +08:00
committed by GitHub
parent c463b8a67e
commit eb03304b70
4 changed files with 28 additions and 0 deletions

View File

@ -23,6 +23,14 @@ contract('ReentrancyGuard', function (accounts) {
this.reentrancyMock.countAndCall(attacker.address), 'ReentrancyAttack: failed call');
});
it('_reentrancyGuardEntered should be true when guarded', async function () {
await this.reentrancyMock.guardedCheckEntered();
});
it('_reentrancyGuardEntered should be false when unguarded', async function () {
await this.reentrancyMock.unguardedCheckNotEntered();
});
// The following are more side-effects than intended behavior:
// I put them here as documentation, and to monitor any changes
// in the side-effects.