Skip to content

Commit 8c3efd5

Browse files
authored
Release 1.0.10
Release 1.0.10
2 parents a6f58a9 + 00108a2 commit 8c3efd5

File tree

6 files changed

+62
-36
lines changed

6 files changed

+62
-36
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Current Develop Branch
44

5+
## v1.0.10 - Jan 25 2021
6+
- [#2164](https://github.com/MetaMask/metamask-mobile/pull/2164): Initialize NetworkController.provider with chainId (#2164)
7+
- [#2161](https://github.com/MetaMask/metamask-mobile/pull/2161): chainid migration (#2161)
8+
59
## v1.0.9 - Jan 21 2021
610
- [#2149](https://github.com/MetaMask/metamask-mobile/pull/2149): update tests for new logic
711
- [#2145](https://github.com/MetaMask/metamask-mobile/pull/2145): Add missing brew installation steps

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ android {
166166
applicationId "io.metamask"
167167
minSdkVersion rootProject.ext.minSdkVersion
168168
targetSdkVersion rootProject.ext.targetSdkVersion
169-
versionCode 43
170-
versionName "1.0.9"
169+
versionCode 44
170+
versionName "1.0.10"
171171
multiDexEnabled true
172172
testBuildType System.getProperty('testBuildType', 'debug')
173173
missingDimensionStrategy "minReactNative", "minReactNative46"

app/core/Engine.js

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -75,37 +75,34 @@ class Engine {
7575
}),
7676
new PersonalMessageManager(),
7777
new MessageManager(),
78-
new NetworkController(
79-
{
80-
infuraProjectId: process.env.MM_INFURA_PROJECT_ID,
81-
providerConfig: {
82-
static: {
83-
eth_sendTransaction: async (payload, next, end) => {
84-
const { TransactionController } = this.datamodel.context;
85-
try {
86-
const hash = await (await TransactionController.addTransaction(
87-
payload.params[0],
88-
payload.origin
89-
)).result;
90-
end(undefined, hash);
91-
} catch (error) {
92-
end(error);
93-
}
78+
new NetworkController({
79+
infuraProjectId: process.env.MM_INFURA_PROJECT_ID,
80+
providerConfig: {
81+
static: {
82+
eth_sendTransaction: async (payload, next, end) => {
83+
const { TransactionController } = this.datamodel.context;
84+
try {
85+
const hash = await (await TransactionController.addTransaction(
86+
payload.params[0],
87+
payload.origin
88+
)).result;
89+
end(undefined, hash);
90+
} catch (error) {
91+
end(error);
9492
}
95-
},
96-
getAccounts: (end, payload) => {
97-
const { approvedHosts, privacyMode } = store.getState();
98-
const isEnabled = !privacyMode || approvedHosts[payload.hostname];
99-
const { KeyringController } = this.datamodel.context;
100-
const isUnlocked = KeyringController.isUnlocked();
101-
const selectedAddress = this.datamodel.context.PreferencesController.state
102-
.selectedAddress;
103-
end(null, isUnlocked && isEnabled && selectedAddress ? [selectedAddress] : []);
10493
}
94+
},
95+
getAccounts: (end, payload) => {
96+
const { approvedHosts, privacyMode } = store.getState();
97+
const isEnabled = !privacyMode || approvedHosts[payload.hostname];
98+
const { KeyringController } = this.datamodel.context;
99+
const isUnlocked = KeyringController.isUnlocked();
100+
const selectedAddress = this.datamodel.context.PreferencesController.state
101+
.selectedAddress;
102+
end(null, isUnlocked && isEnabled && selectedAddress ? [selectedAddress] : []);
105103
}
106-
},
107-
{ network: '1', provider: { type: MAINNET } }
108-
),
104+
}
105+
}),
109106
new PhishingController(),
110107
new PreferencesController(
111108
{},

app/store/migrations.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { NetworksChainId } from '@metamask/controllers';
12
import AppConstants from '../core/AppConstants';
23
import { getAllNetworks, isSafeChainId } from '../util/networks';
34

@@ -47,7 +48,31 @@ export const migrations = {
4748
};
4849
}
4950
return state;
51+
},
52+
3: state => {
53+
const provider = state.engine.backgroundState.NetworkController.provider;
54+
const chainId = NetworksChainId[provider.type];
55+
// if chainId === '' is a rpc
56+
if (chainId) {
57+
state.engine.backgroundState.NetworkController.provider = { ...provider, chainId };
58+
return state;
59+
}
60+
61+
// If provider is rpc, check if the current network has a valid chainId
62+
const storedChainId = typeof provider.chainId === 'string' ? provider.chainId : '';
63+
const isDecimalString = /^[1-9]\d*$/u.test(storedChainId);
64+
const hasInvalidChainId = !isDecimalString || !isSafeChainId(parseInt(storedChainId, 10));
65+
66+
if (hasInvalidChainId) {
67+
// If the current network does not have a chainId, switch to testnet.
68+
state.engine.backgroundState.NetworkController.provider = {
69+
ticker: 'ETH',
70+
type: 'rinkeby',
71+
chainId: NetworksChainId.rinkeby
72+
};
73+
}
74+
return state;
5075
}
5176
};
5277

53-
export const version = 2;
78+
export const version = 3;

ios/MetaMask.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@
847847
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMaskDebug.entitlements;
848848
CODE_SIGN_IDENTITY = "iPhone Developer";
849849
CODE_SIGN_STYLE = Manual;
850-
CURRENT_PROJECT_VERSION = 564;
850+
CURRENT_PROJECT_VERSION = 569;
851851
DEAD_CODE_STRIPPING = NO;
852852
DEBUG_INFORMATION_FORMAT = dwarf;
853853
DEVELOPMENT_TEAM = 48XVW22RCG;
@@ -880,7 +880,7 @@
880880
"\"$(SRCROOT)/MetaMask/System/Library/Frameworks\"",
881881
);
882882
LLVM_LTO = YES;
883-
MARKETING_VERSION = 1.0.9;
883+
MARKETING_VERSION = 1.0.10;
884884
OTHER_CFLAGS = (
885885
"$(inherited)",
886886
"-DFB_SONARKIT_ENABLED=1",
@@ -910,7 +910,7 @@
910910
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements;
911911
CODE_SIGN_IDENTITY = "iPhone Distribution";
912912
CODE_SIGN_STYLE = Manual;
913-
CURRENT_PROJECT_VERSION = 564;
913+
CURRENT_PROJECT_VERSION = 569;
914914
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
915915
DEVELOPMENT_TEAM = 48XVW22RCG;
916916
FRAMEWORK_SEARCH_PATHS = (
@@ -942,7 +942,7 @@
942942
"\"$(SRCROOT)/MetaMask/System/Library/Frameworks\"",
943943
);
944944
LLVM_LTO = YES;
945-
MARKETING_VERSION = 1.0.9;
945+
MARKETING_VERSION = 1.0.10;
946946
OTHER_CFLAGS = (
947947
"$(inherited)",
948948
"-DFB_SONARKIT_ENABLED=1",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "metamask",
3-
"version": "1.0.9",
3+
"version": "1.0.10",
44
"private": true,
55
"scripts": {
66
"watch": "./scripts/build.sh watcher watch",

0 commit comments

Comments
 (0)