remove serialization error variant of EquihashError
This commit is contained in:
parent
0dc2d92ad8
commit
b8de256c48
|
@ -74,7 +74,9 @@ impl BlockHeader {
|
||||||
let solution = &self.solution.0;
|
let solution = &self.solution.0;
|
||||||
let mut input = Vec::new();
|
let mut input = Vec::new();
|
||||||
|
|
||||||
self.zcash_serialize(&mut input)?;
|
self.zcash_serialize(&mut input)
|
||||||
|
.expect("serialization into a vec can't fail");
|
||||||
|
|
||||||
let input = &input[0..EquihashSolution::INPUT_LENGTH];
|
let input = &input[0..EquihashSolution::INPUT_LENGTH];
|
||||||
|
|
||||||
equihash::is_valid_solution(n, k, input, nonce, solution)?;
|
equihash::is_valid_solution(n, k, input, nonce, solution)?;
|
||||||
|
@ -110,9 +112,5 @@ impl BlockHeader {
|
||||||
|
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum EquihashError {
|
#[error("invalid equihash solution for BlockHeader")]
|
||||||
#[error("invalid equihash solution for BlockHeader")]
|
pub struct EquihashError(#[from] equihash::Error);
|
||||||
EquihashInvalid(#[from] equihash::Error),
|
|
||||||
#[error("cannot reserialize header for equihash verification")]
|
|
||||||
Serialize(#[from] std::io::Error),
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue