Skip to content

Commit f32790a

Browse files
authored
fix: 1Inch gas estimation has decimals (#953)
1 parent 0752eae commit f32790a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/providers/one_inch.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,8 @@ impl ConversionProvider for OneInchProvider {
627627
data: body.tx.data,
628628
amount: body.dst_amount,
629629
eip155: Some(ConvertTxEip155 {
630-
gas: (body.tx.gas as f64 * GAS_ESTIMATION_SLIPPAGE).to_string(),
630+
gas: (f64::ceil(body.tx.gas as f64 * GAS_ESTIMATION_SLIPPAGE) as usize)
631+
.to_string(),
631632
gas_price: body.tx.gas_price,
632633
}),
633634
},

0 commit comments

Comments
 (0)