Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

implemented contains_prefix for StorageDoubleMap and StorageNMap #13232

Merged
merged 5 commits into from
Feb 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
warning unexpected behaviour with empty keys
Signed-off-by: muraca <mmuraca247@gmail.com>
  • Loading branch information
muraca committed Jan 26, 2023
commit 5c1a05717ee0e28bf13aa6e0cc0c8d2214237e92
2 changes: 2 additions & 0 deletions frame/support/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ pub trait StorageDoubleMap<K1: FullEncode, K2: FullEncode, V: FullCodec> {
KArg1: ?Sized + EncodeLike<K1>;

/// Does any value under the first key `k1` (explicitly) exist in storage?
/// Might have unexpected behaviour with empty keys, e.g. `[]`.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
fn contains_prefix<KArg1>(k1: KArg1) -> bool
where
KArg1: EncodeLike<K1>;
Expand Down Expand Up @@ -739,6 +740,7 @@ pub trait StorageNMap<K: KeyGenerator, V: FullCodec> {
K: HasKeyPrefix<KP>;

/// Does any value under a `partial_key` prefix (explicitly) exist in storage?
/// Might have unexpected behaviour with empty keys, e.g. `[]`.
fn contains_prefix<KP>(partial_key: KP) -> bool
where
K: HasKeyPrefix<KP>;
Expand Down