Skip to content

Commit

Permalink
Merge branch 'tomas/client-check-bond-from-validator' (#1263)
Browse files Browse the repository at this point in the history
* tomas/client-check-bond-from-validator:
  client/tx/bond: prevent a bond from validator to another validator
  • Loading branch information
tzemanovic committed Apr 12, 2023
2 parents 23546b5 + 7d81029 commit df79301
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/src/lib/client/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2451,6 +2451,15 @@ pub async fn submit_bond(ctx: Context, args: args::Bond) {
safe_exit(1)
}
}
if source != &validator && rpc::is_validator(&client, source).await {
eprintln!(
"Cannot bond from a validator account {source} to another \
validator {validator}."
);
if !args.tx.force {
safe_exit(1)
}
}
}
// Check bond's source (source for delegation or validator for self-bonds)
// balance
Expand Down

0 comments on commit df79301

Please sign in to comment.