Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
camfairchild committed Aug 8, 2024
1 parent 8a86e36 commit 43dbb6c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions runtime/tests/pallet_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,30 @@ fn test_proxy_pallet() {
}
}
}

#[test]
fn test_non_transfer_cannot_transfer() {
new_test_ext().execute_with(|| {
assert_ok!(Proxy::add_proxy(
RuntimeOrigin::signed(AccountId::from(ACCOUNT)),
AccountId::from(DELEGATE).into(),
ProxyType::NonTransfer,
0
));

let call = call_transfer();
assert_ok!(Proxy::proxy(
RuntimeOrigin::signed(AccountId::from(DELEGATE)),
AccountId::from(ACCOUNT).into(),
None,
Box::new(call.clone()),
));

System::assert_last_event(
pallet_proxy::Event::ProxyExecuted {
result: Err(SystemError::CallFiltered.into()),
}
.into(),
);
});
}

0 comments on commit 43dbb6c

Please sign in to comment.