livepeer / livepeer/protocol

Run all the Solidity tests with Foundry

Open
#576 0 comments 0 reactions 1 assignee View on GitHub

@RiccardoBiosas is already working on this.

Since Jul 11, 2022.

Dominant language
JavaScript
Stars
155
Forks
50
PR merge metrics
No merged PRs in 30d

Description

**Context**
At the moment the protocol code-base includes two types of Solidity tests: [truffle-based Solidity tests](https://github.com/livepeer/protocol/blob/confluence/contracts/test/TestEarningsPool.sol) and [Foundry Solidity tests.](https://github.com/livepeer/protocol/blob/confluence/src/test/BondingManagerTransferBondFix.sol). The truffle-based Solidity tests are run as part of the unit tests via the [`runSolidityTest` helper](https://github.com/livepeer/protocol/blob/confluence/test/unit/helpers/runSolidityTest.js).
I propose to convert them to Foundry tests to enforce more consistency in the code-base and because Foundry is the clear winner in terms of performance and testing capabilities.

**TODO**
- Move the [Solidity tests](https://github.com/livepeer/protocol/tree/confluence/contracts/test) to the Foundry directory
- Make the necessary refactoring to run them as tests with Foundry/forge - i.e.: replacing the `before`, `beforeEach` hooks with `setUp`. I'm estimating the refactoring process should be fairly straightforward
- Remove the [`runSolidityTest` helper](https://github.com/livepeer/protocol/blob/confluence/test/unit/helpers/runSolidityTest.js)

Contributor guide

Open the contributing guide

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.