Skip to main content

ic_asset/error/
compute_evidence.rs

1use crate::error::create_project_asset::CreateProjectAssetError;
2use crate::error::gather_asset_descriptors::GatherAssetDescriptorsError;
3use crate::error::get_asset_properties::GetAssetPropertiesError;
4use crate::error::hash_content::HashContentError;
5use ic_agent::AgentError;
6use thiserror::Error;
7
8use super::AssembleCommitBatchArgumentError;
9
10/// Errors related to computing evidence for a proposed update.
11#[derive(Error, Debug)]
12pub enum ComputeEvidenceError {
13    /// Failed when assembling commit_batch argument.
14    #[error(transparent)]
15    AssembleCommitBatchArgumentFailed(#[from] AssembleCommitBatchArgumentError),
16
17    /// Failed when inspecting assets to be updated.
18    #[error(transparent)]
19    ProcessProjectAsset(#[from] CreateProjectAssetError),
20
21    /// Failed when determining which assets and encodings changed.
22    #[error(transparent)]
23    GatherAssetDescriptors(#[from] GatherAssetDescriptorsError),
24
25    /// Failed when reading assets properties from the asset canister.
26    #[error(transparent)]
27    GetAssetProperties(#[from] GetAssetPropertiesError),
28
29    /// Failed when computing hashes of asset content.
30    #[error(transparent)]
31    HashContent(#[from] HashContentError),
32
33    /// Failed to list assets in the asset canister.
34    #[error("Failed to list assets")]
35    ListAssets(#[source] AgentError),
36}