Skip to content

Commit

Permalink
Merge branch 'develop' into feature/swaps-amount-view-use-max
Browse files Browse the repository at this point in the history
  • Loading branch information
wachunei authored Dec 9, 2020
2 parents 3193649 + 326df28 commit ccf66b6
Show file tree
Hide file tree
Showing 48 changed files with 215 additions and 146 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,17 @@ jobs:
working_directory: ~/MetaMask
environment:
JAVA_OPTS: "-Xms512m -Xmx1024m"
_JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
_JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport"
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
docker:
- image: circleci/android:api-28-node8-alpha
- image: circleci/android:api-29-node
steps:
- checkout
- attach_workspace:
at: .
- run:
name: build:accept-android-licenses
command: (echo y; echo y; echo y; echo y; echo y; echo y) | $ANDROID_HOME/tools/bin/sdkmanager --licenses
command: sdkmanager --licenses
- run:
name: build:pre-release
command:
Expand Down
22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,26 @@

## Current Develop Branch

## v1.0.6 - Nov 12 2020]
- [#1990](https://github.com/MetaMask/metamask-mobile/pull/1990): Fixed importing accounts when reseting password (#1988)
## v1.0.8 - Dec 2 2020
- [#2040](https://github.com/MetaMask/metamask-mobile/pull/2040): Update vault error message (#2040)
- [#2034](https://github.com/MetaMask/metamask-mobile/pull/2034): Fix asyncstorage limit (#2034)
- [#2038](https://github.com/MetaMask/metamask-mobile/pull/2038): metamask wc deeplink (#2038)
- [#2023](https://github.com/MetaMask/metamask-mobile/pull/2023): @metamask/contract-metadata (#2023)
- [#2019](https://github.com/MetaMask/metamask-mobile/pull/2019): bugfix/qr code (#2019)
- [#2008](https://github.com/MetaMask/metamask-mobile/pull/2008): Add Apple Pay correct label (#2008)

## v1.0.7 - Nov 17 2020
- [#2005](https://github.com/MetaMask/metamask-mobile/pull/2005): Fix activeTabUrl (#2005)
- [#2003](https://github.com/MetaMask/metamask-mobile/pull/2003): Bugfix/android choose password (#2003)
- [#1992](https://github.com/MetaMask/metamask-mobile/pull/1992): Android api level (#1992)
- [#1993](https://github.com/MetaMask/metamask-mobile/pull/1993): Catch SVG Errors (#1993)
- [#1970](https://github.com/MetaMask/metamask-mobile/pull/1970): Remove network status controller (#1970)
- [#1968](https://github.com/MetaMask/metamask-mobile/pull/1968): Add MetaSwaps feature flag and initial nav stack (#1968)
- [#1967](https://github.com/MetaMask/metamask-mobile/pull/1967): Add Keypad component (#1967)


## v1.0.6 - Nov 12 2020
- [#1990](https://github.com/MetaMask/metamask-mobile/pull/1990): Fixed importing accounts when reseting password (#1990)
- [#1988](https://github.com/MetaMask/metamask-mobile/pull/1988): bugfix/protect wallet modal (#1988)
- [#1985](https://github.com/MetaMask/metamask-mobile/pull/1985): Fix seedphrase handling in QRScanner (#1985)
- [#1982](https://github.com/MetaMask/metamask-mobile/pull/1982): Bugfix/approve modal (#1982)
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ android {
applicationId "io.metamask"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 40
versionName "1.0.6"
versionCode 41
versionName "1.0.8"
multiDexEnabled true
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy "minReactNative", "minReactNative46"
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:theme="@style/AppTheme"
android:hardwareAccelerated="true"
android:usesCleartextTraffic="${isDebug}"
tools:targetApi="28"
tools:targetApi="29"
tools:ignore="GoogleAppIndexingWarning"
android:networkSecurityConfig="@xml/react_native_config"
>
Expand Down
11 changes: 11 additions & 0 deletions android/app/src/main/java/io/metamask/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

import androidx.multidex.MultiDexApplication;

import android.database.CursorWindow;
import java.lang.reflect.Field;

public class MainApplication extends MultiDexApplication implements ShareApplication, ReactApplication {

Expand Down Expand Up @@ -55,6 +57,15 @@ public ReactNativeHost getReactNativeHost() {
@Override
public void onCreate() {
super.onCreate();

try {
Field field = CursorWindow.class.getDeclaredField("sCursorWindowSize");
field.setAccessible(true);
field.set(null, 10 * 1024 * 1024); //the 10MB is the new size
} catch (Exception e) {
e.printStackTrace();
}

if (BuildConfig.DEBUG)
{ WebView.setWebContentsDebuggingEnabled(true); }
SoLoader.init(this, /* native exopackage */ false);
Expand Down
4 changes: 1 addition & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
buildscript {

ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 19
compileSdkVersion = 29
targetSdkVersion = 28
targetSdkVersion = 29
kotlin_version = "1.3.50"
kotlinVersion = "$kotlin_version"
}
Expand Down Expand Up @@ -56,7 +55,6 @@ allprojects {
if (project.hasProperty("android")) {
android {
compileSdkVersion = rootProject.ext.compileSdkVersion
buildToolsVersion = rootProject.ext.buildToolsVersion
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
28 changes: 16 additions & 12 deletions app/components/Base/RemoteImage/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`RemoteImage should render correctly 1`] = `
<View
style={Object {}}
<ComponentErrorBoundary
componentLabel="RemoteImage-SVG"
>
<SvgCssUri
height="100%"
source={
Object {
"uri": "https://raw.githubusercontent.com/MetaMask/eth-contract-metadata/master/images/dai.svg",
<View
style={Object {}}
>
<SvgCssUri
height="100%"
source={
Object {
"uri": "https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/dai.svg",
}
}
}
uri="https://raw.githubusercontent.com/MetaMask/eth-contract-metadata/master/images/dai.svg"
width="100%"
/>
</View>
uri="https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/dai.svg"
width="100%"
/>
</View>
</ComponentErrorBoundary>
`;
15 changes: 11 additions & 4 deletions app/components/Base/RemoteImage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import FadeIn from 'react-native-fade-in-image';
// eslint-disable-next-line import/default
import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';
import { SvgCssUri } from 'react-native-svg';
import ComponentErrorBoundary from '../../UI/ComponentErrorBoundary';

const RemoteImage = props => {
const source = resolveAssetSource(props.source);
Expand All @@ -19,9 +20,11 @@ const RemoteImage = props => {
}
}
return (
<View style={style}>
<SvgCssUri {...props} uri={source.uri} width={'100%'} height={'100%'} />
</View>
<ComponentErrorBoundary onError={props.onError} componentLabel="RemoteImage-SVG">
<View style={style}>
<SvgCssUri {...props} uri={source.uri} width={'100%'} height={'100%'} />
</View>
</ComponentErrorBoundary>
);
}

Expand Down Expand Up @@ -51,7 +54,11 @@ RemoteImage.propTypes = {
/**
* Style for the placeholder (used for fadeIn)
*/
placeholderStyle: ViewPropTypes.style
placeholderStyle: ViewPropTypes.style,
/**
* Called when there is an error
*/
onError: PropTypes.func
};

export default RemoteImage;
2 changes: 1 addition & 1 deletion app/components/Base/RemoteImage/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('RemoteImage', () => {
const wrapper = shallow(
<RemoteImage
source={{
uri: `https://raw.githubusercontent.com/MetaMask/eth-contract-metadata/master/images/dai.svg`
uri: `https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/dai.svg`
}}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion app/components/Nav/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import {
import { BN, isValidAddress } from 'ethereumjs-util';
import { isENS, safeToChecksumAddress } from '../../../util/address';
import Logger from '../../../util/Logger';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import MessageSign from '../../UI/MessageSign';
import Approve from '../../Views/ApproveView/Approve';
import TransactionTypes from '../../../core/TransactionTypes';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`ApproveTransactionModal should render correctly 1`] = `
}
}
accountsLength={1}
activeTabUrl=""
activeTabUrl="https://metamask.github.io/test-dapp/"
conversionRate={5}
primaryCurrency="fiat"
providerType="ETH"
Expand Down
13 changes: 10 additions & 3 deletions app/components/UI/ApproveTransactionReview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getApproveNavbar } from '../../UI/Navbar';
import { colors, fontStyles, baseStyles } from '../../../styles/common';
import { connect } from 'react-redux';
import { getHost } from '../../../util/browser';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import { safeToChecksumAddress, renderShortAddress } from '../../../util/address';
import Engine from '../../../core/Engine';
import { strings } from '../../../../locales/i18n';
Expand Down Expand Up @@ -257,7 +257,14 @@ class ApproveTransactionReview extends PureComponent {
* Error coming from gas component
*/
gasError: PropTypes.string,
primaryCurrency: PropTypes.string
/**
* Primary currency, either ETH or Fiat
*/
primaryCurrency: PropTypes.string,
/**
* Active tab URL, the currently active tab url
*/
activeTabUrl: PropTypes.string
};

state = {
Expand Down Expand Up @@ -534,7 +541,6 @@ class ApproveTransactionReview extends PureComponent {

render = () => {
const {
activeTabUrl,
host,
tokenSymbol,
viewDetails,
Expand All @@ -549,6 +555,7 @@ class ApproveTransactionReview extends PureComponent {
primaryCurrency,
currentCurrency,
gasError,
activeTabUrl,
transaction: { origin }
} = this.props;

Expand Down
4 changes: 4 additions & 0 deletions app/components/UI/ApproveTransactionReview/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ describe('ApproveTransactionModal', () => {
transaction: {},
settings: {
primaryCurrency: 'fiat'
},
browser: {
activeTab: 1605778647042,
tabs: [{ id: 1605778647042, url: 'https://metamask.github.io/test-dapp/' }]
}
};
const wrapper = shallow(<ApproveTransactionModal />, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`AssetIcon should render correctly 1`] = `
}
source={
Object {
"uri": "https://raw.githubusercontent.com/metamask/eth-contract-metadata/v1.16.0/images/metamark.svg",
"uri": "https://raw.githubusercontent.com/metamask/contract-metadata/v1.19.0/images/metamark.svg",
}
}
style={
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/AssetIcon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ AssetIcon.propTypes = {
*/
logo: PropTypes.string,
/**
* Whether logo has to be fetched from eth-contract-metadata
* Whether logo has to be fetched from @metamask/contract-metadata
*/
watchedAsset: PropTypes.bool,
/**
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/AssetSearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { TextInput, View, StyleSheet } from 'react-native';
import { colors, fontStyles } from '../../../styles/common';
import PropTypes from 'prop-types';
import { strings } from '../../../../locales/i18n';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import Fuse from 'fuse.js';
import Icon from 'react-native-vector-icons/FontAwesome';

Expand Down
41 changes: 41 additions & 0 deletions app/components/UI/ComponentErrorBoundary/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react';
import PropTypes from 'prop-types';
import Logger from '../../../util/Logger';

class ComponentErrorBoundary extends React.Component {
state = { error: null };

static propTypes = {
/**
* Component to be used when there is no error
*/
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
/**
* Component label for logging
*/
componentLabel: PropTypes.string.isRequired,
/**
* Function to be called when there is an error
*/
onError: PropTypes.func
};

static getDerivedStateFromError(error) {
return { error };
}

componentDidCatch(error, errorInfo) {
// eslint-disable-next-line no-unused-expressions
this.props.onError?.();

Logger.error(error, { View: this.props.componentLabel, ...errorInfo });
}

getErrorMessage = () => `Component: ${this.props.componentLabel}\n${this.state.error.toString()}`;

render() {
return this.state.error ? null : this.props.children;
}
}

export default ComponentErrorBoundary;
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ const getPaymentDetails = (cryptoCurrency, amount, fee, total) => ({
],
total: {
amount: { currency: USD_CURRENCY_CODE, value: `${total}` },
label: 'Wyre'
label: strings('fiat_on_ramp.wyre_total_label')
}
});

Expand Down
16 changes: 0 additions & 16 deletions app/components/UI/NetworkList/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,6 @@ exports[`NetworkList should render correctly 1`] = `
</Text>
</View>
</View>
<View>
<Text
style={
Object {
"color": "#777777",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 12,
"fontWeight": "400",
"marginLeft": 30,
"marginTop": 5,
}
}
>
All Systems Operational
</Text>
</View>
</TouchableOpacity>
</View>
<View
Expand Down
Loading

0 comments on commit ccf66b6

Please sign in to comment.