Skip to content

Commit

Permalink
Add ensure_successful before every consideration creation
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidK committed Sep 20, 2024
1 parent 4c48256 commit 0e9e2e8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions substrate/frame/proxy/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {

fn add_proxies<T: Config>(n: u32, maybe_who: Option<T::AccountId>) -> Result<(), &'static str> {
let caller = maybe_who.unwrap_or_else(whitelisted_caller);
T::ProxyConsideration::ensure_successful(
&caller,
Footprint::from_mel::<(ProxiesVec<T>, ProxyTicketOf<T>)>(),
);
for i in 0..n {
let real = T::Lookup::unlookup(account("target", i, SEED));
T::ProxyConsideration::ensure_successful(
&caller,
Footprint::from_mel::<(ProxiesVec<T>, ProxyTicketOf<T>)>(),
);
Proxy::<T>::add_proxy(
RawOrigin::Signed(caller.clone()).into(),
real,
Expand Down Expand Up @@ -73,11 +73,11 @@ fn add_announcements<T: Config>(
real
};
let real_lookup = T::Lookup::unlookup(real);
T::AnnouncementConsideration::ensure_successful(
&caller,
Footprint::from_mel::<(AnnouncementsVec<T>, AnnouncementTicketOf<T>)>(),
);
for _ in 0..n {
T::AnnouncementConsideration::ensure_successful(
&caller,
Footprint::from_mel::<(AnnouncementsVec<T>, AnnouncementTicketOf<T>)>(),
);
Proxy::<T>::announce(
RawOrigin::Signed(caller.clone()).into(),
real_lookup.clone(),
Expand Down

0 comments on commit 0e9e2e8

Please sign in to comment.