@@ -37,7 +37,7 @@ use sp_core::{
37
37
use sp_keystore:: { testing:: MemoryKeystore , Keystore , KeystoreExt } ;
38
38
use sp_runtime:: {
39
39
testing:: TestXt ,
40
- traits:: { BlakeTwo256 , IdentifyAccount , IdentityLookup , Verify } ,
40
+ traits:: { BlakeTwo256 , IdentifyAccount , IdentityLookup , LazyExtrinsic , Verify } ,
41
41
RuntimeAppPublic ,
42
42
} ;
43
43
@@ -245,9 +245,12 @@ fn should_submit_signed_transaction_on_chain() {
245
245
// then
246
246
let tx = pool_state. write ( ) . transactions . pop ( ) . unwrap ( ) ;
247
247
assert ! ( pool_state. read( ) . transactions. is_empty( ) ) ;
248
- let tx = Extrinsic :: decode ( & mut & * tx) . unwrap ( ) ;
248
+ let mut tx = Extrinsic :: decode ( & mut & * tx) . unwrap ( ) ;
249
249
assert ! ( matches!( tx. preamble, sp_runtime:: generic:: Preamble :: Signed ( 0 , ( ) , ( ) , ) ) ) ;
250
- assert_eq ! ( tx. function, RuntimeCall :: Example ( crate :: Call :: submit_price { price: 15523 } ) ) ;
250
+ assert_eq ! (
251
+ tx. expect_as_full( ) . call,
252
+ & RuntimeCall :: Example ( crate :: Call :: submit_price { price: 15523 } )
253
+ ) ;
251
254
} ) ;
252
255
}
253
256
@@ -285,12 +288,12 @@ fn should_submit_unsigned_transaction_on_chain_for_any_account() {
285
288
Example :: fetch_price_and_send_unsigned_for_any_account ( 1 ) . unwrap ( ) ;
286
289
// then
287
290
let tx = pool_state. write ( ) . transactions . pop ( ) . unwrap ( ) ;
288
- let tx = Extrinsic :: decode ( & mut & * tx) . unwrap ( ) ;
291
+ let mut tx = Extrinsic :: decode ( & mut & * tx) . unwrap ( ) ;
289
292
assert ! ( tx. is_inherent( ) ) ;
290
293
if let RuntimeCall :: Example ( crate :: Call :: submit_price_unsigned_with_signed_payload {
291
294
price_payload : body,
292
295
signature,
293
- } ) = tx. function
296
+ } ) = tx. expect_as_full ( ) . call . clone ( )
294
297
{
295
298
assert_eq ! ( body, price_payload) ;
296
299
@@ -340,12 +343,12 @@ fn should_submit_unsigned_transaction_on_chain_for_all_accounts() {
340
343
Example :: fetch_price_and_send_unsigned_for_all_accounts ( 1 ) . unwrap ( ) ;
341
344
// then
342
345
let tx = pool_state. write ( ) . transactions . pop ( ) . unwrap ( ) ;
343
- let tx = Extrinsic :: decode ( & mut & * tx) . unwrap ( ) ;
346
+ let mut tx = Extrinsic :: decode ( & mut & * tx) . unwrap ( ) ;
344
347
assert ! ( tx. is_inherent( ) ) ;
345
348
if let RuntimeCall :: Example ( crate :: Call :: submit_price_unsigned_with_signed_payload {
346
349
price_payload : body,
347
350
signature,
348
- } ) = tx. function
351
+ } ) = tx. expect_as_full ( ) . call . clone ( )
349
352
{
350
353
assert_eq ! ( body, price_payload) ;
351
354
@@ -381,10 +384,10 @@ fn should_submit_raw_unsigned_transaction_on_chain() {
381
384
// then
382
385
let tx = pool_state. write ( ) . transactions . pop ( ) . unwrap ( ) ;
383
386
assert ! ( pool_state. read( ) . transactions. is_empty( ) ) ;
384
- let tx = Extrinsic :: decode ( & mut & * tx) . unwrap ( ) ;
387
+ let mut tx = Extrinsic :: decode ( & mut & * tx) . unwrap ( ) ;
385
388
assert ! ( tx. is_inherent( ) ) ;
386
389
assert_eq ! (
387
- tx. function ,
390
+ tx. expect_as_full ( ) . call . clone ( ) ,
388
391
RuntimeCall :: Example ( crate :: Call :: submit_price_unsigned {
389
392
block_number: 1 ,
390
393
price: 15523
0 commit comments