Skip to content

Commit

Permalink
apply nit
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Feb 6, 2025
1 parent 209c51e commit c54ba1e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions mm2src/coins/tendermint/tendermint_coin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2130,14 +2130,13 @@ impl TendermintCoin {
validator_address: AccountId,
denom: Denom,
amount: u128,
) -> Result<Any, String> {
) -> Result<Any, ErrorReport> {
MsgDelegate {
delegator_address,
validator_address,
amount: Coin { denom, amount },
}
.to_any()
.map_err(|e| e.to_string())
}

/// Calculates the send and total amounts.
Expand Down Expand Up @@ -2204,7 +2203,7 @@ impl TendermintCoin {
self.denom.clone(),
amount_u64.into(),
)
.map_err(DelegationError::InternalError)?;
.map_err(|e| DelegationError::InternalError(e.to_string()))?;

let timeout_height = self
.current_block()
Expand Down Expand Up @@ -2254,7 +2253,7 @@ impl TendermintCoin {
self.denom.clone(),
amount_u64.into(),
)
.map_err(DelegationError::InternalError)?;
.map_err(|e| DelegationError::InternalError(e.to_string()))?;

let account_info = self.account_info(&delegator_address).await?;

Expand Down Expand Up @@ -2304,14 +2303,13 @@ impl TendermintCoin {
validator_address: AccountId,
denom: Denom,
amount: u128,
) -> Result<Any, String> {
) -> Result<Any, ErrorReport> {
MsgUndelegate {
delegator_address,
validator_address,
amount: Coin { denom, amount },
}
.to_any()
.map_err(|e| e.to_string())
}

let (delegator_address, maybe_priv_key) = self
Expand Down Expand Up @@ -2343,7 +2341,7 @@ impl TendermintCoin {
self.denom.clone(),
uamount_to_undelegate.into(),
)
.map_err(DelegationError::InternalError)?;
.map_err(|e| DelegationError::InternalError(e.to_string()))?;

let timeout_height = self
.current_block()
Expand Down

0 comments on commit c54ba1e

Please sign in to comment.