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 authored and GitHub committed 2023-12-23 18:58:44 +11:00
1 parent 753967ab48
commit 8acd63003c
2 files changed
+42 -13

No files matched your search

+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(())