Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Add tests for AccountsDepositWithdrawEndowments facet #206

Merged
merged 51 commits into from
Jul 19, 2023
Merged

Conversation

0xNeshi
Copy link
Contributor

@0xNeshi 0xNeshi commented Jul 18, 2023

Closes #152

Instructions on making this work

  • run yarn or yarn install to install npm dependencies
  • run yarn test to verify all tests still pass

@0xNeshi 0xNeshi added the enhancement New feature or request label Jul 18, 2023
@0xNeshi 0xNeshi self-assigned this Jul 18, 2023
@0xNeshi 0xNeshi linked an issue Jul 18, 2023 that may be closed by this pull request
@@ -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");
Copy link
Contributor Author

@0xNeshi 0xNeshi Jul 18, 2023

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.

@@ -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 {
Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I have no preference :)

Copy link
Contributor

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.

Copy link
Contributor Author

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

@0xNeshi 0xNeshi merged commit cb32d8c into master Jul 19, 2023
1 check passed
@0xNeshi 0xNeshi deleted the acc-dep-wit-end branch July 19, 2023 11:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add tests for AccountsDepositWithdrawEndowments facet
3 participants