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

implement storage decode length for BTreeSet #12503

Merged
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
Next Next commit
implement storage decode length for BTreeSet
  • Loading branch information
dharjeezy committed Oct 16, 2022
commit 9de0248b5654e3ca1d6940153b5ce8dd444e9b9c
6 changes: 6 additions & 0 deletions frame/support/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ pub use self::{
},
types::StorageEntryMetadataBuilder,
};
use crate::pallet_prelude::storage::private::Sealed;
dharjeezy marked this conversation as resolved.
Show resolved Hide resolved
pub use sp_runtime::TransactionOutcome;
use sp_std::collections::btree_set::BTreeSet;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above we already include sp_std. Please move it there.

pub use types::Key;

pub mod bounded_btree_map;
Expand Down Expand Up @@ -1335,6 +1337,10 @@ mod private {
impl<T: Encode> StorageAppend<T> for Vec<T> {}
impl<T: Encode> StorageDecodeLength for Vec<T> {}

impl<T: Encode> Sealed for BTreeSet<T> {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please move this to the other implementations?

impl<T: Encode> StorageAppend<T> for BTreeSet<T> {}
impl<T: Encode> StorageDecodeLength for BTreeSet<T> {}

ggwpez marked this conversation as resolved.
Show resolved Hide resolved
/// We abuse the fact that SCALE does not put any marker into the encoding, i.e. we only encode the
/// internal vec and we can append to this vec. We have a test that ensures that if the `Digest`
/// format ever changes, we need to remove this here.
Expand Down