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

Introduce Pallet paged-list #14120

Merged
merged 44 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
2604a36
Prototype StoragePagedList
ggwpez May 10, 2023
5b16ac7
Add drain
ggwpez May 10, 2023
6ece860
Remove stale docs
ggwpez May 10, 2023
c9f8a5c
Add fuzzer tests
ggwpez May 11, 2023
da9deb3
Update
ggwpez May 11, 2023
8a8acaa
Review
ggwpez May 11, 2023
caff2a2
fmt
ggwpez May 11, 2023
630784d
Docs and clippy
ggwpez May 11, 2023
7760e97
Sum docs
ggwpez May 11, 2023
42a0e48
Cleanup
ggwpez May 11, 2023
560d88c
Merge remote-tracking branch 'origin/master' into oty-paginated-list
ggwpez May 11, 2023
38c0ca1
Undo WIP
ggwpez May 12, 2023
1a6d383
Add pallet-paged-list
ggwpez May 12, 2023
1d82f6f
Move code to pallet
ggwpez May 13, 2023
2d6d7e3
Move fuzzer
ggwpez May 13, 2023
fd7f1a5
Cleanup
ggwpez May 13, 2023
6d3acec
fmt
ggwpez May 13, 2023
a3c82f3
docs
ggwpez May 30, 2023
e518331
Rename Appendix -> Appender
ggwpez May 30, 2023
314e4c0
Rename clear -> delete
ggwpez May 30, 2023
d2aa1b6
Feature gate testing stuff
ggwpez May 30, 2023
f0d4133
Docs review
ggwpez May 30, 2023
9a7afbb
Cleanup
ggwpez May 30, 2023
ac3c0db
doc review
ggwpez May 30, 2023
df2a610
Review renames
ggwpez May 30, 2023
c1f2e6e
Merge remote-tracking branch 'origin/master' into oty-paginated-list
ggwpez May 30, 2023
c3d78db
Add docs
ggwpez May 30, 2023
fbfe452
Fix fuzzer
ggwpez May 30, 2023
5e18eed
Docs + examples
ggwpez May 30, 2023
7315a3b
Remove hasher
ggwpez May 30, 2023
4958b10
Remove empty Event and Call
ggwpez May 30, 2023
a13223b
Remove MaxPages
ggwpez May 30, 2023
4d3ad58
Fix docs
ggwpez May 30, 2023
79cdffa
Test eager page removal
ggwpez May 30, 2023
ff3638c
Cleanup
ggwpez May 30, 2023
351678c
Update frame/paged-list/src/paged_list.rs
ggwpez May 31, 2023
a36a923
Fix docs
ggwpez May 31, 2023
715fc97
Remove as_*_vec
ggwpez May 31, 2023
98bbf9f
Merge remote-tracking branch 'origin/master' into oty-paginated-list
ggwpez May 31, 2023
8683686
Update versions
ggwpez May 31, 2023
19bdd0e
Rename ValuesPerPage -> ValuesPerNewPage
ggwpez May 31, 2023
dbceffa
Merge remote-tracking branch 'origin/master' into oty-paginated-list
Jul 19, 2023
551ad22
Update lockfile
ggwpez Jul 19, 2023
2cbaa8a
Fix mock
ggwpez Jul 19, 2023
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
15 changes: 15 additions & 0 deletions frame/support/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,21 @@ pub trait StorageValue<T: FullCodec> {
}
}

pub trait StoragePagedList<V: FullCodec> {
fn append<Item, EncodeLikeItem>(item: EncodeLikeItem)
where
Item: Encode,
EncodeLikeItem: EncodeLike<Item>;
}

pub trait IterableStorageList<V: FullCodec> {
type Iterator: Iterator<Item = V>;

fn iter() -> Self::Iterator;

fn drain() -> Self::Iterator;
}

/// A strongly-typed map in storage.
///
/// Details on implementation can be found at [`generator::StorageMap`].
Expand Down
2 changes: 2 additions & 0 deletions frame/support/src/storage/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ mod double_map;
mod key;
mod map;
mod nmap;
mod paged_list;
mod value;

pub use counted_map::{CountedStorageMap, CountedStorageMapInstance};
Expand All @@ -37,6 +38,7 @@ pub use key::{
};
pub use map::StorageMap;
pub use nmap::StorageNMap;
pub use paged_list::StoragePagedList;
pub use value::StorageValue;

/// Trait implementing how the storage optional value is converted into the queried type.
Expand Down
Loading