Skip to content

Commit

Permalink
fix: cosmos balance parsing (#3036)
Browse files Browse the repository at this point in the history
@tkporter reported that cosmos balance strings were being interpreted as
hex when parsed, causing them to appear much larger. This fixes by
parsing as decimal.

Tested manually by checking the metrics endpoint.
  • Loading branch information
daniel-savu authored Dec 7, 2023
1 parent 313a2ab commit 86b7f98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust/chains/hyperlane-cosmos/src/providers/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ impl WasmGrpcProvider {
.balance
.ok_or_else(|| ChainCommunicationError::from_other_str("account not present"))?;

Ok(balance.amount.parse()?)
Ok(U256::from_dec_str(&balance.amount)?)
}

/// Queries an account.
Expand Down

0 comments on commit 86b7f98

Please sign in to comment.