Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ publish = true
default = ["ics23", "std", "sha2"]
mocks = ["dep:parking_lot"]
blake3_tests = ["dep:blake3"]
std = ["dep:thiserror"]
std = ["thiserror/std"]
migration = []

[dependencies]
Expand All @@ -33,7 +33,7 @@ num-derive = "0.3.3"
num-traits = "0.2.14"
parking_lot = { version = "0.12.1", optional = true }
serde = { version = "1.0.124", features = ["derive"] }
thiserror = { version = "1.0.24", optional = true }
thiserror = { version = "2.0", default-features = false }
sha2 = { version = "0.10", optional = true }
blake3 = { version = "1.4.0", optional = true, features = ["traits-preview"] }
hex = "0.4"
Expand Down
19 changes: 2 additions & 17 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,27 +123,12 @@ pub mod storage {
mod tests;

/// An error that occurs when the state root for a requested version is missing (e.g., because it was pruned).
#[derive(Debug)]
#[cfg_attr(feature = "std", derive(Error))]
#[cfg_attr(
feature = "std",
error("Missing state root node at version {version}, probably pruned.")
)]
#[derive(Debug, Error)]
#[error("Missing state root node at version {version}, probably pruned.")]
pub struct MissingRootError {
pub version: Version,
}

#[cfg(not(feature = "std"))]
impl core::fmt::Display for MissingRootError {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(
f,
"Missing state root node at version {}, probably pruned.",
self.version
)
}
}

// TODO: reorg

const SPARSE_MERKLE_PLACEHOLDER_HASH: [u8; 32] = *b"SPARSE_MERKLE_PLACEHOLDER_HASH__";
Expand Down
Loading