mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 00:31:07 +00:00
Additional state check. (#2915)
* check resulting state root on import. * get root from last method. * Fix test runtime (was changing state after root calculation). * Do reset new authorities (just take before root calculation). * bump impl runtime version. * Update core/sr-api-macros/tests/trybuild.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -1027,7 +1027,11 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
|
||||
|
||||
let (top, children) = overlay.into_committed();
|
||||
let children = children.map(|(sk, it)| (sk, it.collect())).collect();
|
||||
Ok((Some(storage_update), Some(changes_update), Some((top.collect(), children))))
|
||||
if import_headers.post().state_root() != &storage_update.1 {
|
||||
return Err(error::Error::InvalidStateRoot);
|
||||
}
|
||||
|
||||
Ok((Some(storage_update.0), Some(changes_update), Some((top.collect(), children))))
|
||||
},
|
||||
None => Ok((None, None, None))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user