-
Notifications
You must be signed in to change notification settings - Fork 0
Add some missing test cases to AccountsDepositWithdrawEndowments
..
#401
base: master
Are you sure you want to change the base?
Conversation
…Endowments.ts > from Mature endowments
@@ -512,10 +512,14 @@ describe("AccountsDepositWithdrawEndowments", function () { | |||
// setup an allowed contributor wallet to sign/send | |||
const allowedContributor = await genWallet().address; | |||
await impersonateAccount(allowedContributor); | |||
await setBalance(allowedContributor, 1000000000000000000); // give it some gas money, as impersonateAccount does not | |||
await setBalance(allowedContributor, 1000000000000000000n); // give it some gas money, as impersonateAccount does not |
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.
@@ -1,7 +1,7 @@ | |||
{ | |||
"compilerOptions": { | |||
"baseUrl": ".", | |||
"target": "es2018", | |||
"target": "ES2020", |
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.
Needed to be able to use BigInts (see #401 (comment))
@@ -768,8 +776,22 @@ describe("AccountsDepositWithdrawEndowments", function () { | |||
}); | |||
|
|||
describe("from Non-Mature endowments", () => { | |||
it("reverts if sender is not owner", async () => { |
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.
Added missing test cases (more below)...
We still have many test cases missing, so many of our code paths are not covered.
Tried adding solidity-coverage to our repo, but stumbled upon the the most common issue with it when using viaIR
(we use it), which is sc-forks/solidity-coverage#715
If we remove viaIR
to make coverage work, we get the "Stack Too Deep" error, which is just too big to tackle in this PR, so just removed the coverage tool for now (although it would be very useful to have it).
).to.be.revertedWith("Beneficiary address is not listed in maturityAllowlist"); | ||
}); | ||
|
||
it("reverts if maturity allowlist is empty", async () => { |
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.
More missing test cases
AccountsDepositWithdrawEndowments
..
Explanation of the solution
Instructions on making this work
yarn
oryarn install
to install npm dependencies