11#![ allow( unused_qualifications) ]
22use crate :: { pallet, AssetIdOf , BalanceOf } ;
33use frame_system:: pallet_prelude:: * ;
4- use parity_scale_codec:: { Decode , Encode , HasCompact , MaxEncodedLen } ;
4+ use parity_scale_codec:: { Decode , DecodeWithMemTracking , Encode , HasCompact , MaxEncodedLen } ;
55use scale_info:: TypeInfo ;
66use sp_runtime:: { DispatchResult , Percent } ;
77
@@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize};
1313/// guarantee proof of funds and can be released once an agreed upon condition
1414/// has reached between the payment creator and recipient. The payment lifecycle
1515/// is tracked using the state field.
16- #[ derive( Encode , Decode , Debug , Clone , PartialEq , Eq , MaxEncodedLen , TypeInfo ) ]
16+ #[ derive( Encode , Decode , DecodeWithMemTracking , Debug , Clone , PartialEq , Eq , MaxEncodedLen , TypeInfo ) ]
1717#[ scale_info( skip_type_params( T ) ) ]
1818#[ codec( mel_bound( T : pallet:: Config ) ) ]
1919#[ cfg_attr( feature = "std" , derive( Serialize , Deserialize ) ) ]
@@ -38,7 +38,7 @@ pub struct PaymentDetail<T: pallet::Config> {
3838/// The `PaymentState` enum tracks the possible states that a payment can be in.
3939/// When a payment is 'completed' or 'cancelled' it is removed from storage and
4040/// hence not tracked by a state.
41- #[ derive( Encode , Decode , Debug , Clone , PartialEq , Eq , MaxEncodedLen , TypeInfo ) ]
41+ #[ derive( Encode , Decode , DecodeWithMemTracking , Debug , Clone , PartialEq , Eq , MaxEncodedLen , TypeInfo ) ]
4242#[ scale_info( skip_type_params( T ) ) ]
4343#[ codec( mel_bound( T : pallet:: Config ) ) ]
4444#[ cfg_attr( feature = "std" , derive( Serialize , Deserialize ) ) ]
@@ -109,15 +109,18 @@ pub trait FeeHandler<T: pallet::Config> {
109109}
110110
111111/// Types of Tasks that can be scheduled in the pallet
112- #[ derive( PartialEq , Eq , Clone , Encode , Decode , Debug , TypeInfo , MaxEncodedLen ) ]
112+ #[ derive( PartialEq , Eq , Clone , Encode , Decode , DecodeWithMemTracking , Debug , TypeInfo , MaxEncodedLen ) ]
113113pub enum Task {
114114 // payment `from` to `to` has to be cancelled
115115 Cancel ,
116116}
117117
118118/// The details of a scheduled task
119- #[ derive( PartialEq , Eq , Clone , Encode , Decode , Debug , TypeInfo , MaxEncodedLen ) ]
120- pub struct ScheduledTask < Time : HasCompact > {
119+ #[ derive( PartialEq , Eq , Clone , Encode , Decode , DecodeWithMemTracking , Debug , TypeInfo , MaxEncodedLen ) ]
120+ pub struct ScheduledTask < Time >
121+ where
122+ Time : HasCompact ,
123+ {
121124 /// the type of scheduled task
122125 pub task : Task ,
123126 /// the 'time' at which the task should be executed
0 commit comments