@@ -61,9 +61,14 @@ fn transaction_without_enough_gas_should_not_work() {
61
61
62
62
let call = crate :: Call :: < Test > :: transact { transaction } ;
63
63
let source = call. check_self_contained ( ) . unwrap ( ) . unwrap ( ) ;
64
-
64
+ let extrinsic = fp_self_contained:: CheckedExtrinsic :: < u64 , crate :: mock:: Call , SignedExtra , _ > {
65
+ signed : fp_self_contained:: CheckedSignature :: SelfContained ( source) ,
66
+ function : Call :: Ethereum ( call. clone ( ) ) ,
67
+ } ;
68
+ let dispatch_info = extrinsic. get_dispatch_info ( ) ;
65
69
assert_err ! (
66
- call. validate_self_contained( & source) . unwrap( ) ,
70
+ call. validate_self_contained( & source, & dispatch_info, 0 )
71
+ . unwrap( ) ,
67
72
InvalidTransaction :: Payment
68
73
) ;
69
74
} ) ;
@@ -83,9 +88,15 @@ fn transaction_with_to_low_nonce_should_not_work() {
83
88
transaction : signed,
84
89
} ;
85
90
let source = call. check_self_contained ( ) . unwrap ( ) . unwrap ( ) ;
91
+ let extrinsic = fp_self_contained:: CheckedExtrinsic :: < u64 , crate :: mock:: Call , SignedExtra , H160 > {
92
+ signed : fp_self_contained:: CheckedSignature :: SelfContained ( source) ,
93
+ function : Call :: Ethereum ( call. clone ( ) ) ,
94
+ } ;
95
+ let dispatch_info = extrinsic. get_dispatch_info ( ) ;
86
96
87
97
assert_eq ! (
88
- call. validate_self_contained( & source) . unwrap( ) ,
98
+ call. validate_self_contained( & source, & dispatch_info, 0 )
99
+ . unwrap( ) ,
89
100
ValidTransactionBuilder :: default ( )
90
101
. and_provides( ( alice. address, U256 :: from( 1 ) ) )
91
102
. priority( 0u64 )
@@ -105,9 +116,15 @@ fn transaction_with_to_low_nonce_should_not_work() {
105
116
transaction : signed2,
106
117
} ;
107
118
let source2 = call2. check_self_contained ( ) . unwrap ( ) . unwrap ( ) ;
119
+ let extrinsic2 = fp_self_contained:: CheckedExtrinsic :: < u64 , crate :: mock:: Call , SignedExtra , _ > {
120
+ signed : fp_self_contained:: CheckedSignature :: SelfContained ( source) ,
121
+ function : Call :: Ethereum ( call2. clone ( ) ) ,
122
+ } ;
108
123
109
124
assert_err ! (
110
- call2. validate_self_contained( & source2) . unwrap( ) ,
125
+ call2
126
+ . validate_self_contained( & source2, & extrinsic2. get_dispatch_info( ) , 0 )
127
+ . unwrap( ) ,
111
128
InvalidTransaction :: Stale
112
129
) ;
113
130
} ) ;
@@ -131,7 +148,6 @@ fn transaction_with_to_hight_nonce_should_fail_in_block() {
131
148
signed : fp_self_contained:: CheckedSignature :: SelfContained ( source) ,
132
149
function : Call :: Ethereum ( call) ,
133
150
} ;
134
- use frame_support:: weights:: GetDispatchInfo as _;
135
151
let dispatch_info = extrinsic. get_dispatch_info ( ) ;
136
152
assert_err ! (
137
153
extrinsic. apply:: <Test >( & dispatch_info, 0 ) ,
@@ -155,7 +171,6 @@ fn transaction_with_invalid_chain_id_should_fail_in_block() {
155
171
signed : fp_self_contained:: CheckedSignature :: SelfContained ( source) ,
156
172
function : Call :: Ethereum ( call) ,
157
173
} ;
158
- use frame_support:: weights:: GetDispatchInfo as _;
159
174
let dispatch_info = extrinsic. get_dispatch_info ( ) ;
160
175
assert_err ! (
161
176
extrinsic. apply:: <Test >( & dispatch_info, 0 ) ,
@@ -337,7 +352,7 @@ fn self_contained_transaction_with_extra_gas_should_adjust_weight_with_post_disp
337
352
transaction : signed,
338
353
} ;
339
354
let source = call. check_self_contained ( ) . unwrap ( ) . unwrap ( ) ;
340
- let extrinsic = CheckedExtrinsic :: < _ , _ , frame_system:: CheckWeight < Test > , _ > {
355
+ let extrinsic = fp_self_contained :: CheckedExtrinsic :: < _ , _ , frame_system:: CheckWeight < Test > , _ > {
341
356
signed : fp_self_contained:: CheckedSignature :: SelfContained ( source) ,
342
357
function : Call :: Ethereum ( call) ,
343
358
} ;
0 commit comments