eigerco / polka-storage

The Polka Storage Parachain Project
https://eigerco.github.io/polka-storage-book
Apache License 2.0
2 stars 0 forks source link

Consider TypeState in pipeline/Sector #521

Closed th7nder closed 1 week ago

th7nder commented 3 weeks ago
          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 https://github.com/eigerco/polka-storage/pull/502#discussion_r1831283039_

jmg-duarte commented 1 week ago

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