Skip to content

Commit

Permalink
feat(precompile-utils): implement helper methods
Browse files Browse the repository at this point in the history
  • Loading branch information
RomarQ committed May 21, 2024
1 parent 91f1c7a commit 3a0b98c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions precompiles/src/solidity/codec/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,3 +381,18 @@ impl<T, S> From<BoundedVec<T, S>> for Vec<T> {
value.inner
}
}

impl<T, S> Default for BoundedVec<T, S> {
fn default() -> Self {
Self {
inner: Default::default(),
_phantom: PhantomData,
}
}
}

impl<T, S> BoundedVec<T, S> {
pub fn len(&self) -> usize {
self.inner.len()
}
}

0 comments on commit 3a0b98c

Please sign in to comment.