mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-23 10:48:00 +00:00
Merge branch 'master' into jsdw-integrating-frame-decode
This commit is contained in:
@@ -132,7 +132,13 @@ impl<T: Config> OnlineClient<T> {
|
||||
metadata
|
||||
};
|
||||
|
||||
let historic_types = config.legacy_types_for_spec_version(spec_version);
|
||||
let mut historic_types = config.legacy_types_for_spec_version(spec_version);
|
||||
// The metadata can be used to construct call and event types instead of us havign to hardcode them all for every spec version:
|
||||
let types_from_metadata = frame_decode::helpers::type_registry_from_metadata_any(&metadata)
|
||||
.map_err(
|
||||
|parse_error| OnlineClientAtBlockError::CannotInjectMetadataTypes { parse_error },
|
||||
)?;
|
||||
historic_types.prepend(types_from_metadata);
|
||||
|
||||
Ok(ClientAtBlock::new(OnlineClientAtBlock {
|
||||
config,
|
||||
|
||||
@@ -102,6 +102,13 @@ pub enum OnlineClientAtBlockError {
|
||||
/// The error we encountered.
|
||||
reason: String,
|
||||
},
|
||||
#[error(
|
||||
"Cannot inject types from metadata: failure to parse a type found in the metadata: {parse_error}"
|
||||
)]
|
||||
CannotInjectMetadataTypes {
|
||||
/// Error parsing a type found in the metadata.
|
||||
parse_error: scale_info_legacy::lookup_name::ParseError,
|
||||
},
|
||||
}
|
||||
|
||||
/// Errors working with extrinsics.
|
||||
|
||||
@@ -66,11 +66,7 @@ impl<K: Clone + Copy + Display + PartialOrd + Ord, V> RangeMapBuilder<K, V> {
|
||||
return Err(RangeMapError::EmptyRange(start));
|
||||
}
|
||||
|
||||
if let Some(&(s, e, _)) = self
|
||||
.mapping
|
||||
.iter()
|
||||
.find(|&&(s, e, _)| (start < e && end > s))
|
||||
{
|
||||
if let Some(&(s, e, _)) = self.mapping.iter().find(|&&(s, e, _)| start < e && end > s) {
|
||||
return Err(RangeMapError::OverlappingRanges {
|
||||
proposed: (start, end),
|
||||
existing: (s, e),
|
||||
|
||||
Reference in New Issue
Block a user