mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 12:11:09 +00:00
Add logging to PVF and other related parts (#3596)
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -54,7 +54,7 @@ impl Artifact {
|
||||
/// multiple engine implementations the artifact ID should include the engine type as well.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct ArtifactId {
|
||||
code_hash: ValidationCodeHash,
|
||||
pub(crate) code_hash: ValidationCodeHash,
|
||||
}
|
||||
|
||||
impl ArtifactId {
|
||||
@@ -84,6 +84,25 @@ impl ArtifactId {
|
||||
}
|
||||
}
|
||||
|
||||
/// A bundle of the artifact ID and the path.
|
||||
///
|
||||
/// Rationale for having this is two-fold:
|
||||
///
|
||||
/// - While we can derive the artifact path from the artifact id, it makes sense to carry it around
|
||||
/// sometimes to avoid extra work.
|
||||
/// - At the same time, carrying only path limiting the ability for logging.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ArtifactPathId {
|
||||
pub(crate) id: ArtifactId,
|
||||
pub(crate) path: PathBuf,
|
||||
}
|
||||
|
||||
impl ArtifactPathId {
|
||||
pub(crate) fn new(artifact_id: ArtifactId, cache_path: &Path) -> Self {
|
||||
Self { path: artifact_id.path(cache_path), id: artifact_id }
|
||||
}
|
||||
}
|
||||
|
||||
pub enum ArtifactState {
|
||||
/// The artifact is ready to be used by the executor.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user