This repository has been archived by the owner on May 24, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fixes #361. Restrict user from clicking "Scan" to process tx bef…
…ore gas is calculated * Add `isEstimatingTxFee` so we can check if all values including `gas` are available without actually having to calculate the tx fee and incorporate into estimateTxFee method * Display and disable the "Checking..." button if the `isEstimatingTxFee` returns false (i.e. `gas` still undefined) * Note: The bug associated with #361 appears to be Parity Signer-specific. If the user can click "Scan" before the `gas` has been calculated, then when it tries to go to the paritytech/fether/packages/fether-react/src/Send/TxQrCode/TxQrCode.js, where it calls `getRlp()` to get the value for the rlp prop of the QrSigner component, which calls `transactionToRlp(this.tx)` to get the RLP of the unsigned tx that is provided as an argument paritytech/fether/packages/fether-react/src/stores/sendStore.js, it crashes if `this.tx` contains a `gas` property that's undefined. So we need to prevent the user from being able to click "Scan" before the `gas` property has been determined. We do this by disabling the button and displaying "Checking..." until `isEstimatingTxFee` returns true, and only then do we display "Scan" and enable the button
- Loading branch information