mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-16 20:11:03 +00:00
fixed set_operational in GRANDPA pallet (#1226)
This commit is contained in:
committed by
Bastian Köcher
parent
bbf8b51f9c
commit
5beeb9b4d6
@@ -239,7 +239,7 @@ pub mod pallet {
|
|||||||
operational: bool,
|
operational: bool,
|
||||||
) -> DispatchResultWithPostInfo {
|
) -> DispatchResultWithPostInfo {
|
||||||
ensure_owner_or_root::<T, I>(origin)?;
|
ensure_owner_or_root::<T, I>(origin)?;
|
||||||
<IsHalted<T, I>>::put(operational);
|
<IsHalted<T, I>>::put(!operational);
|
||||||
|
|
||||||
if operational {
|
if operational {
|
||||||
log::info!(target: "runtime::bridge-grandpa", "Resuming pallet operations.");
|
log::info!(target: "runtime::bridge-grandpa", "Resuming pallet operations.");
|
||||||
@@ -804,9 +804,13 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn pallet_rejects_transactions_if_halted() {
|
fn pallet_rejects_transactions_if_halted() {
|
||||||
run_test(|| {
|
run_test(|| {
|
||||||
<IsHalted<TestRuntime>>::put(true);
|
initialize_substrate_bridge();
|
||||||
|
|
||||||
assert_noop!(submit_finality_proof(1), Error::<TestRuntime>::Halted,);
|
assert_ok!(Pallet::<TestRuntime>::set_operational(Origin::root(), false));
|
||||||
|
assert_noop!(submit_finality_proof(1), Error::<TestRuntime>::Halted);
|
||||||
|
|
||||||
|
assert_ok!(Pallet::<TestRuntime>::set_operational(Origin::root(), true));
|
||||||
|
assert_ok!(submit_finality_proof(1));
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user