livepeer / livepeer/protocol

Structs not being validated exhaustively

Open
#562 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Some public/external functions (i.e.: [here](https://github.com/livepeer/protocol/blob/confluence/contracts/pm/mixins/MixinReserve.sol#L25) and [here](https://github.com/livepeer/protocol/blob/confluence/contracts/pm/mixins/MixinTicketBrokerCore.sol#L230)) return struct entities which are not then [validated exhaustively in the javascript tests.](https://github.com/livepeer/protocol/blob/confluence/test/unit/TicketBroker.js#L157-L159)
Add a deep equality/validation for all structs

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.

Research direction

Start with the return sites in contracts/pm/mixins/MixinReserve.sol and contracts/pm/mixins/MixinTicketBrokerCore.sol, then inspect the existing validation in test/unit/TicketBroker.js. Run the JavaScript tests and extend the struct checks so every struct returned by the identified public or external functions is validated deeply and completely.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, solidity
Domain
blockchain, testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.