From be3d0ba4ab05a4cd8cbf4eab7c650bfb62e38263 Mon Sep 17 00:00:00 2001 From: zjb0807 Date: Wed, 13 Oct 2021 18:49:34 +0800 Subject: [PATCH] Add TypeInfo (#10010) * add TypeInfo for DispatchTime * add TypeInfo for BoundedBTreeSet * add skip_type_params * add TypeInfo for BoundedSlice * add skip_type_params --- substrate/frame/support/src/storage/bounded_btree_set.rs | 3 ++- substrate/frame/support/src/storage/bounded_vec.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/substrate/frame/support/src/storage/bounded_btree_set.rs b/substrate/frame/support/src/storage/bounded_btree_set.rs index f74ff12854..ecfb0bdbd2 100644 --- a/substrate/frame/support/src/storage/bounded_btree_set.rs +++ b/substrate/frame/support/src/storage/bounded_btree_set.rs @@ -31,7 +31,8 @@ use sp_std::{ /// /// Unlike a standard `BTreeSet`, there is an enforced upper limit to the number of items in the /// set. All internal operations ensure this bound is respected. -#[derive(Encode)] +#[derive(Encode, scale_info::TypeInfo)] +#[scale_info(skip_type_params(S))] pub struct BoundedBTreeSet(BTreeSet, PhantomData); impl Decode for BoundedBTreeSet diff --git a/substrate/frame/support/src/storage/bounded_vec.rs b/substrate/frame/support/src/storage/bounded_vec.rs index f353127969..a60ed57cf2 100644 --- a/substrate/frame/support/src/storage/bounded_vec.rs +++ b/substrate/frame/support/src/storage/bounded_vec.rs @@ -44,7 +44,8 @@ pub struct BoundedVec(Vec, PhantomData); /// A bounded slice. /// /// Similar to a `BoundedVec`, but not owned and cannot be decoded. -#[derive(Encode)] +#[derive(Encode, scale_info::TypeInfo)] +#[scale_info(skip_type_params(S))] pub struct BoundedSlice<'a, T, S>(&'a [T], PhantomData); // `BoundedSlice`s encode to something which will always decode into a `BoundedVec`,