Skip to content

Commit b43962e

Browse files
committed
Add getter method for elided_root field
1 parent 6cb17a1 commit b43962e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/dynafed.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,15 @@ impl Params {
129129
}
130130
}
131131

132+
/// Get the elided_root. Is [None] for non-[Compact] params.
133+
pub fn elided_root(&self) -> Option<&sha256::Midstate> {
134+
match *self {
135+
Params::Null => None,
136+
Params::Compact { ref elided_root, ..} => Some(elided_root),
137+
Params::Full { .. } => None,
138+
}
139+
}
140+
132141
/// Calculate the root of this [Params].
133142
pub fn calculate_root(&self) -> sha256::Midstate {
134143
fn serialize_hash<E: Encodable>(obj: &E) -> sha256d::Hash {

0 commit comments

Comments
 (0)