-
Notifications
You must be signed in to change notification settings - Fork 0
Add tests for AccountsDepositWithdrawEndowments facet #206
Conversation
@@ -97,6 +99,7 @@ contract AccountsDepositWithdrawEndowments is | |||
AccountStorage.State storage state = LibAccounts.diamondStorage(); | |||
AccountStorage.Endowment storage tempEndowment = state.ENDOWMENTS[details.id]; | |||
|
|||
// is it possible to have tokenAddress == address(0) | |||
require(tokenAddress != address(0), "Invalid ERC20 token"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is never possible to have tokenAddress == address(0)
.
If we do not count the possibility that WMATIC
address might not be set in the Registrar, then there are no test cases where this check could ever fail in this internal function.
contracts/core/accounts/facets/AccountsDepositWithdrawEndowments.sol
Outdated
Show resolved
Hide resolved
test/utils/helpers/types.ts
Outdated
@@ -22,3 +22,17 @@ export enum VaultActionStatus { | |||
FAIL_TOKENS_RETURNED, // Tokens returned to accounts contract | |||
FAIL_TOKENS_FALLBACK, // Tokens failed to be returned to accounts contract | |||
} | |||
|
|||
export enum VaultType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: all of these types should probably be better placed in test/types.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no preference :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, no real preference here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will update in some of the future refactor PRs
Closes #152
Instructions on making this work
yarn
oryarn install
to install npm dependenciesyarn test
to verify all tests still pass