Improve TryDecodeEntireState output (#2724)

Found some areas for improvement while working on
https://github.com/polkadot-fellows/runtimes/pull/122.

## Improvements

- If multiple keys in a storage item (e.g. a map) are undecodable,
return all the undecodable keys rather than only the first one found
- Include the key of the undecodable storage in the INFO log
- Write output as hex string where appropriate
- Write INFO log on successful decoding
This commit is contained in:
Liam Aharon
2023-12-23 11:58:44 +04:00
committed by GitHub
parent 753967ab48
commit 8acd63003c
2 changed files with 42 additions and 13 deletions
+3 -2
View File
@@ -409,9 +409,10 @@ where
) -> Result<(), TryRuntimeError> {
match res {
Ok(bytes) => {
log::debug!(
log::info!(
target: LOG_TARGET,
"decoded the entire state ({bytes} bytes)",
"✅ Entire runtime state decodes without error. {} bytes total.",
bytes
);
Ok(())