Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Calling proxy doesn't remove announcement #13267

Merged
merged 3 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions frame/proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ pub mod pallet {
/// Dispatch the given `call` from an account that the sender is authorised for through
/// `add_proxy`.
///
/// Removes any corresponding announcement(s).
///
/// The dispatch origin for this call must be _Signed_.
///
/// Parameters:
Expand Down
17 changes: 17 additions & 0 deletions frame/proxy/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,23 @@ fn announcer_must_be_proxy() {
});
}

#[test]
fn calling_proxy_doesnt_remove_announcement() {
new_test_ext().execute_with(|| {
assert_ok!(Proxy::add_proxy(RuntimeOrigin::signed(1), 2, ProxyType::Any, 0));

let call = Box::new(call_transfer(6, 1));
let call_hash = BlakeTwo256::hash_of(&call);

assert_ok!(Proxy::announce(RuntimeOrigin::signed(2), 1, call_hash));
assert_ok!(Proxy::proxy(RuntimeOrigin::signed(2), 1, None, call));

// The announcement is not removed by calling proxy.
let announcements = Announcements::<Test>::get(2);
assert_eq!(announcements.0, vec![Announcement { real: 1, call_hash, height: 1 }]);
});
}

#[test]
fn delayed_requires_pre_announcement() {
new_test_ext().execute_with(|| {
Expand Down