Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

Commit 422d128

Browse files
committed
you don't need validator address when withdrawing rewards&commission as you can figure it out.
1 parent af9566e commit 422d128

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/distribution.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ pub enum DistributionCommand {
3939
Withdraw {
4040
/// delegator. The nickname in the wallet used to sign the transaction, and transfer the initial amount
4141
delegator: String,
42-
#[structopt(name = "validator", help = "the validator's terravaloper address")]
43-
/// the validator's oper terravaloper1XXXXXXXXX.
44-
validator: String,
4542
},
4643
}
4744

@@ -115,11 +112,12 @@ pub async fn distribution_cmd_parse<'a>(
115112
}
116113
DistributionCommand::Withdraw {
117114
delegator,
118-
validator,
115+
//validator,
119116
} => {
120117
log::info!("Delegator {}", &delegator);
121118
let delegator_key = wallet.get_private_key(&secp, &delegator, seed)?;
122119
let delegator_account = delegator_key.public_key(&secp).account()?;
120+
let validator = delegator_key.public_key(&secp).operator_address()?;
123121

124122
log::info!("Validator {}", &validator);
125123
let msg_commission = MsgWithdrawValidatorCommission::create(validator.clone());

0 commit comments

Comments
 (0)