Skip to content

Commit

Permalink
test/tx_redelegate: prevent redelegation delegator from being validator
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Jan 26, 2024
1 parent aa1f5e5 commit cd43f1a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions wasm/wasm_source/src/tx_redelegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cd43f1a

Please sign in to comment.