Skip to content

Commit

Permalink
gas estimation for cudos to eth direction only
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaghettiOverload committed May 18, 2022
1 parent 7936fd3 commit f3abc16
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export default class CudosBridgeComponent extends ContextPageComponent<Props, St

let maximumAmount = BigNumber.maximum(balance, this.state.walletBalance).minus(this.state.minBridgeFeeAmount);

if (maximumAmount.gt(0)) {
if (maximumAmount.gt(0) && this.isFromCosmos(fromNetwork)) {
const simulatedCost = await this.setSimulatedMsgsCost(maximumAmount.toString());
maximumAmount = maximumAmount.minus(simulatedCost);
}
Expand Down Expand Up @@ -355,7 +355,11 @@ export default class CudosBridgeComponent extends ContextPageComponent<Props, St
onChangeAmount = async (amount: string) => {
clearTimeout(this.inputTimeouts.amount);
const bigAmount = new BigNumber(amount);
await this.setSimulatedMsgsCost(amount);
const fromNetwork = this.state.selectedFromNetwork;

if (this.isFromCosmos(fromNetwork)) {
await this.setSimulatedMsgsCost(amount);
}

this.setState({
amount: bigAmount,
Expand Down

0 comments on commit f3abc16

Please sign in to comment.