Skip to content

Commit 1553cd9

Browse files
committed
Update Artifact trait to comply with 'object safety'
1 parent 980cfd7 commit 1553cd9

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

mithril-aggregator/src/artifact_builder/dummy_artifact.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ impl DummyArtifact {
2222
}
2323
}
2424

25+
#[typetag::serde]
2526
impl Artifact for DummyArtifact {}
2627

2728
/// A [DummyArtifact] builder

mithril-aggregator/src/artifact_builder/mithril_stake_distribution.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ impl MithrilStakeDistribution {
2424
}
2525
}
2626

27+
#[typetag::serde]
2728
impl Artifact for MithrilStakeDistribution {}
2829

2930
/// A [MithrilStakeDistributionArtifact] builder

mithril-common/src/signable_builder/interface.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use async_trait::async_trait;
2-
use serde::{de::DeserializeOwned, Serialize};
32
use std::fmt::Debug;
43

54
use crate::{entities::ProtocolMessage, StdResult};
@@ -14,7 +13,8 @@ pub trait Signable: Send + Sync {
1413
}
1514

1615
/// Artifact is a trait for types that represent signed artifacts
17-
pub trait Artifact: Serialize + DeserializeOwned + PartialEq + Debug + Send + Sync {}
16+
#[typetag::serde(tag = "type")]
17+
pub trait Artifact: Debug + Send + Sync {}
1818

1919
/// SignableBuilder is trait for building a signable for a beacon
2020
#[async_trait]

0 commit comments

Comments
 (0)