mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
Relax types on DigestItemRef, such that byte slices can be used in addition to vector references (#10536)
* Relax types on `DigestItemRef`, such that byte slices can be used in addition to vector references * Apply clippy suggestions
This commit is contained in:
@@ -177,16 +177,16 @@ pub enum DigestItemRef<'a> {
|
||||
/// the consensus engine can (and should) read them itself to avoid
|
||||
/// code and state duplication. It is erroneous for a runtime to produce
|
||||
/// these, but this is not (yet) checked.
|
||||
PreRuntime(&'a ConsensusEngineId, &'a Vec<u8>),
|
||||
PreRuntime(&'a ConsensusEngineId, &'a [u8]),
|
||||
/// A message from the runtime to the consensus engine. This should *never*
|
||||
/// be generated by the native code of any consensus engine, but this is not
|
||||
/// checked (yet).
|
||||
Consensus(&'a ConsensusEngineId, &'a Vec<u8>),
|
||||
Consensus(&'a ConsensusEngineId, &'a [u8]),
|
||||
/// Put a Seal on it. This is only used by native code, and is never seen
|
||||
/// by runtimes.
|
||||
Seal(&'a ConsensusEngineId, &'a Vec<u8>),
|
||||
Seal(&'a ConsensusEngineId, &'a [u8]),
|
||||
/// Any 'non-system' digest item, opaque to the native code.
|
||||
Other(&'a Vec<u8>),
|
||||
Other(&'a [u8]),
|
||||
/// Runtime code or heap pages updated.
|
||||
RuntimeEnvironmentUpdated,
|
||||
}
|
||||
@@ -358,8 +358,8 @@ impl<'a> DigestItemRef<'a> {
|
||||
(OpaqueDigestItemId::Seal(w), &Self::Seal(v, s)) |
|
||||
(OpaqueDigestItemId::PreRuntime(w), &Self::PreRuntime(v, s))
|
||||
if v == w =>
|
||||
Some(&s[..]),
|
||||
(OpaqueDigestItemId::Other, &Self::Other(s)) => Some(&s[..]),
|
||||
Some(s),
|
||||
(OpaqueDigestItemId::Other, &Self::Other(s)) => Some(s),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user