Skip to content

Commit

Permalink
change(fc-traits-authn): expose new method for DummyAttestation a…
Browse files Browse the repository at this point in the history
…nd `DummyCredential`
  • Loading branch information
pandres95 committed Oct 18, 2024
1 parent fe86aaa commit 4f34f38
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions traits/authn/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ pub mod dummy {
#[scale_info(skip_type_params(A))]
pub struct DummyAttestation<A>(bool, PhantomData<A>);

impl<A> DummyAttestation<A> {
pub fn new(value: bool) -> Self {
Self(value, PhantomData)
}
}

impl<A> Clone for DummyAttestation<A> {
fn clone(&self) -> Self {
Self(self.0.clone(), PhantomData)

Check warning on line 169 in traits/authn/src/util.rs

View workflow job for this annotation

GitHub Actions / clippy

using `clone` on type `bool` which implements the `Copy` trait

warning: using `clone` on type `bool` which implements the `Copy` trait --> traits/authn/src/util.rs:169:18 | 169 | Self(self.0.clone(), PhantomData) | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.0` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `#[warn(clippy::clone_on_copy)]` on by default
Expand All @@ -176,6 +182,12 @@ pub mod dummy {
}
}

impl<A> DummyCredential<A> {
pub fn new(value: bool) -> Self {
Self(value, PhantomData)
}
}

type DummyChallenger = u8;
type DummyCx = <DummyChallenger as Challenger>::Context;

Expand Down

0 comments on commit 4f34f38

Please sign in to comment.