-
Notifications
You must be signed in to change notification settings - Fork 2
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
Improve test fixtures #64
Conversation
AcreRouter contract should manage ERC4626 vaults within the Acre system. Owner of the contract should be able to add or remove vaults.
Upgradability will be handled down the road in a separate PR(s)
Get contract deployed with hardhat deployment scripts to use them in tests.
Hardhat have named signers that can be defined in the hardhat.config.ts file and unnamed signers. We need to use them separately in tests.
- use Acre and TBTC contracts deployed with hardhat dpeloyment scripts - use unnamed signers as stakers, to not overlap with named signers (deployer and governance)
As per #58 (comment) realpath is not available out of the box on OSX. Instead of installing additional package, we changed the way the path is resolved.
- Renamed VauldAdded->VaultAuthorized and VaultRemoved->VaultDeauthorized events - Returning vaults array instead of vaults array length
- Replaced Address type with a String type - Added test fixture just like we have in Acre.test.ts - Various renames
* @returns Map of named Hardhat Ethers Signers. | ||
*/ | ||
export async function getNamedSigner(): Promise<{ | ||
[name: string]: HardhatEthersSigner |
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.
Let's define type eg. type NamedSigners = { [name: string]: HardhatEthersSigner }
and we can use it in the line below:
const namedSigners: NamedSigners = {}
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.
This is a straightforward mapping holding broadly used HardhatEthersSigner
properties.
When you use the function, you see what to expect:
With NamedSigners
type, you don't see right away what the function will return:
IMHO, it will be more convenient for development to define this helper function using the current approach, HardhatEthersSigner,
rather than a custom type.
AcreRouter contract should manage ERC4626 vaults within the Acre ecosystem. Owner of the contract should be able to add or remove vaults. There's a `Vault` struct inside of the `AcreRouter` that holds only one boolean `approved`. This struct will grow in the next PR(s) adding things like "distribution percent" for each vault.
Co-authored-by: Rafał Czajkowski <[email protected]>
Fix `@typescript-eslint/return-await` error returned by eslint.
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.
lgtm. Leaving final approval to @r-czajkowski because of the unresolved comments.
We need to merge this PR. We will handle otustanding comments in a follow-up PR.
Depends on: #58
Improve test fixtures used in Acre contract tests:
hardhat.config.ts
.ethers.getSigners()
returns all signers, regardless of whether it is a Hardhat named or unnamed accountThis PR contains changes from #62 which were unintentionally merged to this branch.