mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
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:
@@ -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`,
|
||||
|
||||
Reference in New Issue
Block a user