Remove unused background API methods (#12731)

These background API methods were not used anywhere in the UI. One of
them was called in `actions.js` by a function that itself was never
called, so it have been removed. Additionally, one unused `actions.js`
function was found and removed as well.

`setAdvancedGasFee` is the only unused background method that remains.
It was recently added and will be used in the near future.
feature/default_network_editable
Mark Stacey 3 years ago committed by GitHub
parent ecceb4d6da
commit cce2dda8e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      app/scripts/metamask-controller.js
  2. 19
      ui/store/actions.js

@ -1008,9 +1008,7 @@ export default class MetamaskController extends EventEmitter {
),
createCancelTransaction: nodeify(this.createCancelTransaction, this),
createSpeedUpTransaction: nodeify(this.createSpeedUpTransaction, this),
isNonceTaken: nodeify(txController.isNonceTaken, txController),
estimateGas: nodeify(this.estimateGas, this),
getPendingNonce: nodeify(this.getPendingNonce, this),
getNextNonce: nodeify(this.getNextNonce, this),
addUnapprovedTransaction: nodeify(
txController.addUnapprovedTransaction,
@ -1094,13 +1092,6 @@ export default class MetamaskController extends EventEmitter {
permissionsController.approvePermissionsRequest,
permissionsController,
),
clearPermissions: permissionsController.clearPermissions.bind(
permissionsController,
),
getApprovedAccounts: nodeify(
permissionsController.getAccounts,
permissionsController,
),
rejectPermissionsRequest: nodeify(
permissionsController.rejectPermissionsRequest,
permissionsController,

@ -1356,12 +1356,6 @@ export function acceptWatchAsset(suggestedAssetID) {
};
}
export function addKnownMethodData(fourBytePrefix, methodData) {
return () => {
background.addKnownMethodData(fourBytePrefix, methodData);
};
}
export function clearPendingTokens() {
return {
type: actionConstants.CLEAR_PENDING_TOKENS,
@ -2403,19 +2397,6 @@ export function removePermissionsFor(domains) {
};
}
/**
* Clears all permissions for all domains.
*/
export function clearPermissions() {
return (dispatch) => {
background.clearPermissions((err) => {
if (err) {
dispatch(displayWarning(err.message));
}
});
};
}
// Pending Approvals
/**

Loading…
Cancel
Save