Skip to content

Commit ecccdf6

Browse files
committed
Add UtxoData associated type
1 parent ec9de09 commit ecccdf6

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tuxedo-core/src/constraint_checker.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
use sp_std::{fmt::Debug, vec::Vec};
77

8-
use crate::{dynamic_typing::DynamicallyTypedData, inherents::InherentInternal, types::Output};
8+
use crate::{dynamic_typing::{DynamicallyTypedData}, inherents::InherentInternal, types::Output};
99
use parity_scale_codec::{Decode, Encode};
1010
use sp_runtime::transaction_validity::TransactionPriority;
1111

@@ -19,6 +19,10 @@ pub trait SimpleConstraintChecker: Debug + Encode + Decode + Clone {
1919
/// The error type that this constraint checker may return
2020
type Error: Debug;
2121

22+
/// Storable type(s) introduced by this piece. Any data type that you plan to store in
23+
/// a UTXO should be included here. If there are multiple such types, use an enum.
24+
type UtxoData: Encode + Decode + Debug;
25+
2226
/// The actual check validation logic
2327
fn check(
2428
&self,
@@ -42,6 +46,10 @@ pub trait ConstraintChecker<V>: Debug + Encode + Decode + Clone {
4246
/// The error type that this constraint checker may return
4347
type Error: Debug;
4448

49+
/// Storable type(s) introduced by this piece. Any data type that you plan to store in
50+
/// a UTXO should be included here. If there are multiple such types, use an enum.
51+
type UtxoData: Encode + Decode + Debug;
52+
4553
/// Optional Associated Inherent processing logic. If this transaction type is not an inherent, use ().
4654
/// If it is an inherent, use Self, and implement the TuxedoInherent trait.
4755
type InherentHooks: InherentInternal<V, Self>;
@@ -66,6 +74,10 @@ impl<T: SimpleConstraintChecker, V> ConstraintChecker<V> for T {
6674
// Use the same error type used in the simple implementation.
6775
type Error = <T as SimpleConstraintChecker>::Error;
6876

77+
/// Storable type(s) introduced by this piece. Any data type that you plan to store in
78+
/// a UTXO should be included here. If there are multiple such types, use an enum.
79+
type UtxoData = <T as SimpleConstraintChecker>::UtxoData;
80+
6981
type InherentHooks = ();
7082

7183
fn check(
@@ -116,6 +128,7 @@ pub mod testing {
116128

117129
impl ConstraintChecker<TestVerifier> for TestConstraintChecker {
118130
type Error = ();
131+
type UtxoData = ();
119132
type InherentHooks = ();
120133

121134
fn check(

0 commit comments

Comments
 (0)