impl From<U256> for ExpandedDifficulty
This commit is contained in:
parent
e05103323e
commit
00de709dd8
|
@ -213,7 +213,7 @@ impl CompactDifficulty {
|
||||||
// zcashd rejects zero values, without comparing the hash
|
// zcashd rejects zero values, without comparing the hash
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
Some(ExpandedDifficulty(result))
|
Some(result.into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,7 +256,12 @@ impl ExpandedDifficulty {
|
||||||
/// Hashes are not used to calculate the difficulties of future blocks, so
|
/// Hashes are not used to calculate the difficulties of future blocks, so
|
||||||
/// users of this module should avoid converting hashes into difficulties.
|
/// users of this module should avoid converting hashes into difficulties.
|
||||||
fn from_hash(hash: &block::Hash) -> ExpandedDifficulty {
|
fn from_hash(hash: &block::Hash) -> ExpandedDifficulty {
|
||||||
ExpandedDifficulty(U256::from_little_endian(&hash.0))
|
U256::from_little_endian(&hash.0).into()
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<U256> for ExpandedDifficulty {
|
||||||
|
fn from(value: U256) -> Self {
|
||||||
|
ExpandedDifficulty(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue