Files
pezkuwi-subxt/testing/ui-tests/src/storage.rs
T
2022-06-28 14:09:41 +01:00

31 lines
1.0 KiB
Rust

// Copyright 2019-2022 Parity Technologies (UK) Ltd.
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
use frame_metadata::{
RuntimeMetadataPrefixed,
StorageEntryMetadata,
StorageEntryModifier,
StorageEntryType,
};
use scale_info::meta_type;
use crate::utils::generate_metadata_from_storage_entries;
/// Generate metadata which contains a `Map` storage entry with no hashers/values.
/// This is a bit of an odd case, but it was raised in https://github.com/paritytech/subxt/issues/552,
/// and this test will fail before the fix and should pass once the fix is applied.
pub fn metadata_storage_map_no_keys() -> RuntimeMetadataPrefixed {
generate_metadata_from_storage_entries(vec![StorageEntryMetadata {
name: "MapWithNoKeys",
modifier: StorageEntryModifier::Optional,
ty: StorageEntryType::Map {
hashers: vec![],
key: meta_type::<()>(),
value: meta_type::<u32>(),
},
default: vec![0],
docs: vec![],
}])
}