impl From<Amount> for orchard::ValueSum

This is necessary in order to be able to calculate bvk for Orchard
bundles.
This commit is contained in:
Jack Grigg 2021-06-14 11:41:02 +01:00
parent cc533a9da4
commit 00b3e427e6
1 changed files with 6 additions and 0 deletions

View File

@ -182,6 +182,12 @@ impl Neg for Amount {
} }
} }
impl From<Amount> for orchard::ValueSum {
fn from(v: Amount) -> Self {
orchard::ValueSum::from_raw(v.0)
}
}
impl TryFrom<orchard::ValueSum> for Amount { impl TryFrom<orchard::ValueSum> for Amount {
type Error = (); type Error = ();