Skip to content

Commit ad31477

Browse files
author
David Kazlauskas
committed
Fix typos, comments, remove unneded type annotations
1 parent 6463236 commit ad31477

File tree

1 file changed

+8
-20
lines changed
  • substrate/frame/proxy/src

1 file changed

+8
-20
lines changed

substrate/frame/proxy/src/lib.rs

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,10 @@ pub mod pallet {
148148
+ Default
149149
+ MaxEncodedLen;
150150

151-
/// A means of providing some cost for storing annoucement data on-chain.
151+
/// A means of providing some cost for storing announcement data on-chain.
152152
type AnnouncementConsideration: Consideration<Self::AccountId, Footprint>;
153153

154-
/// The amount of currency needed per proxy added.
155-
///
156-
/// This is held for adding 32 bytes plus an instance of `ProxyType` more into a
157-
/// pre-existing storage value. Thus, when configuring `ProxyDepositFactor` one should take
158-
/// into account `32 + proxy_type.encode().len()` bytes of data.
154+
/// A means of providing some cost for storing proxy data on-chain.
159155
type ProxyConsideration: Consideration<Self::AccountId, Footprint>;
160156

161157
/// The maximum amount of proxies allowed for a single account.
@@ -420,22 +416,18 @@ pub mod pallet {
420416
let (mut pending, ticket) = if let Some(v) = value.take() {
421417
v
422418
} else {
423-
let bounded_announcements: BoundedVec<
424-
Announcement<T::AccountId, CallHashOf<T>, BlockNumberFor<T>>,
425-
T::MaxPending,
426-
> = Default::default();
427419
(
428-
bounded_announcements,
420+
Default::default(),
429421
T::AnnouncementConsideration::new(
430422
&who,
431-
Footprint::from_parts(0, Self::annoucement_size_bytes()),
423+
Footprint::from_parts(0, Self::announcement_size_bytes()),
432424
)?,
433425
)
434426
};
435427
pending.try_push(announcement).map_err(|_| Error::<T>::TooMany)?;
436428
let new_ticket = ticket.clone().update(
437429
&who,
438-
Footprint::from_parts(pending.len(), Self::annoucement_size_bytes()),
430+
Footprint::from_parts(pending.len(), Self::announcement_size_bytes()),
439431
)?;
440432
*value = Some((pending, new_ticket));
441433
Ok::<(), DispatchError>(())
@@ -632,7 +624,7 @@ pub mod pallet {
632624
}
633625

634626
impl<T: Config> Pallet<T> {
635-
const fn annoucement_size_bytes() -> usize {
627+
const fn announcement_size_bytes() -> usize {
636628
core::mem::size_of::<Announcement<T::AccountId, CallHashOf<T>, BlockNumberFor<T>>>()
637629
}
638630

@@ -708,12 +700,8 @@ impl<T: Config> Pallet<T> {
708700
let (mut proxies, ticket) = if let Some(v) = value.take() {
709701
v
710702
} else {
711-
let bounded_proxies: BoundedVec<
712-
ProxyDefinition<T::AccountId, T::ProxyType, BlockNumberFor<T>>,
713-
T::MaxProxies,
714-
> = Default::default();
715703
(
716-
bounded_proxies,
704+
Default::default(),
717705
T::ProxyConsideration::new(
718706
delegator,
719707
Footprint::from_parts(0, Self::proxy_def_size_bytes()),
@@ -800,7 +788,7 @@ impl<T: Config> Pallet<T> {
800788
ensure!(orig_pending_len > pending.len(), Error::<T>::NotFound);
801789
let new_ticket = ticket.update(
802790
delegate,
803-
Footprint::from_parts(pending.len(), Self::annoucement_size_bytes()),
791+
Footprint::from_parts(pending.len(), Self::announcement_size_bytes()),
804792
)?;
805793
*x = Some((pending, new_ticket));
806794
Ok(())

0 commit comments

Comments
 (0)