Skip to content

Commit e374ade

Browse files
committed
moved merkle tree errors
1 parent e48d337 commit e374ade

File tree

6 files changed

+23
-24
lines changed

6 files changed

+23
-24
lines changed

mithril-stm/src/membership_commitment/merkle_tree/commitment.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use blake2::digest::{Digest, FixedOutput};
33
use serde::{Deserialize, Serialize};
44
use std::marker::PhantomData;
55

6-
use super::{MerkleBatchPath, MerklePath, MerkleTreeLeaf, parent, sibling};
7-
use crate::{MerkleTreeError, StmResult};
6+
use super::{MerkleBatchPath, MerklePath, MerkleTreeError, MerkleTreeLeaf, parent, sibling};
7+
use crate::StmResult;
88

99
/// `MerkleTree` commitment.
1010
/// This structure differs from `MerkleTree` in that it does not contain all elements, which are not always necessary.

mithril-stm/src/membership_commitment/merkle_tree/leaf.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use std::cmp::Ordering;
22

33
use serde::{Deserialize, Serialize};
44

5-
use crate::{
6-
MerkleTreeError, Stake, StmResult, VerificationKey, signature_scheme::BlsVerificationKey,
7-
};
5+
use super::MerkleTreeError;
6+
7+
use crate::{Stake, StmResult, VerificationKey, signature_scheme::BlsVerificationKey};
88

99
/// The values that are committed in the Merkle Tree.
1010
/// Namely, a verified `VerificationKey` and its corresponding stake.

mithril-stm/src/membership_commitment/merkle_tree/path.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ use blake2::digest::{Digest, FixedOutput};
22
use serde::{Deserialize, Serialize};
33
use std::marker::PhantomData;
44

5-
use crate::{MerkleTreeError, StmResult};
5+
use super::MerkleTreeError;
6+
use crate::StmResult;
67

78
/// Path of hashes from root to leaf in a Merkle Tree.
89
/// Contains all hashes on the path, and the index of the leaf.

mithril-stm/src/membership_commitment/merkle_tree/tree.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ use serde::{Deserialize, Serialize};
33
use std::marker::PhantomData;
44

55
use super::{
6-
MerkleBatchPath, MerklePath, MerkleTreeBatchCommitment, MerkleTreeCommitment, MerkleTreeLeaf,
7-
left_child, parent, right_child, sibling,
6+
MerkleBatchPath, MerklePath, MerkleTreeBatchCommitment, MerkleTreeCommitment, MerkleTreeError,
7+
MerkleTreeLeaf, left_child, parent, right_child, sibling,
88
};
9-
use crate::{MerkleTreeError, StmResult};
9+
use crate::StmResult;
1010

1111
/// Tree of hashes, providing a commitment of data and its ordering.
1212
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]

mithril-stm/src/protocol/error.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ use crate::{
4040
// }
4141

4242
/// Error types related to merkle trees.
43-
#[derive(Debug, Clone, thiserror::Error)]
44-
pub enum MerkleTreeError {
45-
/// Serialization error
46-
#[error("Serialization of a merkle tree failed")]
47-
SerializationError,
43+
// #[derive(Debug, Clone, thiserror::Error)]
44+
// pub enum MerkleTreeError {
45+
// /// Serialization error
46+
// #[error("Serialization of a merkle tree failed")]
47+
// SerializationError,
4848

49-
/// Invalid merkle path
50-
#[error("Path does not verify against root")]
51-
PathInvalid(Vec<u8>),
49+
// /// Invalid merkle path
50+
// #[error("Path does not verify against root")]
51+
// PathInvalid(Vec<u8>),
5252

53-
/// Invalid merkle batch path
54-
#[error("Batch path does not verify against root")]
55-
BatchPathInvalid(Vec<u8>),
56-
}
53+
// /// Invalid merkle batch path
54+
// #[error("Batch path does not verify against root")]
55+
// BatchPathInvalid(Vec<u8>),
56+
// }
5757

5858
/// Errors which can be output by Mithril single signature verification.
5959
#[derive(Debug, Clone, thiserror::Error)]

mithril-stm/src/protocol/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ pub use aggregate_signature::{
1010
AggregateSignature, AggregateSignatureType, AggregateVerificationKey, BasicVerifier, Clerk,
1111
};
1212
pub(crate) use eligibility_check::is_lottery_won;
13-
pub use error::{
14-
AggregateSignatureError, AggregationError, MerkleTreeError, RegisterError, SignatureError,
15-
};
13+
pub use error::{AggregateSignatureError, AggregationError, RegisterError, SignatureError};
1614
pub use key_registration::{ClosedKeyRegistration, KeyRegistration, RegisteredParty};
1715
pub use parameters::Parameters;
1816
pub use participant::{Initializer, Signer, VerificationKey, VerificationKeyProofOfPossession};

0 commit comments

Comments
 (0)