From cd43f1aa3673e7b95d32b4d4553c3807988fabe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Fri, 26 Jan 2024 11:05:15 +0000 Subject: [PATCH] test/tx_redelegate: prevent redelegation delegator from being validator --- wasm/wasm_source/src/tx_redelegate.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wasm/wasm_source/src/tx_redelegate.rs b/wasm/wasm_source/src/tx_redelegate.rs index b3bce78c24..c4f9e240bb 100644 --- a/wasm/wasm_source/src/tx_redelegate.rs +++ b/wasm/wasm_source/src/tx_redelegate.rs @@ -403,9 +403,15 @@ mod tests { token::testing::arb_amount_non_zero_ceiled(max_amount), ) .prop_filter_map( - "Src and dest validator must not be the same", + "Src and dest validator must not be the same and owner must \ + not be a validator", |(src_validator, dest_validator, owner, amount)| { - if src_validator == dest_validator { + let is_owner_validator = matches!( + &owner, + Address::Established(owner) + if owner == &src_validator || owner == &dest_validator + ); + if is_owner_validator || src_validator == dest_validator { None } else { let src_validator = Address::Established(src_validator);