Navigation Menu

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

fix vault rewards module tests #1088

Merged
merged 3 commits into from Sep 1, 2022
Merged

fix vault rewards module tests #1088

merged 3 commits into from Sep 1, 2022

Conversation

dbeal-eth
Copy link
Contributor

fixes boil down to:

  • using evm_setNextBlockTimestamp instead of just fastForward within
    fastForwardTo-- ensures exact timestamp is delivered
  • recognition that evm_mine always causse the block timestamp to
    incraese by 1 second, so we should be able to account for this in the test to get
    the exact time

also btw the refactoring of these tests was not exactly the same as
before, which is part of the reason why the tests were failing when they
succeeded before

fixes boil down to:
* using `evm_setNextBlockTimestamp` instead of just `fastForward` within
  `fastForwardTo`-- ensures exact timestamp is delivered
* recognition that `evm_mine` always causse the block timestamp to
  incraese by 1 second, so we should be able to account for this in the test to get
the exact time

also btw the refactoring of these tests was not exactly the same as
before, which is part of the reason why the tests were failing when they
succeeded before
@dbeal-eth dbeal-eth self-assigned this Sep 1, 2022
@codecov
Copy link

codecov bot commented Sep 1, 2022

Codecov Report

Merging #1088 (7a5b4ac) into main (bfdaa7d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1088   +/-   ##
=======================================
  Coverage   97.12%   97.12%           
=======================================
  Files          58       58           
  Lines        1044     1044           
  Branches       69       69           
=======================================
  Hits         1014     1014           
  Misses         30       30           
Flag Coverage Δ
core-contracts 95.23% <ø> (ø)
core-modules 83.33% <ø> (ø)
core-utils ∅ <ø> (?)
hardhat-router 97.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dbeal-eth
Copy link
Contributor Author

VaultRewardsModule tests are succeeding, but other upstream tests were failing

@@ -21,13 +21,9 @@ export async function fastForward(seconds: number, provider: ethers.providers.Js
}

export async function fastForwardTo(time: number, provider: ethers.providers.JsonRpcProvider) {
const now = await getTime(provider);
await provider.send('evm_setNextBlockTimestamp', [time]);
Copy link
Member

Choose a reason for hiding this comment

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

Nice! didn't know about evm_setNextBlockTimestamp 👏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@noahlitvin noahlitvin merged commit e2c5654 into main Sep 1, 2022
@noahlitvin noahlitvin deleted the fix-vault-rewards branch September 1, 2022 21:25
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.

None yet

3 participants