DistributedCollective / DistributedCollective/Sovryn-smart-contracts

Refactor Hardhat tests

Open
#257 0 comments 0 reactions 2 assignees View on GitHub

@computerphysicslab is already working on this.

Since Sep 10, 2021.

low priority maintenance
Dominant language
JavaScript
Stars
132
Forks
57
PR merge metrics
No merged PRs in 30d

Description

the tests are slow and can be improved dramatically
suggestions:

  1. snapshot repeating scenarios
    https://ethereum-waffle.readthedocs.io/en/latest/fixtures.html
  2. use mocks
    https://ethereum-waffle.readthedocs.io/en/latest/mock-contract.html
    added a task
  3. beforeEach -> before
    move repetitive beforeEach with redeployment to before whenever possible - when no need to real redeploy (or use p.1)
  4. extract common deployment in tests into a shared functions
    e.g. deployProtocol, deployLoanTokens, deployLiquidityMining and then just call these functions in before or beforeEach

Another idea: https://www.youtube.com/watch?v=vn3tm0quoqE

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.