diff --git a/testing/integration-tests/src/full_client/blocks/mod.rs b/testing/integration-tests/src/full_client/blocks/mod.rs index c83e395ee5..4125397b21 100644 --- a/testing/integration-tests/src/full_client/blocks/mod.rs +++ b/testing/integration-tests/src/full_client/blocks/mod.rs @@ -226,23 +226,39 @@ async fn fetch_block_and_decode_extrinsic_details() { .map(|res| res.unwrap()) .collect::>(); - // All blocks contain a timestamp; check this first: - let timestamp = block_extrinsics.first().unwrap(); - timestamp.as_root_extrinsic::().unwrap(); - timestamp - .as_extrinsic::() - .unwrap(); - assert!(!timestamp.is_signed()); + let mut balance = None; + let mut timestamp = None; - // Next we expect our transfer: - let tx = block_extrinsics.get(1).unwrap(); - tx.as_root_extrinsic::().unwrap(); - let ext = tx - .as_extrinsic::() - .unwrap() - .unwrap(); - assert_eq!(ext.value, 10_000); - assert!(tx.is_signed()); + for tx in block_extrinsics { + tx.as_root_extrinsic::().unwrap(); + + if let Some(ext) = tx + .as_extrinsic::() + .unwrap() + { + timestamp = Some((ext, tx.is_signed())); + } + + if let Some(ext) = tx + .as_extrinsic::() + .unwrap() + { + balance = Some((ext, tx.is_signed())); + } + } + + // Check that we found the timestamp + { + let (_, is_signed) = timestamp.expect("Timestamp not found"); + assert!(!is_signed); + } + + // Check that we found the balance transfer + { + let (tx, is_signed) = balance.expect("Balance transfer not found"); + assert_eq!(tx.value, 10_000); + assert!(is_signed); + } } #[cfg(fullclient)]