1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00

Remove unused code (#9564)

A number of unused parameters and `propTypes` have been merged, along
with an unused function.
This commit is contained in:
Mark Stacey 2020-10-13 11:18:22 -02:30 committed by GitHub
parent 4ce04b5cb9
commit ded43cbcdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 2 additions and 14 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -15,7 +15,7 @@ export function getToErrorObject (to, hasHexData = false, network) {
if (!hasHexData) {
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
}

View File

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