Skip to content
Snippets Groups Projects
Commit be3d0ba4 authored by zjb0807's avatar zjb0807 Committed by GitHub
Browse files

Add TypeInfo (#10010)

* add TypeInfo for DispatchTime

* add TypeInfo for BoundedBTreeSet

* add skip_type_params

* add TypeInfo for BoundedSlice

* add skip_type_params
parent 71c8d423
No related merge requests found
......@@ -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`,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment