mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 11:01:01 +00:00
Make CandidateHash a real type (#1916)
* Make `CandidateHash` a real type This pr adds a new type `CandidateHash` that is used instead of the opaque `Hash` type. This helps to ensure on the type system level that we are passing the correct types. This pr also fixes wrong usage of `relay_parent` as `candidate_hash` when communicating with the av storage. * Update core-primitives/src/lib.rs Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com> * Wrap the lines Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
This commit is contained in:
@@ -23,7 +23,7 @@ enum ObservedRole {
|
||||
```rust
|
||||
enum AvailabilityDistributionV1Message {
|
||||
/// An erasure chunk for a given candidate hash.
|
||||
Chunk(Hash, ErasureChunk),
|
||||
Chunk(CandidateHash, ErasureChunk),
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -136,18 +136,18 @@ Messages to and from the availability store.
|
||||
```rust
|
||||
enum AvailabilityStoreMessage {
|
||||
/// Query the `AvailableData` of a candidate by hash.
|
||||
QueryAvailableData(Hash, ResponseChannel<Option<AvailableData>>),
|
||||
QueryAvailableData(CandidateHash, ResponseChannel<Option<AvailableData>>),
|
||||
/// Query whether an `AvailableData` exists within the AV Store.
|
||||
QueryDataAvailability(Hash, ResponseChannel<bool>),
|
||||
QueryDataAvailability(CandidateHash, ResponseChannel<bool>),
|
||||
/// Query a specific availability chunk of the candidate's erasure-coding by validator index.
|
||||
/// Returns the chunk and its inclusion proof against the candidate's erasure-root.
|
||||
QueryChunk(Hash, ValidatorIndex, ResponseChannel<Option<AvailabilityChunkAndProof>>),
|
||||
QueryChunk(CandidateHash, ValidatorIndex, ResponseChannel<Option<AvailabilityChunkAndProof>>),
|
||||
/// Store a specific chunk of the candidate's erasure-coding by validator index, with an
|
||||
/// accompanying proof.
|
||||
StoreChunk(Hash, ValidatorIndex, AvailabilityChunkAndProof, ResponseChannel<Result<()>>),
|
||||
StoreChunk(CandidateHash, ValidatorIndex, AvailabilityChunkAndProof, ResponseChannel<Result<()>>),
|
||||
/// Store `AvailableData`. If `ValidatorIndex` is provided, also store this validator's
|
||||
/// `AvailabilityChunkAndProof`.
|
||||
StoreAvailableData(Hash, Option<ValidatorIndex>, u32, AvailableData, ResponseChannel<Result<()>>),
|
||||
StoreAvailableData(CandidateHash, Option<ValidatorIndex>, u32, AvailableData, ResponseChannel<Result<()>>),
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user