diff --git a/crates/sargon/src/signing/host_interaction/sign_request.rs b/crates/sargon/src/signing/host_interaction/sign_request.rs index b790e973b..cb9b49481 100644 --- a/crates/sargon/src/signing/host_interaction/sign_request.rs +++ b/crates/sargon/src/signing/host_interaction/sign_request.rs @@ -61,7 +61,11 @@ impl SignRequest { } } -impl HasSampleValues for SignRequest { +impl HasSampleValues for SignRequest +where + S::Payload: HasSampleValues, + S::ID: HasSampleValues, +{ fn sample() -> Self { Self::new( FactorSourceKind::sample(), diff --git a/crates/sargon/src/signing/host_interaction/sign_response.rs b/crates/sargon/src/signing/host_interaction/sign_response.rs index 3c20ffe5d..631b43ae3 100644 --- a/crates/sargon/src/signing/host_interaction/sign_response.rs +++ b/crates/sargon/src/signing/host_interaction/sign_response.rs @@ -30,7 +30,7 @@ impl SignResponse { } } -impl HasSampleValues for SignResponse { +impl HasSampleValues for SignResponse { fn sample() -> Self { let hd_signature = HDSignature::sample(); let factor_source_id = hd_signature diff --git a/crates/sargon/src/signing/host_interaction/transaction_sign_request_input.rs b/crates/sargon/src/signing/host_interaction/transaction_sign_request_input.rs index 580a850d5..e3ab61243 100644 --- a/crates/sargon/src/signing/host_interaction/transaction_sign_request_input.rs +++ b/crates/sargon/src/signing/host_interaction/transaction_sign_request_input.rs @@ -53,7 +53,11 @@ impl TransactionSignRequestInput { } } -impl HasSampleValues for TransactionSignRequestInput { +impl HasSampleValues + for TransactionSignRequestInput +where + S::Payload: HasSampleValues, +{ fn sample() -> Self { let owned_factor_instance = OwnedFactorInstance::sample(); let factor_source_id = &owned_factor_instance.factor_source_id(); diff --git a/crates/sargon/src/signing/petition_types/petition_for_entity.rs b/crates/sargon/src/signing/petition_types/petition_for_entity.rs index 12b73dcd4..fc499ab27 100644 --- a/crates/sargon/src/signing/petition_types/petition_for_entity.rs +++ b/crates/sargon/src/signing/petition_types/petition_for_entity.rs @@ -429,7 +429,9 @@ impl PetitionForEntity { } } -impl HasSampleValues for PetitionForEntity { +impl HasSampleValues + for PetitionForEntity +{ fn sample() -> Self { Self::from_entity_with_role_kind( Account::sample_securified_mainnet( diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state_snapshot.rs b/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state_snapshot.rs index 30df74c77..c35c949eb 100644 --- a/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state_snapshot.rs +++ b/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state_snapshot.rs @@ -51,7 +51,9 @@ impl PetitionForFactorsStateSnapshot { } } -impl HasSampleValues for PetitionForFactorsStateSnapshot { +impl HasSampleValues + for PetitionForFactorsStateSnapshot +{ fn sample() -> Self { Self::new( IndexSet::from_iter([ diff --git a/crates/sargon/src/signing/signables/signable.rs b/crates/sargon/src/signing/signables/signable.rs index ef0753783..7afb5a136 100644 --- a/crates/sargon/src/signing/signables/signable.rs +++ b/crates/sargon/src/signing/signables/signable.rs @@ -4,7 +4,7 @@ use std::hash::Hasher; /// Any type conforming to `Signable` can be used with `SignaturesCollector` and collect /// signatures from all involved entities according to their security structure. pub trait Signable: - std::hash::Hash + PartialEq + Eq + Clone + Debug + HasSampleValues + Send + Sync + std::hash::Hash + PartialEq + Eq + Clone + Debug + Send + Sync { /// A stable identifier for this `Signable`. type ID: SignableID; @@ -17,7 +17,6 @@ pub trait Signable: + std::hash::Hash + Into + From - + HasSampleValues + Send + Sync; @@ -128,6 +127,6 @@ pub trait Signable: /// An identifier that is unique for each `Signable` pub trait SignableID: - Eq + StdHash + Clone + Debug + Into + HasSampleValues + Send + Sync + Eq + StdHash + Clone + Debug + Into + Send + Sync { } diff --git a/crates/sargon/src/signing/signatures_outecome_types/maybe_signed_transactions.rs b/crates/sargon/src/signing/signatures_outecome_types/maybe_signed_transactions.rs index 7d9baafe6..5660e7cc1 100644 --- a/crates/sargon/src/signing/signatures_outecome_types/maybe_signed_transactions.rs +++ b/crates/sargon/src/signing/signatures_outecome_types/maybe_signed_transactions.rs @@ -119,7 +119,9 @@ impl MaybeSignedTransactions { } } -impl HasSampleValues for MaybeSignedTransactions { +impl HasSampleValues + for MaybeSignedTransactions +{ fn sample() -> Self { let tx_a = ID::sample(); diff --git a/crates/sargon/src/signing/signatures_outecome_types/sign_with_factors_outcome.rs b/crates/sargon/src/signing/signatures_outecome_types/sign_with_factors_outcome.rs index bb6265691..84ae8cddc 100644 --- a/crates/sargon/src/signing/signatures_outecome_types/sign_with_factors_outcome.rs +++ b/crates/sargon/src/signing/signatures_outecome_types/sign_with_factors_outcome.rs @@ -15,7 +15,9 @@ pub enum SignWithFactorsOutcome { Neglected(NeglectedFactors), } -impl HasSampleValues for SignWithFactorsOutcome { +impl HasSampleValues + for SignWithFactorsOutcome +{ fn sample() -> Self { Self::signed(SignResponse::sample()) } diff --git a/crates/sargon/src/types/hd_signature.rs b/crates/sargon/src/types/hd_signature.rs index adc2d4818..f5fe65de5 100644 --- a/crates/sargon/src/types/hd_signature.rs +++ b/crates/sargon/src/types/hd_signature.rs @@ -66,7 +66,7 @@ impl HDSignature { } } -impl HasSampleValues for HDSignature { +impl HasSampleValues for HDSignature { fn sample() -> Self { Self::fake_sign_by_looking_up_mnemonic_amongst_samples( HDSignatureInput::::sample(), diff --git a/crates/sargon/src/types/hd_signature_input.rs b/crates/sargon/src/types/hd_signature_input.rs index 5f6f3f5f0..4068c2b1f 100644 --- a/crates/sargon/src/types/hd_signature_input.rs +++ b/crates/sargon/src/types/hd_signature_input.rs @@ -30,7 +30,9 @@ impl HDSignatureInput { } } -impl HasSampleValues for HDSignatureInput { +impl HasSampleValues + for HDSignatureInput +{ fn sample() -> Self { Self::new(ID::sample(), OwnedFactorInstance::sample()) } diff --git a/crates/sargon/src/types/invalid_transaction_if_neglected.rs b/crates/sargon/src/types/invalid_transaction_if_neglected.rs index 110487e60..59371a7cd 100644 --- a/crates/sargon/src/types/invalid_transaction_if_neglected.rs +++ b/crates/sargon/src/types/invalid_transaction_if_neglected.rs @@ -56,7 +56,9 @@ impl InvalidTransactionIfNeglected { } } -impl HasSampleValues for InvalidTransactionIfNeglected { +impl HasSampleValues + for InvalidTransactionIfNeglected +{ fn sample() -> Self { Self::new(ID::sample(), vec![AddressOfAccountOrPersona::sample()]) }