Skip to content

Commit 3c2409c

Browse files
Szegookianenigma
authored andcommitted
Calling proxy doesn't remove announcement (paritytech#13267)
* Calling proxy doesn't remove announcement * Update frame/proxy/src/tests.rs Co-authored-by: Kian Paimani <[email protected]> * fmt --------- Co-authored-by: Kian Paimani <[email protected]>
1 parent d3e17db commit 3c2409c

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

frame/proxy/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,6 @@ pub mod pallet {
183183
/// Dispatch the given `call` from an account that the sender is authorised for through
184184
/// `add_proxy`.
185185
///
186-
/// Removes any corresponding announcement(s).
187-
///
188186
/// The dispatch origin for this call must be _Signed_.
189187
///
190188
/// Parameters:

frame/proxy/src/tests.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,23 @@ fn announcer_must_be_proxy() {
288288
});
289289
}
290290

291+
#[test]
292+
fn calling_proxy_doesnt_remove_announcement() {
293+
new_test_ext().execute_with(|| {
294+
assert_ok!(Proxy::add_proxy(RuntimeOrigin::signed(1), 2, ProxyType::Any, 0));
295+
296+
let call = Box::new(call_transfer(6, 1));
297+
let call_hash = BlakeTwo256::hash_of(&call);
298+
299+
assert_ok!(Proxy::announce(RuntimeOrigin::signed(2), 1, call_hash));
300+
assert_ok!(Proxy::proxy(RuntimeOrigin::signed(2), 1, None, call));
301+
302+
// The announcement is not removed by calling proxy.
303+
let announcements = Announcements::<Test>::get(2);
304+
assert_eq!(announcements.0, vec![Announcement { real: 1, call_hash, height: 1 }]);
305+
});
306+
}
307+
291308
#[test]
292309
fn delayed_requires_pre_announcement() {
293310
new_test_ext().execute_with(|| {

0 commit comments

Comments
 (0)