Skip to content

Commit

Permalink
use NoBound macros instead of manual impls (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshOrndorff authored Sep 29, 2023
1 parent 4c9f9c7 commit e9f3bd3
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions wardrobe/poe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ use sp_runtime::transaction_validity::TransactionPriority;
use sp_std::fmt::Debug;
use tuxedo_core::{
dynamic_typing::{DynamicallyTypedData, UtxoData},
ensure, SimpleConstraintChecker,
ensure,
support_macros::{CloneNoBound, DebugNoBound},
SimpleConstraintChecker,
};

#[cfg(test)]
Expand Down Expand Up @@ -80,21 +82,9 @@ pub trait PoeConfig {
/// It also allows the creation of zero claims, although such a transaction is useless and is simply a
/// waste of caller fees.
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, PartialEq, Eq, TypeInfo)]
#[derive(Encode, Decode, DebugNoBound, CloneNoBound, PartialEq, Eq, TypeInfo)]
pub struct PoeClaim<T>(PhantomData<T>);

impl<T> Clone for PoeClaim<T> {
fn clone(&self) -> Self {
Self(Default::default())
}
}

impl<T> Debug for PoeClaim<T> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.debug_tuple("PoeClaim").finish()
}
}

impl<T: PoeConfig> SimpleConstraintChecker for PoeClaim<T> {
type Error = ConstraintCheckerError;

Expand Down

0 comments on commit e9f3bd3

Please sign in to comment.