mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-21 12:05:42 +00:00
Prevent bug when reusing type ids in hashing (#1075)
* practice TDD * implement a hashmap 2-phases approach * use nicer types * add test for cache filling * adjust test --------- Co-authored-by: James Wilson <james@jsdw.me>
This commit is contained in:
+2
-2
@@ -20,7 +20,7 @@ mod from_into;
|
||||
mod utils;
|
||||
|
||||
use scale_info::{form::PortableForm, PortableRegistry, Variant};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use utils::ordered_map::OrderedMap;
|
||||
use utils::variant_index::VariantIndex;
|
||||
@@ -152,7 +152,7 @@ impl Metadata {
|
||||
Some(crate::utils::validation::get_type_hash(
|
||||
&self.types,
|
||||
id,
|
||||
&mut HashSet::<u32>::new(),
|
||||
&mut HashMap::new(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user