[go: up one dir, main page]

Scoru,Proto: make [stakers] both a record and private

Context

Having a pair is not ideal because:

  1. We use the Index.normalize a lot to ensure that (a = alice, b = bob)
  2. The pattern below is very common in the code because of this pair.
let (a, b) = Index.normalize in
let _ = foo (a, b) in
let _ = bar (a, b)

So I propose here to change the pair to a private record, that is, alice is always the correct Staker.t thanks to make. The pair is never reconstructed, we only read from once it's created so (2) is fixed as well.

Manually testing the MR

Checklist

  • n/a Document the interface of any function added or modified (see the coding guidelines)
  • n/a Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • n/a For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Valentin Chaboche

Merge request reports

Loading