Add storage_version() and runtime_wasm_code() to storage (#1111)

* add storage_version function

* get runtime code

* add tests

* clippy fix

* just support CODE, remove other well known keys

* remove u16 wrapper
This commit is contained in:
Tadeo Hepperle
2023-08-10 15:40:38 +02:00
committed by GitHub
parent b97acc5df6
commit 9723a50969
4 changed files with 72 additions and 4 deletions
+2 -2
View File
@@ -83,7 +83,7 @@ impl<T> EncodeAsType for WrapperKeepOpaque<T> {
use scale_encode::error::{Error, ErrorKind, Kind};
let Some(ty) = types.resolve(type_id) else {
return Err(Error::new(ErrorKind::TypeNotFound(type_id)))
return Err(Error::new(ErrorKind::TypeNotFound(type_id)));
};
// Do a basic check that the target shape lines up.
@@ -91,7 +91,7 @@ impl<T> EncodeAsType for WrapperKeepOpaque<T> {
return Err(Error::new(ErrorKind::WrongShape {
actual: Kind::Struct,
expected: type_id,
}))
}));
};
// Check that the name also lines up.