Remove unused code (#9564)

A number of unused parameters and `propTypes` have been merged, along
with an unused function.
feature/default_network_editable
Mark Stacey 4 years ago committed by GitHub
parent 4ce04b5cb9
commit ded43cbcdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/scripts/metamask-controller.js
  2. 1
      ui/app/components/app/modals/account-details-modal/account-details-modal.component.js
  3. 1
      ui/app/components/app/modals/export-private-key-modal/export-private-key-modal.container.js
  4. 1
      ui/app/components/app/modals/hide-token-confirmation-modal/hide-token-confirmation-modal.js
  5. 1
      ui/app/pages/confirm-transaction/conf-tx.js
  6. 4
      ui/app/pages/create-account/new-account.container.js
  7. 2
      ui/app/pages/send/send-content/add-recipient/add-recipient.js
  8. 4
      ui/app/selectors/selectors.js

@ -204,7 +204,6 @@ export default class MetamaskController extends EventEmitter {
this.keyringController = new KeyringController({ this.keyringController = new KeyringController({
keyringTypes: additionalKeyrings, keyringTypes: additionalKeyrings,
initState: initState.KeyringController, initState: initState.KeyringController,
getNetwork: this.networkController.getNetworkState.bind(this.networkController),
encryptor: opts.encryptor || undefined, encryptor: opts.encryptor || undefined,
}) })
this.keyringController.memStore.subscribe((s) => this._onKeyringControllerUpdate(s)) this.keyringController.memStore.subscribe((s) => this._onKeyringControllerUpdate(s))
@ -297,7 +296,6 @@ export default class MetamaskController extends EventEmitter {
this.swapsController = new SwapsController({ this.swapsController = new SwapsController({
getBufferedGasLimit: this.txController.txGasUtil.getBufferedGasLimit.bind(this.txController.txGasUtil), getBufferedGasLimit: this.txController.txGasUtil.getBufferedGasLimit.bind(this.txController.txGasUtil),
provider: this.provider, provider: this.provider,
getNetwork: this.networkController.getNetworkState.bind(this.networkController),
getProviderConfig: this.networkController.getProviderConfig.bind(this.networkController), getProviderConfig: this.networkController.getProviderConfig.bind(this.networkController),
tokenRatesStore: this.tokenRatesController.store, tokenRatesStore: this.tokenRatesController.store,
}) })

@ -52,7 +52,6 @@ export default class AccountDetailsModal extends Component {
<QrView <QrView
Qr={{ Qr={{
data: address, data: address,
network,
}} }}
/> />

@ -14,7 +14,6 @@ function mapStateToPropsFactory () {
return { return {
warning: state.appState.warning, warning: state.appState.warning,
privateKey: state.appState.accountDetail.privateKey, privateKey: state.appState.accountDetail.privateKey,
network: state.metamask.network,
selectedIdentity, selectedIdentity,
previousModalState: state.appState.modal.previousModalState.name, previousModalState: state.appState.modal.previousModalState.name,
} }

@ -7,7 +7,6 @@ import Button from '../../../ui/button'
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {
network: state.metamask.network,
token: state.appState.modal.modalState.props.token, token: state.appState.modal.modalState.props.token,
assetImages: state.metamask.assetImages, assetImages: state.metamask.assetImages,
} }

@ -33,7 +33,6 @@ function mapStateToProps (state) {
index: txId, index: txId,
warning: state.appState.warning, warning: state.appState.warning,
network: state.metamask.network, network: state.metamask.network,
provider: state.metamask.provider,
currentCurrency: state.metamask.currentCurrency, currentCurrency: state.metamask.currentCurrency,
blockGasLimit: state.metamask.currentBlockGasLimit, blockGasLimit: state.metamask.currentBlockGasLimit,
unapprovedMsgCount, unapprovedMsgCount,

@ -4,13 +4,11 @@ import { getMostRecentOverviewPage } from '../../ducks/history/history'
import NewAccountCreateForm from './new-account.component' import NewAccountCreateForm from './new-account.component'
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
const { metamask: { network, selectedAddress, identities = {} } } = state const { metamask: { identities = {} } } = state
const numberOfExistingAccounts = Object.keys(identities).length const numberOfExistingAccounts = Object.keys(identities).length
const newAccountNumber = numberOfExistingAccounts + 1 const newAccountNumber = numberOfExistingAccounts + 1
return { return {
network,
address: selectedAddress,
newAccountNumber, newAccountNumber,
mostRecentOverviewPage: getMostRecentOverviewPage(state), mostRecentOverviewPage: getMostRecentOverviewPage(state),
} }

@ -15,7 +15,7 @@ export function getToErrorObject (to, hasHexData = false, network) {
if (!hasHexData) { if (!hasHexData) {
toError = REQUIRED_ERROR toError = REQUIRED_ERROR
} }
} else if (!isValidAddress(to, network) && !toError) { } else if (!isValidAddress(to) && !toError) {
toError = isEthNetwork(network) ? INVALID_RECIPIENT_ADDRESS_ERROR : INVALID_RECIPIENT_ADDRESS_NOT_ETH_NETWORK_ERROR toError = isEthNetwork(network) ? INVALID_RECIPIENT_ADDRESS_ERROR : INVALID_RECIPIENT_ADDRESS_NOT_ETH_NETWORK_ERROR
} }

@ -326,7 +326,3 @@ export function getOriginOfCurrentTab (state) {
export function getIpfsGateway (state) { export function getIpfsGateway (state) {
return state.metamask.ipfsGateway return state.metamask.ipfsGateway
} }
export function getCustomNetworkId (state) {
return state.metamask.settings?.network
}

Loading…
Cancel
Save