Repository: paritytech/substrate
File: frame/proxy/src/lib.rs (Rust)

Code before:
			delegate: AccountIdLookupOf<T>,
			proxy_type: T::ProxyType,
			delay: T::BlockNumber,
		) -> DispatchResult {
			let who = ensure_signed(origin)?;
			let delegate = T::Lookup::lookup(delegate)?;
			Self::remove_proxy_delegate(&who, delegate, proxy_type, delay)
		}

		/// Unregister all proxy accounts for the sender.
		///
		/// The dispatch origin for this call must be _Signed_.
		///
		/// WARNING: This may be called on accounts created by `pure`, however if done, then
		/// the unreserved fees will be inaccessible. **All access to this account will be lost.**
		#[pallet::call_index(3)]
		#[pallet::weight(T::WeightInfo::remove_proxies(T::MaxProxies::get()))]
		pub fn remove_proxies(origin: OriginFor<T>) -> DispatchResult {
			// Ensure that the origin is a signed account.
			let who = ensure_signed(origin)?;

			// Call the `remove_all_proxy_delegates` method to remove all proxies associated with
			// `who`.
			<Pallet<T>>::remove_all_proxy_delegates(who)?;

			// Return success.
			Ok(())
		}

		/// Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and
		/// initialize it with a proxy of `proxy_type` for `origin` sender.
		///
		/// Requires a `Signed` origin.
		///
		/// - `proxy_type`: The type of the proxy that the sender will be registered as over the
		/// new account. This will almost always be the most permissive `ProxyType` possible to
		/// allow for maximum flexibility.
		/// - `index`: A disambiguation index, in case this is called multiple times in the same
		/// transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just
		/// want to use `0`.
		/// - `delay`: The announcement period required of the initial proxy. Will generally be
		/// zero.
		///
		/// Fails with `Duplicate` if this has already been called in this transaction, from the
		/// same sender, with the same parameters.
		///
		/// Fails if there are insufficient funds to pay for deposit.
		#[pallet::call_index(4)]
		#[pallet::weight(T::WeightInfo::create_pure(T::MaxProxies::get()))]
		pub fn create_pure(
			origin: OriginFor<T>,

Review comment (suggestion):
The commenting here is a bit excessive -- same with the function body of `remove_all_proxy_delegates`.

Code after:
		/// initialize it with a proxy of `proxy_type` for `origin` sender.
		///
		/// Requires a `Signed` origin.
		///
		/// - `proxy_type`: The type of the proxy that the sender will be registered as over the
		/// new account. This will almost always be the most permissive `ProxyType` possible to
		/// allow for maximum flexibility.
		/// - `index`: A disambiguation index, in case this is called multiple times in the same
		/// transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just
		/// want to use `0`.
		/// - `delay`: The announcement period required of the initial proxy. Will generally be
		/// zero.
		///
		/// Fails with `Duplicate` if this has already been called in this transaction, from the
		/// same sender, with the same parameters.
		///
		/// Fails if there are insufficient funds to pay for deposit.
		#[pallet::call_index(4)]
		#[pallet::weight(T::WeightInfo::create_pure(T::MaxProxies::get()))]
		pub fn create_pure(
			origin: OriginFor<T>,
			proxy_type: T::ProxyType,
			delay: T::BlockNumber,
			index: u16,
		) -> DispatchResult {
			let who = ensure_signed(origin)?;

			let pure = Self::pure_account(&who, &proxy_type, index, None);
			ensure!(!Proxies::<T>::contains_key(&pure), Error::<T>::Duplicate);

			let proxy_def =
				ProxyDefinition { delegate: who.clone(), proxy_type: proxy_type.clone(), delay };
			let bounded_proxies: BoundedVec<_, T::MaxProxies> =
				vec![proxy_def].try_into().map_err(|_| Error::<T>::TooMany)?;

			let deposit = T::ProxyDepositBase::get() + T::ProxyDepositFactor::get();
			T::Currency::reserve(&who, deposit)?;

			Proxies::<T>::insert(&pure, (bounded_proxies, deposit));
			Self::deposit_event(Event::PureCreated {
				pure,
				who,
				proxy_type,
				disambiguation_index: index,
			});

			Ok(())
		}

		/// Removes a previously spawned pure proxy.
		///