Skip to content

Commit

Permalink
Problem: u64 is not enough for gas fee (PeggyJV#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-nguy authored Oct 12, 2022
1 parent be6e80c commit 4bf090b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions orchestrator/cosmos_gravity/src/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ pub async fn send_messages<CS: CosmosSigner>(
args.fee.gas_limit = cmp::max(gas_limit as u64, 500000 * messages.len() as u64);

// compute the fee as fee=ceil(gas_limit * gas_price)
let fee_amount: f64 = args.fee.gas_limit as f64 * gas_price.0;
let fee_amount: u64 = fee_amount.abs().ceil() as u64;
let fee_amount = (args.fee.gas_limit as u128).checked_mul(gas_price.0 as u128)
.ok_or_else( || GravityError::OverflowError("fee amount".to_string()))?;
let fee_amount = Coin {
denom: gas_price.1,
amount: fee_amount.into(),
Expand Down

0 comments on commit 4bf090b

Please sign in to comment.