Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contracts: Model custom errors #81

Merged
merged 10 commits into from
Jul 29, 2023
Merged

Conversation

lgalende
Copy link
Contributor

This PR replaces require strings with custom errors.
TODO: use revertedWithCustomError in tests (https://hardhat.org/hardhat-chai-matchers/docs/reference#.revertedwithcustomerror)

@lgalende lgalende self-assigned this Jul 25, 2023
packages/authorizer/contracts/Authorizer.sol Outdated Show resolved Hide resolved
packages/authorizer/contracts/interfaces/IAuthorizer.sol Outdated Show resolved Hide resolved
packages/authorizer/contracts/interfaces/IAuthorizer.sol Outdated Show resolved Hide resolved
packages/authorizer/contracts/interfaces/IAuthorizer.sol Outdated Show resolved Hide resolved
packages/smart-vault/contracts/SmartVault.sol Outdated Show resolved Hide resolved
packages/helpers/contracts/math/FixedPoint.sol Outdated Show resolved Hide resolved
packages/smart-vault/contracts/SmartVault.sol Outdated Show resolved Hide resolved
packages/smart-vault/contracts/SmartVault.sol Outdated Show resolved Hide resolved
packages/tasks/contracts/base/GasLimitedTask.sol Outdated Show resolved Hide resolved
packages/tasks/contracts/base/PausableTask.sol Outdated Show resolved Hide resolved
packages/tasks/contracts/base/PausableTask.sol Outdated Show resolved Hide resolved
packages/tasks/contracts/bridge/ConnextBridger.sol Outdated Show resolved Hide resolved
packages/tasks/contracts/liquidity/curve/BaseCurveTask.sol Outdated Show resolved Hide resolved
packages/tasks/contracts/primitives/Depositor.sol Outdated Show resolved Hide resolved
packages/tasks/contracts/swap/BaseSwapTask.sol Outdated Show resolved Hide resolved
@@ -223,7 +221,7 @@ describe('BaseTask', () => {

context('when there is not enough balance in the connector', () => {
it('reverts', async () => {
await expect(task.call(token, amount)).to.be.revertedWith('SMART_VAULT_CONNECTOR_NO_BALANCE')
await expect(task.call(token, amount)).to.be.reverted
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened here?

@facuspagnuolo facuspagnuolo merged commit 271cec9 into master Jul 29, 2023
22 of 23 checks passed
@facuspagnuolo facuspagnuolo deleted the contracts/model_error_messages branch July 29, 2023 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants