Skip to content

Commit

Permalink
refactor: rn isEthGasPrice -> isEthGasPriceFetched (#24826)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

small PR to rename const name isEthGasPrice -> isEthGasPriceFetched

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/24826?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
digiwand authored Jun 3, 2024
1 parent 3c696ba commit 86bb66e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default class ConfirmTransactionBase extends Component {
hideSenderToRecipient: PropTypes.bool,
showAccountInHeader: PropTypes.bool,
mostRecentOverviewPage: PropTypes.string.isRequired,
isEthGasPrice: PropTypes.bool,
isEthGasPriceFetched: PropTypes.bool,
noGasPrice: PropTypes.bool,
setDefaultHomeActiveTabName: PropTypes.func,
primaryTotalTextOverride: PropTypes.string,
Expand Down Expand Up @@ -203,7 +203,7 @@ export default class ConfirmTransactionBase extends Component {
customNonceValue,
toAddress,
tryReverseResolveAddress,
isEthGasPrice,
isEthGasPriceFetched,
setDefaultHomeActiveTabName,
hexMaximumTransactionFee,
useMaxValue,
Expand All @@ -213,7 +213,7 @@ export default class ConfirmTransactionBase extends Component {
nextNonce: prevNextNonce,
toAddress: prevToAddress,
transactionStatus: prevTxStatus,
isEthGasPrice: prevIsEthGasPrice,
isEthGasPriceFetched: prevIsEthGasPriceFetched,
hexMaximumTransactionFee: prevHexMaximumTransactionFee,
} = prevProps;
const statusUpdated = transactionStatus !== prevTxStatus;
Expand Down Expand Up @@ -249,8 +249,8 @@ export default class ConfirmTransactionBase extends Component {
tryReverseResolveAddress(toAddress);
}

if (isEthGasPrice !== prevIsEthGasPrice) {
if (isEthGasPrice) {
if (isEthGasPriceFetched !== prevIsEthGasPriceFetched) {
if (isEthGasPriceFetched) {
this.setState({
ethGasPriceWarning: this.context.t(ETH_GAS_PRICE_FETCH_WARNING_KEY),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ const mapStateToProps = (state, ownProps) => {
);

customNonceValue = getCustomNonceValue(state);
const isEthGasPrice = getIsEthGasPriceFetched(state);
const isEthGasPriceFetched = getIsEthGasPriceFetched(state);
const noGasPrice = !supportsEIP1559 && getNoGasPriceFetched(state);
const { useNativeCurrencyAsPrimaryCurrency } = getPreferences(state);
const gasFeeIsCustom =
Expand Down Expand Up @@ -313,7 +313,7 @@ const mapStateToProps = (state, ownProps) => {
mostRecentOverviewPage: getMostRecentOverviewPage(state),
isMainnet,
selectedNetworkClientId,
isEthGasPrice,
isEthGasPriceFetched,
noGasPrice,
supportsEIP1559,
gasIsLoading: isGasEstimatesLoading || gasLoadingAnimationIsShowing,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class SendContent extends Component {
warning: PropTypes.string,
error: PropTypes.string,
gasIsExcessive: PropTypes.bool.isRequired,
isEthGasPrice: PropTypes.bool,
isEthGasPriceFetched: PropTypes.bool,
noGasPrice: PropTypes.bool,
networkOrAccountNotSupports1559: PropTypes.bool,
asset: PropTypes.object,
Expand All @@ -42,7 +42,7 @@ export default class SendContent extends Component {
warning,
error,
gasIsExcessive,
isEthGasPrice,
isEthGasPriceFetched,
noGasPrice,
networkOrAccountNotSupports1559,
asset,
Expand Down Expand Up @@ -70,7 +70,7 @@ export default class SendContent extends Component {
<PageContainerContent>
<div className="send-v2__form">
{assetError ? this.renderError(assetError) : null}
{isEthGasPrice
{isEthGasPriceFetched
? this.renderWarning(ETH_GAS_PRICE_FETCH_WARNING_KEY)
: null}
{error ? this.renderError(error) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {
noGasPrice: {
control: 'boolean',
},
isEthGasPrice: {
isEthGasPriceFetched: {
control: 'boolean',
},

Expand Down Expand Up @@ -103,7 +103,7 @@ DefaultStory.args = {
showHexData: false,
isOwnedAccount: true,
noGasPrice: false,
isEthGasPrice: false,
isEthGasPriceFetched: false,
gasIsExcessive: false,
error: 'connecting',
warning: 'connecting',
Expand Down Expand Up @@ -139,7 +139,7 @@ NftStory.args = {
showHexData: false,
isOwnedAccount: true,
noGasPrice: false,
isEthGasPrice: false,
isEthGasPriceFetched: false,
gasIsExcessive: false,
error: 'connecting',
warning: 'connecting',
Expand Down

0 comments on commit 86bb66e

Please sign in to comment.