Skip to content

Commit

Permalink
fix(TWABDelegator): shorten require message
Browse files Browse the repository at this point in the history
  • Loading branch information
PierrickGT committed Feb 28, 2022
1 parent 82049ef commit a1c54fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/TWABDelegator.sol
Expand Up @@ -583,7 +583,7 @@ contract TWABDelegator is ERC20, LowLevelDelegator, PermitAndMulticall {
function _requireDelegatorOrRepresentative(address _delegator) internal view {
require(
_delegator == msg.sender || representatives[_delegator][msg.sender],
"TWABDelegator/not-delegator-or-rep"
"TWABDelegator/not-dlgtr-or-rep"
);
}

Expand Down
8 changes: 4 additions & 4 deletions test/TWABDelegator.test.ts
Expand Up @@ -262,7 +262,7 @@ describe('Test Set Name', () => {
it('should fail to create delegation if delegator is address zero', async () => {
await expect(
twabDelegator.createDelegation(AddressZero, 0, firstDelegatee.address, MAX_EXPIRY),
).to.be.revertedWith('TWABDelegator/not-delegator-or-rep');
).to.be.revertedWith('TWABDelegator/not-dlgtr-or-rep');
});

it('should fail to create delegation if delegatee is address zero', async () => {
Expand Down Expand Up @@ -396,7 +396,7 @@ describe('Test Set Name', () => {
twabDelegator
.connect(stranger)
.updateDelegatee(owner.address, 0, secondDelegatee.address, 0),
).to.be.revertedWith('TWABDelegator/not-delegator-or-rep');
).to.be.revertedWith('TWABDelegator/not-dlgtr-or-rep');
});

it('should fail to update a delegatee if delegatee address passed is address zero', async () => {
Expand Down Expand Up @@ -540,7 +540,7 @@ describe('Test Set Name', () => {
it('should fail to transfer tickets to a delegation if delegator passed is not a delegator', async () => {
await expect(
twabDelegator.fundDelegationFromStake(stranger.address, 0, amount),
).to.be.revertedWith('TWABDelegator/not-delegator-or-rep');
).to.be.revertedWith('TWABDelegator/not-dlgtr-or-rep');
});

it('should fail to transfer tickets to a delegation if amount passed is not greater than zero', async () => {
Expand Down Expand Up @@ -631,7 +631,7 @@ describe('Test Set Name', () => {
it('should fail to withdraw from a delegation to the stake if caller is not the delegator or representative of the delegation', async () => {
await expect(
twabDelegator.connect(stranger).withdrawDelegationToStake(owner.address, 0, amount),
).to.be.revertedWith('TWABDelegator/not-delegator-or-rep');
).to.be.revertedWith('TWABDelegator/not-dlgtr-or-rep');
});

it('should fail to withdraw from a delegation to the stake an inexistent delegation', async () => {
Expand Down

0 comments on commit a1c54fa

Please sign in to comment.