Skip to content

Commit ddadc79

Browse files
authored
remove unnecessary usage of renderableGasButton logic (#15422)
1 parent ea247d4 commit ddadc79

File tree

3 files changed

+1
-33
lines changed

3 files changed

+1
-33
lines changed

ui/pages/send/send-footer/send-footer.component.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export default class SendFooter extends Component {
2020
toAccounts: PropTypes.array,
2121
sendStage: PropTypes.string,
2222
sendErrors: PropTypes.object,
23-
gasEstimateType: PropTypes.string,
2423
mostRecentOverviewPage: PropTypes.string.isRequired,
2524
cancelTx: PropTypes.func,
2625
draftTransactionID: PropTypes.string,
@@ -53,14 +52,7 @@ export default class SendFooter extends Component {
5352

5453
async onSubmit(event) {
5554
event.preventDefault();
56-
const {
57-
addToAddressBookIfNew,
58-
sign,
59-
to,
60-
toAccounts,
61-
history,
62-
gasEstimateType,
63-
} = this.props;
55+
const { addToAddressBookIfNew, sign, to, toAccounts, history } = this.props;
6456
const { trackEvent } = this.context;
6557

6658
// TODO: add nickname functionality
@@ -74,7 +66,6 @@ export default class SendFooter extends Component {
7466
properties: {
7567
action: 'Edit Screen',
7668
legacy_event: true,
77-
gasChanged: gasEstimateType,
7869
},
7970
});
8071
history.push(CONFIRM_TRANSACTION_ROUTE);

ui/pages/send/send-footer/send-footer.container.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import { connect } from 'react-redux';
22
import { addToAddressBook, cancelTx } from '../../../store/actions';
3-
import {
4-
getRenderableEstimateDataForSmallButtonsFromGWEI,
5-
getDefaultActiveButtonIndex,
6-
} from '../../../selectors';
73
import {
84
resetSendState,
9-
getGasPrice,
105
getSendStage,
116
getSendTo,
127
getSendErrors,
@@ -17,7 +12,6 @@ import {
1712
import { getMostRecentOverviewPage } from '../../../ducks/history/history';
1813
import { addHexPrefix } from '../../../../app/scripts/lib/util';
1914
import { getSendToAccounts } from '../../../ducks/metamask/metamask';
20-
import { CUSTOM_GAS_ESTIMATE } from '../../../../shared/constants/gas';
2115
import SendFooter from './send-footer.component';
2216

2317
export default connect(mapStateToProps, mapDispatchToProps)(SendFooter);
@@ -31,25 +25,13 @@ function addressIsNew(toAccounts, newAddress) {
3125
}
3226

3327
function mapStateToProps(state) {
34-
const gasButtonInfo = getRenderableEstimateDataForSmallButtonsFromGWEI(state);
35-
const gasPrice = getGasPrice(state);
36-
const activeButtonIndex = getDefaultActiveButtonIndex(
37-
gasButtonInfo,
38-
gasPrice,
39-
);
40-
const gasEstimateType =
41-
activeButtonIndex >= 0
42-
? gasButtonInfo[activeButtonIndex].gasEstimateType
43-
: CUSTOM_GAS_ESTIMATE;
44-
4528
return {
4629
disabled: isSendFormInvalid(state),
4730
to: getSendTo(state),
4831
toAccounts: getSendToAccounts(state),
4932
sendStage: getSendStage(state),
5033
sendErrors: getSendErrors(state),
5134
draftTransactionID: getDraftTransactionID(state),
52-
gasEstimateType,
5335
mostRecentOverviewPage: getMostRecentOverviewPage(state),
5436
};
5537
}

ui/pages/send/send-footer/send-footer.container.test.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ jest.mock('../../../ducks/send', () => ({
3131
signTransaction: jest.fn(),
3232
}));
3333

34-
jest.mock('../../../selectors/custom-gas', () => ({
35-
getRenderableEstimateDataForSmallButtonsFromGWEI: (s) => [
36-
{ gasEstimateType: `mockGasEstimateType:${s}` },
37-
],
38-
}));
3934
require('./send-footer.container');
4035

4136
describe('send-footer container', () => {

0 commit comments

Comments
 (0)