Skip to content

Commit

Permalink
fix: Replace error msg on require for consistency (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf authored Mar 8, 2023
1 parent 5ac3ed8 commit 1a235ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ contract GhoVariableDebtToken is DebtTokenBase, ScaledBalanceTokenBase, IGhoVari

/// @inheritdoc IGhoVariableDebtToken
function updateDiscountToken(address newDiscountToken) external override onlyPoolAdmin {
require(newDiscountToken != address(0), 'ZERO_ADDR');
require(newDiscountToken != address(0), 'ZERO_ADDRESS_NOT_VALID');
address oldDiscountToken = address(_discountToken);
_discountToken = IERC20(newDiscountToken);
emit DiscountTokenUpdated(oldDiscountToken, newDiscountToken);
Expand Down
10 changes: 9 additions & 1 deletion src/test/gho-variable-debt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ makeSuite('Gho VariableDebtToken End-To-End', (testEnv: TestEnv) => {
});

it('Set ZERO address as Discount Strategy (revert expected)', async function () {
const { variableDebtToken, deployer, discountRateStrategy } = testEnv;
const { variableDebtToken, deployer } = testEnv;

await expect(
variableDebtToken.connect(deployer.signer).updateDiscountRateStrategy(ZERO_ADDRESS)
Expand All @@ -197,6 +197,14 @@ makeSuite('Gho VariableDebtToken End-To-End', (testEnv: TestEnv) => {
).to.be.revertedWith(ProtocolErrors.CALLER_NOT_POOL_ADMIN);
});

it('Set ZERO address as Discount Token (revert expected)', async function () {
const { variableDebtToken, deployer } = testEnv;

await expect(
variableDebtToken.connect(deployer.signer).updateDiscountToken(ZERO_ADDRESS)
).to.be.revertedWith(ZERO_ADDRESS_NOT_VALID);
});

it('Get Discount Token - before setting', async function () {
const { variableDebtToken, stakedAave } = testEnv;

Expand Down

0 comments on commit 1a235ab

Please sign in to comment.