Skip to content

Commit

Permalink
Poe piece: 100% test coverage (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshOrndorff authored Apr 19, 2024
1 parent 5c861d9 commit 9071010
Show file tree
Hide file tree
Showing 2 changed files with 385 additions and 6 deletions.
16 changes: 11 additions & 5 deletions wardrobe/poe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use sp_std::fmt::Debug;
use tuxedo_core::{
dynamic_typing::{DynamicallyTypedData, UtxoData},
ensure,
support_macros::{CloneNoBound, DebugNoBound},
support_macros::{CloneNoBound, DebugNoBound, DefaultNoBound},
SimpleConstraintChecker,
};

Expand Down Expand Up @@ -86,7 +86,16 @@ 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.
#[derive(
Serialize, Deserialize, Encode, Decode, DebugNoBound, CloneNoBound, PartialEq, Eq, TypeInfo,
Serialize,
Deserialize,
Encode,
Decode,
DebugNoBound,
DefaultNoBound,
CloneNoBound,
PartialEq,
Eq,
TypeInfo,
)]
pub struct PoeClaim<T>(PhantomData<T>);

Expand Down Expand Up @@ -120,9 +129,6 @@ impl<T: PoeConfig> SimpleConstraintChecker for PoeClaim<T> {
.extract::<ClaimData>()
.map_err(|_| ConstraintCheckerError::BadlyTypedOutput)?;
ensure!(
//TODO we're grabbing the block height function directly from
// the runtime level. This needs to be made available through some
// kind of config.
output.effective_height >= T::block_height(),
ConstraintCheckerError::EffectiveHeightInPast
);
Expand Down
Loading

0 comments on commit 9071010

Please sign in to comment.