Skip to content

Refactor round storage methods to return actions #303

@kellpossible

Description

@kellpossible

The new Round::reset() introduced in #288 returns storage actions rather than directly mutating the storage. This easier to test and reason about. There are other methods in Round which could be refactored to work the same way, and have more unit tests written for them:

  • new()
  • remove_contributor_unsafe (introduced during Round restart #288 to combine removed_locks_unsafe and remove_chunk_contributions_unsafe)
  • remove_locks_unsafe
  • remove_chunk_contributions_unsafe
  • try_lock_chunk

The following methods depend on an immutable reference to Storage, perhaps they could be decoupled:

  • current_contribution_locator
  • next_contribution_locator
  • next_contribution_file_signature_locator

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorChanges which affect the maintainability of the code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions