Skip to content

Commit

Permalink
Merge pull request #2454 from anoma/tomas/fix-tx-redelegate-input
Browse files Browse the repository at this point in the history
test/tx_redelegate: prevent redelegation delegator from being validator
  • Loading branch information
tzemanovic authored Jan 30, 2024
2 parents bfba3db + cd43f1a commit 7c0c2fe
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 7c0c2fe

Please sign in to comment.