From 5d0e5e09e13d821c581d5ed29971db03f10cefce Mon Sep 17 00:00:00 2001 From: Michal Nazarewicz Date: Thu, 26 Oct 2023 02:21:28 +0200 Subject: [PATCH] wip --- common/blockchain/src/candidates/tests.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/blockchain/src/candidates/tests.rs b/common/blockchain/src/candidates/tests.rs index 62eab225..0b8d1cac 100644 --- a/common/blockchain/src/candidates/tests.rs +++ b/common/blockchain/src/candidates/tests.rs @@ -380,7 +380,6 @@ impl TestCtx { fn test(&mut self, pubkey: u8, stake: u8) { let old_state = self.candidates.clone(); let pubkey = MockPubKey(u32::from(pubkey)); - let stake = u128::from(stake); let this = self as *mut TestCtx; let res = std::panic::catch_unwind(|| { @@ -388,9 +387,9 @@ impl TestCtx { // self.candidates may be in inconsistent state. This is fine since // we’re panicking anyway. let this = unsafe { &mut *this }; - match u128::from(stake) { + match stake { 0 => this.test_remove(pubkey), - _ => this.test_update(pubkey.clone(), stake), + _ => this.test_update(pubkey.clone(), u128::from(stake)), } });