-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Description
There are now several witness types for backwards compatibility. For eg this, this, this, this, this.
This calls for a refactoring to make those types easier to reason about.
We could define a single enum type (one each for chunk, batch and so on) such that:
#[non_exhaustive]
pub enum BackwardsCompatibleChunkWitness {
/// Currently the `LegacyChunkWitness`.
V5(ChunkWitnessV5),
/// To be chunk witness from v6.
V6(ChunkWitnessV6),
}
impl BackwardsCompatibleChunkWitness {
/// serialize
pub fn serialize(&self) -> Vec<u8> { /* */ }
}And then implement:
impl ChunkWitness {
/// Into an older version witness.
pub fn to_legacy(&self, version: Version) -> BackwardsCompatibleChunkWitness { /* * / }
}Metadata
Metadata
Assignees
Labels
No labels