diff --git a/runtime/gdev/tests/common/golden_testing/iterative.rs b/runtime/gdev/tests/common/golden_testing/iterative.rs index f01c31d7ad0b9af4127622644434ec2474319d74..6d88b883cd1fda7b24f13b2704725133ad5309a3 100644 --- a/runtime/gdev/tests/common/golden_testing/iterative.rs +++ b/runtime/gdev/tests/common/golden_testing/iterative.rs @@ -314,7 +314,13 @@ impl StorageIterativeChecker { Key::_ManualKey("Proxy".to_string(), "Announcements".to_string(), "[ ]".to_string()), Key::_ManualKey("Treasury".to_string(), "Proposals".to_string(), "[ -]".to_string()) +]".to_string()), + Key::_ManualKey("Offences".to_string(), "ConcurrentReportsIndex".to_string(), "[ +]".to_string()), + Key::_ManualKey("Multisig".to_string(), "Multisigs".to_string(), "[ +]".to_string()), + Key::_ManualKey("AtomicSwap".to_string(), "PendingSwaps".to_string(), "[ +]".to_string()), ] }, overriden: HashMap::new(), diff --git a/runtime/gdev/tests/common/golden_testing/key.rs b/runtime/gdev/tests/common/golden_testing/key.rs index 63121ce9f68f84e0994b7e33e8c8637da09303ed..94606ed94e34c29a14ea9bc7bf3fedb7c58d5dca 100644 --- a/runtime/gdev/tests/common/golden_testing/key.rs +++ b/runtime/gdev/tests/common/golden_testing/key.rs @@ -688,9 +688,9 @@ impl Key { Key::OffencesReports => { Some(|| to_kv(pallet_offences::Reports::<Runtime>::iter().collect())) } - // TODO: double map - // Key::OffencesConcurrentReportsIndex => Some(|| to_kv(pallet_offences::ConcurrentReportsIndex::<Runtime>::iter().collect())), - Key::OffencesConcurrentReportsIndex => None, + Key::OffencesConcurrentReportsIndex => Some(|| to_kv(pallet_offences::ConcurrentReportsIndex::<Runtime>::iter() + .map(to_simple_map) + .collect())), Key::SessionNextKeys => { Some(|| to_kv(pallet_session::NextKeys::<Runtime>::iter().collect())) } @@ -778,11 +778,10 @@ impl Key { .collect(), ) }), - // TODO: double map - // Key::AtomicSwapPendingSwaps => Some(|| to_kv(pallet_atomic_swap::PendingSwaps::<Runtime>::iter().collect())), - Key::AtomicSwapPendingSwaps => None, - // TODO: double map - // Key::MultisigMultisigs => Some(|| to_kv(pallet_multisig::Multisigs::<Runtime>::iter().collect())), + Key::AtomicSwapPendingSwaps => Some(|| to_kv(pallet_atomic_swap::PendingSwaps::<Runtime>::iter() + .map(to_simple_map).collect())), + Key::MultisigMultisigs => Some(|| to_kv(pallet_multisig::Multisigs::<Runtime>::iter() + .map(to_simple_map).collect())), Key::MultisigMultisigs => None, Key::ProvideRandomnessRequestsReadyAtEpoch => Some(|| { to_kv(pallet_provide_randomness::RequestsReadyAtEpoch::<Runtime>::iter().collect()) @@ -964,6 +963,15 @@ impl Key { // Some(Box::new(move || t)) // } +fn to_simple_map<K1, K2, V>((k1, k2, v): (K1, K2, V)) -> (String, V) +where + K1: Debug + 'static, + K2: Debug + 'static, + V: Debug + 'static, +{ + (format!("{:?} => {:?}", k1, k2), v) +} + fn to_kv<K: Debug + 'static, V: Debug + 'static>( hm: HashMap<K, V>, ) -> BTreeMap<Box<String>, Box<dyn Debug>> {