Skip to content

Commit e6be8f1

Browse files
felipelincolnarr00
authored andcommitted
Add view modifier to ERC20Allowlist.allowed (#154)
Co-authored-by: Arr00 <[email protected]>
1 parent 4b8b87f commit e6be8f1

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

contracts/token/ERC20/extensions/ERC20Allowlist.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ abstract contract ERC20Allowlist is ERC20 {
4040
/**
4141
* @dev Returns the allowed status of an account.
4242
*/
43-
function allowed(address account) public virtual returns (bool) {
43+
function allowed(address account) public view virtual returns (bool) {
4444
return _allowed[account];
4545
}
4646

test/token/ERC20/extensions/ERC20Allowlist.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,5 +156,17 @@ describe('ERC20Allowlist', function () {
156156
);
157157
});
158158
});
159+
160+
describe('allowed', function () {
161+
it('returns 1 when allowed', async function () {
162+
await this.token.$_allowUser(this.holder);
163+
await expect(this.token.allowed(this.holder)).to.eventually.equal(true);
164+
});
165+
166+
it('returns 0 when disallowed', async function () {
167+
await this.token.$_disallowUser(this.holder);
168+
await expect(this.token.allowed(this.holder)).to.eventually.equal(false);
169+
});
170+
});
159171
});
160172
});

0 commit comments

Comments
 (0)