We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
prev_blockhash
ToBlockHash
1 parent be356d5 commit 55e4ce5Copy full SHA for 55e4ce5
crates/core/src/checkpoint.rs
@@ -64,6 +64,11 @@ impl<D> Drop for CPInner<D> {
64
pub trait ToBlockHash {
65
/// Returns the [`BlockHash`] for the associated [`CheckPoint`] `data` type.
66
fn to_blockhash(&self) -> BlockHash;
67
+
68
+ /// Returns `None` if the type has no knowledge of the previous [`BlockHash`].
69
+ fn prev_blockhash(&self) -> Option<BlockHash> {
70
+ None
71
+ }
72
}
73
74
impl ToBlockHash for BlockHash {
@@ -76,6 +81,10 @@ impl ToBlockHash for Header {
76
81
fn to_blockhash(&self) -> BlockHash {
77
82
self.block_hash()
78
83
84
85
86
+ Some(self.prev_blockhash)
87
79
88
80
89
90
impl<D> PartialEq for CheckPoint<D> {
0 commit comments