From edb1a7130aaf8f7fd6f98d2a8416a7d6a64b1a68 Mon Sep 17 00:00:00 2001 From: Liu-Cheng Xu Date: Thu, 25 Nov 2021 21:47:09 +0800 Subject: [PATCH] `block.body` definitly exists unless it's a light client or fast sync in storage chain mode --- crates/sc-consensus-subspace/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/sc-consensus-subspace/src/lib.rs b/crates/sc-consensus-subspace/src/lib.rs index 6f8064c3ed..45f580cc84 100644 --- a/crates/sc-consensus-subspace/src/lib.rs +++ b/crates/sc-consensus-subspace/src/lib.rs @@ -1489,9 +1489,12 @@ where let root_blocks = self.root_blocks.lock(); // If there are root blocks expected to be included in this block, check them if let Some(correct_root_blocks) = root_blocks.peek(&block_number) { - // TODO: Why there could be no body? Light client? let mut found = false; - for extrinsic in block.body.as_ref().unwrap() { + for extrinsic in block + .body + .as_ref() + .expect("Light client or fast sync is unsupported; qed") + { match self .client .runtime_api()