Skip to content

Commit

Permalink
Merge pull request #2572 from MetaMask/develop
Browse files Browse the repository at this point in the history
Release v2.2.0
  • Loading branch information
andrepimenta authored Apr 22, 2021
2 parents 95fe63b + 6cbea59 commit 0173fe2
Show file tree
Hide file tree
Showing 114 changed files with 2,433 additions and 719 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ workflows:
filters:
branches:
only:
- master
- main
- develop
- prep-node-deps:
filters:
branches:
ignore:
- master
- main
- develop
- lint:
requires:
Expand Down
35 changes: 34 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
# Changelog

## Current Develop Branch
## v2.2.0 - Apr 21 2021
- [#2547](https://github.com/MetaMask/metamask-mobile/pull/2547): Include decimalsToShow in balanceToFiatNumber
- [#2554](https://github.com/MetaMask/metamask-mobile/pull/2554): Bug fix/sync import time
- [#2546](https://github.com/MetaMask/metamask-mobile/pull/2546): Fix analytics try catch
- [#2543](https://github.com/MetaMask/metamask-mobile/pull/2543): Only get nonce from the network if the feature is enabled
- [#2460](https://github.com/MetaMask/metamask-mobile/pull/2460): Feature/tx local state logs
- [#2540](https://github.com/MetaMask/metamask-mobile/pull/2540): bump v2.1.2
- [#2538](https://github.com/MetaMask/metamask-mobile/pull/2538): fix/connection change handler
- [#2375](https://github.com/MetaMask/metamask-mobile/pull/2375): Style updates
- [#2536](https://github.com/MetaMask/metamask-mobile/pull/2536): Change Send Feedback to Request a Feature and update link
- [#2485](https://github.com/MetaMask/metamask-mobile/pull/2485): Fix notification so it doesn't block terms + conditions
- [#2469](https://github.com/MetaMask/metamask-mobile/pull/2469): Bug/persists old account names
- [#2534](https://github.com/MetaMask/metamask-mobile/pull/2534): Fix typo
- [#2373](https://github.com/MetaMask/metamask-mobile/pull/2373): use contract metadata version from package
- [#2520](https://github.com/MetaMask/metamask-mobile/pull/2520): Check infura availability
- [#2371](https://github.com/MetaMask/metamask-mobile/pull/2371): Feature/custom nonce
- [#2521](https://github.com/MetaMask/metamask-mobile/pull/2521): Bump v2.1.1
- [#2493](https://github.com/MetaMask/metamask-mobile/pull/2493): rename master to main
- [#2447](https://github.com/MetaMask/metamask-mobile/pull/2447): Bump vm-browserify from 0.0.4 to 1.1.2
- [#2501](https://github.com/MetaMask/metamask-mobile/pull/2501): Bump jest-serializer from 24.4.0 to 26.6.2
- [#2499](https://github.com/MetaMask/metamask-mobile/pull/2499): Bump react-native-share from 3.3.2 to 5.2.2
- [#2411](https://github.com/MetaMask/metamask-mobile/pull/2411): Bump json-rpc-middleware-stream from 2.1.1 to 3.0.0
- [#2406](https://github.com/MetaMask/metamask-mobile/pull/2406): Bump eslint-plugin-prettier from 3.3.0 to 3.3.1
- [#2403](https://github.com/MetaMask/metamask-mobile/pull/2403): Bump babel-eslint from 10.0.3 to 10.1.0
- [#2381](https://github.com/MetaMask/metamask-mobile/pull/2381): Display correct number of decimals for 'usd' fiat

## v2.1.3 - Apr 19 2021
- [#2548](https://github.com/MetaMask/metamask-mobile/pull/2548): Hotfix analytics try catch

## v2.1.2 - Apr 16 2021
- [#2538](https://github.com/MetaMask/metamask-mobile/pull/2538): fix/connection change handler

## v2.1.1 - Apr 14 2021
- [#2520](https://github.com/MetaMask/metamask-mobile/pull/2520): Check provider status

## v2.1.0 - Apr 12 2021
- [#2487](https://github.com/MetaMask/metamask-mobile/pull/2487): Fix/analytics v1 priority1
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.MD
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@

### Once you're done with both stores:
- Submit a PR with the changes
- Once it's merged create a tag on master for that version
- Once it's merged create a tag on main for that version
- Go to the release pages and create a new release for that tag, including the changelog

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 50
versionName "2.1.0"
versionCode 54
versionName "2.2.0"
multiDexEnabled true
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy "minReactNative", "minReactNative46"
Expand Down
13 changes: 13 additions & 0 deletions app/actions/infuraAvailability/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { INFURA_AVAILABILITY_BLOCKED, INFURA_AVAILABILITY_NOT_BLOCKED } from '../../reducers/infuraAvailability';

export function setInfuraAvailabilityBlocked() {
return {
type: INFURA_AVAILABILITY_BLOCKED
};
}

export function setInfuraAvailabilityNotBlocked() {
return {
type: INFURA_AVAILABILITY_NOT_BLOCKED
};
}
7 changes: 7 additions & 0 deletions app/actions/settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ export function setShowHexData(showHexData) {
};
}

export function setShowCustomNonce(showCustomNonce) {
return {
type: 'SET_SHOW_CUSTOM_NONCE',
showCustomNonce
};
}

export function setLockTime(lockTime) {
return {
type: 'SET_LOCK_TIME',
Expand Down
14 changes: 14 additions & 0 deletions app/actions/transaction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,17 @@ export function setCollectibleContractTransaction(collectible) {
collectible
};
}

export function setNonce(nonce) {
return {
type: 'SET_NONCE',
nonce
};
}

export function setProposedNonce(proposedNonce) {
return {
type: 'SET_PROPOSED_NONCE',
proposedNonce
};
}
20 changes: 20 additions & 0 deletions app/components/Base/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ const style = StyleSheet.create({
textAlign: 'right'
},
bold: fontStyles.bold,
black: {
color: colors.black
},
blue: {
color: colors.blue
},
green: {
color: colors.green400
},
Expand Down Expand Up @@ -58,6 +64,8 @@ const Text = ({
right,
bold,
green,
black,
blue,
primary,
small,
upper,
Expand All @@ -77,6 +85,8 @@ const Text = ({
right && style.right,
bold && style.bold,
green && style.green,
black && style.black,
blue && style.blue,
primary && style.primary,
disclaimer && [style.small, style.disclaimer],
small && style.small,
Expand All @@ -98,6 +108,8 @@ Text.defaultProps = {
right: false,
bold: false,
green: false,
black: false,
blue: false,
primary: false,
disclaimer: false,
modal: false,
Expand Down Expand Up @@ -130,6 +142,14 @@ Text.propTypes = {
* Makes text green
*/
green: PropTypes.bool,
/**
* Makes text black
*/
black: PropTypes.bool,
/**
* Makes text blue
*/
blue: PropTypes.bool,
/**
* Makes text fontPrimary color
*/
Expand Down
60 changes: 51 additions & 9 deletions app/components/Nav/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import SwapsLiveness from '../../UI/Swaps/SwapsLiveness';
import Analytics from '../../../core/Analytics';
import { ANALYTICS_EVENT_OPTS } from '../../../util/analytics';
import BigNumber from 'bignumber.js';
import { setInfuraAvailabilityBlocked, setInfuraAvailabilityNotBlocked } from '../../../actions/infuraAvailability';

const styles = StyleSheet.create({
flex: {
Expand All @@ -79,9 +80,8 @@ const styles = StyleSheet.create({
margin: 0
}
});

const Main = props => {
const [connected, setConnected] = useState(false);
const [connected, setConnected] = useState(true);
const [forceReload, setForceReload] = useState(false);
const [signMessage, setSignMessage] = useState(false);
const [signMessageParams, setSignMessageParams] = useState({ data: '' });
Expand Down Expand Up @@ -137,15 +137,42 @@ const Main = props => {

const connectionChangeHandler = useCallback(
state => {
if (!state) return;
const { isConnected } = state;
// Show the modal once the status changes to offline
if (connected && !state.isConnected) {
if (connected && isConnected === false) {
props.navigation.navigate('OfflineModeView');
}
setConnected(state.isConnected);
if (connected !== isConnected && isConnected !== null) {
setConnected(isConnected);
}
},
[connected, props.navigation]
[connected, setConnected, props.navigation]
);

const checkInfuraAvailability = useCallback(async () => {
if (props.providerType !== 'rpc') {
try {
const { TransactionController } = Engine.context;
await util.query(TransactionController.ethQuery, 'blockNumber', []);
props.setInfuraAvailabilityNotBlocked();
} catch (e) {
if (e.message === AppConstants.ERRORS.INFURA_BLOCKED_MESSAGE) {
props.navigation.navigate('OfflineModeView');
props.setInfuraAvailabilityBlocked();
}
}
} else {
props.setInfuraAvailabilityNotBlocked();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
props.navigation,
props.providerType,
props.setInfuraAvailabilityBlocked,
props.setInfuraAvailabilityNotBlocked
]);

const initializeWalletConnect = () => {
WalletConnect.hub.on('walletconnectSessionRequest', peerInfo => {
setWalletConnectRequest(true);
Expand Down Expand Up @@ -592,7 +619,7 @@ const Main = props => {
removeNotificationById: props.removeNotificationById
});
pollForIncomingTransactions();

checkInfuraAvailability();
removeConnectionStatusListener.current = NetInfo.addEventListener(connectionChangeHandler);
}, 1000);

Expand Down Expand Up @@ -709,7 +736,19 @@ Main.propTypes = {
/**
* Selected address
*/
selectedAddress: PropTypes.string
selectedAddress: PropTypes.string,
/**
* Network provider type
*/
providerType: PropTypes.string,
/**
* Dispatch infura availability blocked
*/
setInfuraAvailabilityBlocked: PropTypes.func,
/**
* Dispatch infura availability not blocked
*/
setInfuraAvailabilityNotBlocked: PropTypes.func
};

const mapStateToProps = state => ({
Expand All @@ -720,7 +759,8 @@ const mapStateToProps = state => ({
isPaymentRequest: state.transaction.paymentRequest,
dappTransactionModalVisible: state.modals.dappTransactionModalVisible,
approveModalVisible: state.modals.approveModalVisible,
swapsTransactions: state.engine.backgroundState.TransactionController.swapsTransactions || {}
swapsTransactions: state.engine.backgroundState.TransactionController.swapsTransactions || {},
providerType: state.engine.backgroundState.NetworkController.provider.type
});

const mapDispatchToProps = dispatch => ({
Expand All @@ -731,7 +771,9 @@ const mapDispatchToProps = dispatch => ({
hideCurrentNotification: () => dispatch(hideCurrentNotification()),
removeNotificationById: id => dispatch(removeNotificationById(id)),
toggleDappTransactionModal: (show = null) => dispatch(toggleDappTransactionModal(show)),
toggleApproveModal: show => dispatch(toggleApproveModal(show))
toggleApproveModal: show => dispatch(toggleApproveModal(show)),
setInfuraAvailabilityBlocked: () => dispatch(setInfuraAvailabilityBlocked()),
setInfuraAvailabilityNotBlocked: () => dispatch(setInfuraAvailabilityNotBlocked())
});

export default connect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ exports[`AccountInfoCard should render correctly 1`] = `
numberOfLines={1}
style={
Object {
"color": "#000000",
"color": "#24292E",
"fontFamily": "EuclidCircularB-Bold",
"fontSize": 16,
"fontWeight": "600",
Expand All @@ -60,7 +60,7 @@ exports[`AccountInfoCard should render correctly 1`] = `
numberOfLines={1}
style={
Object {
"color": "#000000",
"color": "#24292E",
"flexGrow": 1,
"fontFamily": "EuclidCircularB-Bold",
"fontSize": 16,
Expand All @@ -78,7 +78,7 @@ exports[`AccountInfoCard should render correctly 1`] = `
style={
Object {
"alignSelf": "flex-start",
"color": "#000000",
"color": "#24292E",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "100",
Expand Down
Loading

0 comments on commit 0173fe2

Please sign in to comment.