Skip to content

Commit

Permalink
Merge pull request #17 from CudoVentures/setting-gas-estimation-for-c…
Browse files Browse the repository at this point in the history
…udos-to-eth-direction-only

gas estimation for cudos to eth direction only
  • Loading branch information
avalkov authored May 18, 2022
2 parents 7936fd3 + f3abc16 commit 928b5ff
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 928b5ff

Please sign in to comment.