Skip to content

Commit

Permalink
Migrate pallet-proxy to pallet attribute macro (paritytech#8365)
Browse files Browse the repository at this point in the history
* Migrate pallet-proxy to pallet attribute macro

Part of paritytech#7882.

Converts the `Proxy` pallet to the new pallet attribute macro introduced in paritytech#6877.

[Upgrade guidelines used](https://substrate.dev/rustdocs/v3.0.0/frame_support/attr.pallet.html#upgrade-guidelines).

## ⚠️ Breaking Change  ⚠️ 

From [checking upgrade guidelines](https://crates.parity.io/frame_support/attr.pallet.html#checking-upgrade-guidelines)

> storages now use PalletInfo for module_prefix instead of the one given to `decl_storage`: use of this pallet in `construct_runtime!` needs careful updating of the name in order to not break storage or to upgrade storage (moreover for instantiable pallet). If pallet is published, make sure to warn about this breaking change.

So users of the `Assets` pallet must be careful about the name they used in `construct_runtime!`. Hence the `runtime-migration` label, which might not be needed depending on the configuration of the `Assets` pallet.

### Notes

There are some changes to the docs in metadata for the constants. The docs in the metadata for constants are now more complete.
  • Loading branch information
emostov authored and hirschenberger committed Apr 14, 2021
1 parent 6c251c3 commit 816ab5d
Show file tree
Hide file tree
Showing 3 changed files with 247 additions and 189 deletions.
8 changes: 4 additions & 4 deletions frame/proxy/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ benchmarks! {
let call: <T as Config>::Call = frame_system::Call::<T>::remark(vec![]).into();
}: _(RawOrigin::Signed(caller), real, Some(T::ProxyType::default()), Box::new(call))
verify {
assert_last_event::<T>(RawEvent::ProxyExecuted(Ok(())).into())
assert_last_event::<T>(Event::ProxyExecuted(Ok(())).into())
}

proxy_announced {
Expand All @@ -111,7 +111,7 @@ benchmarks! {
add_announcements::<T>(a, Some(delegate.clone()), None)?;
}: _(RawOrigin::Signed(caller), delegate, real, Some(T::ProxyType::default()), Box::new(call))
verify {
assert_last_event::<T>(RawEvent::ProxyExecuted(Ok(())).into())
assert_last_event::<T>(Event::ProxyExecuted(Ok(())).into())
}

remove_announcement {
Expand Down Expand Up @@ -169,7 +169,7 @@ benchmarks! {
let call_hash = T::CallHasher::hash_of(&call);
}: _(RawOrigin::Signed(caller.clone()), real.clone(), call_hash)
verify {
assert_last_event::<T>(RawEvent::Announced(real, caller, call_hash).into());
assert_last_event::<T>(Event::Announced(real, caller, call_hash).into());
}

add_proxy {
Expand Down Expand Up @@ -220,7 +220,7 @@ benchmarks! {
)
verify {
let anon_account = Module::<T>::anonymous_account(&caller, &T::ProxyType::default(), 0, None);
assert_last_event::<T>(RawEvent::AnonymousCreated(
assert_last_event::<T>(Event::AnonymousCreated(
anon_account,
caller,
T::ProxyType::default(),
Expand Down

0 comments on commit 816ab5d

Please sign in to comment.