-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Bug Type
Functional
Reproduction steps
1- open the bridge webpage
2- select "Binance Smart Chain" as the source or destination
Actual result
BSC gas fee
doesn't get updated and always is the default value defined in the frontend web app.
BSC -> TON : default = 0.0002 BNB
TON -> BSC: default = 0.0008 BNB
Expected result
The bridge should fetch the current gas fee and show it to the user.
Also,
If the current gas fees are lower than the default values, users would be charged more than necessary in their transactions.
And if the current gas fees are higher than the default Gas fees, users' transactions would fail.
Reason
here is the reference to function getPairGasFee: https://github.com/ton-blockchain/bridge/blob/master/pages/index.vue#L339
This function uses bsc.main.getGasUrl
to fetch current fees from the network. it works perfectly for Eth, but it fails for BSC because of Cors policy:
Seems like the header 'Cache-Control': 'no-store, max-age=0'
set inside fetch is not accepted by the backend. This failing will be caught in catch
block and thus this line will be executed:
this.gasPrice = 0
Because of this error local gasPrice variable never gets updated and will be 0 when runtime reaches the line below:
this.gasPrice = gasPrice > 0 ? gasPrice : this.params.defaultGwei;
And this causes the this.gasPrice
to be equal to default values.
sulotion
I removed the header and everything is working perfectly without it. So I opened a pull request which deletes that specific header.
Suggested Severity
Critical
Device
Desktop (please complete the following information):
- OS: Windows
- Browser chrome, firefox
- Version 21H2
Additional Context
No response