Updated to later version of substrate so that it compiles. (#295)

* Updated to later version of substrate so that it compiles.

(Referencing substrate this way you only have to search and replace one string to upgrade)

* cargo fmt
This commit is contained in:
Squirrel
2021-09-20 09:33:33 +01:00
committed by GitHub
parent 156db74102
commit d582479367
6 changed files with 44 additions and 27 deletions
+5 -1
View File
@@ -139,7 +139,11 @@ impl RuntimeError {
DispatchError::CannotLookup => Ok(Self::CannotLookup),
DispatchError::ConsumerRemaining => Ok(Self::ConsumerRemaining),
DispatchError::NoProviders => Ok(Self::NoProviders),
DispatchError::Other(msg) => Ok(Self::Other(msg.into())),
DispatchError::Arithmetic(_math_error) => {
Ok(Self::Other("math_error".into()))
}
DispatchError::Token(_token_error) => Ok(Self::Other("token error".into())),
DispatchError::Other(msg) => Ok(Self::Other(msg.to_string())),
}
}
}
+2 -2
View File
@@ -361,7 +361,7 @@ mod tests {
ModuleMetadata,
RuntimeMetadata,
RuntimeMetadataPrefixed,
RuntimeMetadataV12,
RuntimeMetadataV13,
META_RESERVED,
};
use std::convert::TryFrom;
@@ -399,7 +399,7 @@ mod tests {
let decoder = EventsDecoder::<TestRuntime>::new(
Metadata::try_from(RuntimeMetadataPrefixed(
META_RESERVED,
RuntimeMetadata::V12(RuntimeMetadataV12 {
RuntimeMetadata::V13(RuntimeMetadataV13 {
modules: DecodeDifferent::Decoded(vec![ModuleMetadata {
name: DecodeDifferent::Decoded("System".to_string()),
storage: None,
+1 -1
View File
@@ -529,7 +529,7 @@ impl TryFrom<RuntimeMetadataPrefixed> for Metadata {
return Err(ConversionError::InvalidPrefix.into())
}
let meta = match metadata.1 {
RuntimeMetadata::V12(meta) => meta,
RuntimeMetadata::V13(meta) => meta,
_ => return Err(ConversionError::InvalidVersion.into()),
};
let mut modules = HashMap::new();