RiccardoBiosas

Results 20 issues of RiccardoBiosas

**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...

**Context** The current unit/integration tests of the protocol are very extensive and meticulous, however their main 'side-effect' is that they repeat the same assertions to test different scenarios both across...

**Context** The code-base uses both web3 (i.e.: [here](https://github.com/livepeer/protocol/blob/confluence/test/helpers/signMsg.js), [here](https://github.com/livepeer/protocol/blob/confluence/test/unit/TicketBroker.js#L134) and [here](https://github.com/livepeer/protocol/blob/confluence/test/unit/RoundsManager.js#L114)) and ethers.js method, and as mentioned here we should converge towards consistently using ethers.js. In the process, I think...

**Context** The [RPC](https://github.com/livepeer/protocol/blob/confluence/utils/rpc.js) class used to manipulate the state of the local network/take snapshots during the unit/integration tests relies on the web3 library - [which is passed down its constructor...

**Context** Currently `chai` is directly imported on each test file, where it is then attached to the ethereum-waffle's `solidity` chai matcher (i.e.: [here](https://github.com/livepeer/protocol/blob/confluence/test/unit/Governor.js#L8-L9)). Furthermore, there are occurrences where it uses...

**Context** The protocol repo includes some outdated docker setup and bash scripts. **TODO** - [remove docker-compose](https://github.com/livepeer/protocol/blob/confluence/docker-compose.yml) - [remove dockerfile](https://github.com/livepeer/protocol/blob/confluence/Dockerfile) - [remove bash script to run integration tests within the docker...

**Context** It seems that now it's possible to access the HEVM cheatcodes directly via the the[ Forge Standard Library](https://github.com/foundry-rs/forge-std), which is also the [recommended](https://book.getfoundry.sh/forge/forge-std.html) way. Also, the [HEVM/dapptools will not...

**Context** Currently the only way to run the Foundry tests is by issuing the `forge test` command manually. **TODO** - Add the [Foundry test github action](https://book.getfoundry.sh/config/continous-integration.html) as part of the...

Since solidity 0.8.x [all arithmetic is checked by default](https://github.com/ethereum/solidity/blob/develop/Changelog.md#:~:text=Code%20Generator%3A%20All%20arithmetic%20is%20checked%20by%20default.%20These%20checks%20can%20be%20disabled%20using%20unchecked%20%7B%20...%20%7D.) which makes the explicit usage of OpenZeppelin SafeMath unnecessary. As the protocol switched to Solidity 0.8.9, it's safe to remove OZ...

easy

**Context** A lot of the protocol tests are implemented in javascript, which is very error-prone - especially when it comes to its lack of type safety. **Proposal** I think that...