Files
pezkuwi-subxt/testing/ui-tests/src/storage.rs
T
wgyt 396762510a update copyright year (#1924)
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2025-02-24 16:07:29 +00:00

29 lines
1.0 KiB
Rust

// Copyright 2019-2025 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::{
v15::{StorageEntryMetadata, StorageEntryModifier, StorageEntryType},
RuntimeMetadataPrefixed,
};
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![],
}])
}