Add TypeInfo (#10010)

* add TypeInfo for DispatchTime

* add TypeInfo for BoundedBTreeSet

* add skip_type_params

* add TypeInfo for BoundedSlice

* add skip_type_params
This commit is contained in:
zjb0807
2021-10-13 18:49:34 +08:00
committed by GitHub
parent 71c8d423ca
commit be3d0ba4ab
2 changed files with 4 additions and 2 deletions
@@ -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<T, S>(BTreeSet<T>, PhantomData<S>);
impl<T, S> Decode for BoundedBTreeSet<T, S>
@@ -44,7 +44,8 @@ pub struct BoundedVec<T, S>(Vec<T>, PhantomData<S>);
/// 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<S>);
// `BoundedSlice`s encode to something which will always decode into a `BoundedVec`,