5
5
6
6
use sp_std:: { fmt:: Debug , vec:: Vec } ;
7
7
8
- use crate :: { dynamic_typing:: DynamicallyTypedData , inherents:: InherentInternal , types:: Output } ;
8
+ use crate :: { dynamic_typing:: { DynamicallyTypedData } , inherents:: InherentInternal , types:: Output } ;
9
9
use parity_scale_codec:: { Decode , Encode } ;
10
10
use sp_runtime:: transaction_validity:: TransactionPriority ;
11
11
@@ -19,6 +19,10 @@ pub trait SimpleConstraintChecker: Debug + Encode + Decode + Clone {
19
19
/// The error type that this constraint checker may return
20
20
type Error : Debug ;
21
21
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
+
22
26
/// The actual check validation logic
23
27
fn check (
24
28
& self ,
@@ -42,6 +46,10 @@ pub trait ConstraintChecker<V>: Debug + Encode + Decode + Clone {
42
46
/// The error type that this constraint checker may return
43
47
type Error : Debug ;
44
48
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
+
45
53
/// Optional Associated Inherent processing logic. If this transaction type is not an inherent, use ().
46
54
/// If it is an inherent, use Self, and implement the TuxedoInherent trait.
47
55
type InherentHooks : InherentInternal < V , Self > ;
@@ -66,6 +74,10 @@ impl<T: SimpleConstraintChecker, V> ConstraintChecker<V> for T {
66
74
// Use the same error type used in the simple implementation.
67
75
type Error = <T as SimpleConstraintChecker >:: Error ;
68
76
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
+
69
81
type InherentHooks = ( ) ;
70
82
71
83
fn check (
@@ -116,6 +128,7 @@ pub mod testing {
116
128
117
129
impl ConstraintChecker < TestVerifier > for TestConstraintChecker {
118
130
type Error = ( ) ;
131
+ type UtxoData = ( ) ;
119
132
type InherentHooks = ( ) ;
120
133
121
134
fn check (
0 commit comments