Skip to content

Commit 43dbb6c

Browse files
committed
add test
1 parent 8a86e36 commit 43dbb6c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

runtime/tests/pallet_proxy.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,30 @@ fn test_proxy_pallet() {
200200
}
201201
}
202202
}
203+
204+
#[test]
205+
fn test_non_transfer_cannot_transfer() {
206+
new_test_ext().execute_with(|| {
207+
assert_ok!(Proxy::add_proxy(
208+
RuntimeOrigin::signed(AccountId::from(ACCOUNT)),
209+
AccountId::from(DELEGATE).into(),
210+
ProxyType::NonTransfer,
211+
0
212+
));
213+
214+
let call = call_transfer();
215+
assert_ok!(Proxy::proxy(
216+
RuntimeOrigin::signed(AccountId::from(DELEGATE)),
217+
AccountId::from(ACCOUNT).into(),
218+
None,
219+
Box::new(call.clone()),
220+
));
221+
222+
System::assert_last_event(
223+
pallet_proxy::Event::ProxyExecuted {
224+
result: Err(SystemError::CallFiltered.into()),
225+
}
226+
.into(),
227+
);
228+
});
229+
}

0 commit comments

Comments
 (0)