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:
parent
4ce04b5cb9
commit
ded43cbcdf
@ -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,
|
||||
})
|
||||
|
@ -52,7 +52,6 @@ export default class AccountDetailsModal extends Component {
|
||||
<QrView
|
||||
Qr={{
|
||||
data: address,
|
||||
network,
|
||||
}}
|
||||
/>
|
||||
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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),
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user