Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider TypeState in pipeline/Sector #521

Closed
th7nder opened this issue Nov 7, 2024 · 1 comment
Closed

Consider TypeState in pipeline/Sector #521

th7nder opened this issue Nov 7, 2024 · 1 comment
Labels
tech debt Flags technical debt
Milestone

Comments

@th7nder
Copy link
Contributor

th7nder commented Nov 7, 2024

          Nice. new typestate pattern makes it more readable. You can also use generics if you don't want to copy shared state like `sector_number`, `deals`, `piece_infos` between structs.

Something like:

struct Sector<State> {
    <shared>
    state: State
}

struct Unsealed {
    <unsealed specifics>
}

struct PreCommitted {
    <precommitted specifics>
}

struct Proven {
    <proven specifics>
}

Originally posted by @cernicc in #502 (comment)

@th7nder th7nder changed the title Condier TypeState in pipeline/Sector Consider TypeState in pipeline/Sector Nov 7, 2024
@jmg-duarte jmg-duarte added this to the Phase 3 milestone Nov 14, 2024
@jmg-duarte jmg-duarte added the tech debt Flags technical debt label Nov 15, 2024
@jmg-duarte
Copy link
Collaborator

Closing since this is something that we'll figure out as we build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech debt Flags technical debt
Projects
None yet
Development

No branches or pull requests

2 participants