Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.12.1 #7997

Merged
merged 16 commits into from
Dec 5, 2023
Merged

7.12.1 #7997

Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
config: 'e2e/jest.e2e.config.js',
},
jest: {
setupTimeout: 120000,
setupTimeout: 220000,
},
retries: 2,
},
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.3
3.0.0
165 changes: 165 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ android {
applicationId "io.metamask"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1197
versionName "7.11.0"
versionCode 1221
versionName "7.12.1"
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy 'react-native-camera', 'general'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/Tokens/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ const Tokens: React.FC<TokensI> = ({ tokens }) => {
TokenDetectionController.detectTokens(),
AccountTrackerController.refresh(),
CurrencyRateController.start(),
TokenRatesController.poll(),
TokenRatesController.updateExchangeRates(),
];
await Promise.all(actions);
setRefreshing(false);
Expand Down
89 changes: 56 additions & 33 deletions app/components/UI/WhatsNewModal/whatsNewList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,67 @@ import { WhatsNew } from './types';
export const whatsNew: WhatsNew = {
// All users that have <6.4.0 and are updating to >=6.4.0 should see
onlyUpdates: false, // false: Users who updated the app and new installs will see this. true: only users who update will see it
maxLastAppVersion: '7.3.0', // Only users who had a previous version <7.3.0 version will see this
minAppVersion: '7.3.0', // Only users who updated to a version >= 7.3.0 will see this
maxLastAppVersion: '7.12.0', // Only users who had a previous version <7.12.0 version will see this
minAppVersion: '7.12.0', // Only users who updated to a version >= 7.3.0 will see this
/**
* Slides utilizes a templating system in the form of a 2D array, which is eventually rendered within app/components/UI/WhatsNewModal/index.js.
* The root layer determines the number of slides. Ex. To display 3 slides, the root layer should contain 3 arrays.
* The inner layer determines the content that will be rendered within each slide.
* The slide content takes the form of union types, where the possible types are `image`, `title`, `description`, or `button`.
* Both slide count and slide content will be rendered in the same order as the data set.
*/
slides: isBlockaidFeatureEnabled()
? [
[
{
type: 'title',
title: strings('whats_new.blockaid.title'),
},
{
type: 'image',
image: require('../../../images/whats_new_blockaid.png'),
},
{
type: 'description',
description: strings('whats_new.blockaid.description_1'),
},
{
type: 'description',
description: strings('whats_new.blockaid.description_2'),
},
{
type: 'button',
buttonText: strings('whats_new.blockaid.action_text'),
buttonType: 'blue',
onPress: (props) =>
props.navigation.navigate(Routes.SETTINGS_VIEW, {
screen: Routes.SETTINGS.EXPERIMENTAL_SETTINGS,
}),
},
],
]
: [],
slides: [
[
{
type: 'image',
image: require('../../../images/whats_new_sell.png'),
},
{
type: 'title',
title: strings('whats_new.sell.title'),
},
{
type: 'description',
description: strings('whats_new.sell.description'),
},
// button to try it out
{
type: 'button',
buttonText: strings('whats_new.sell.action_text'),
buttonType: 'blue',
onPress: (props) => props.navigation.navigate(Routes.RAMP.SELL),
},
],
...(isBlockaidFeatureEnabled()
? ([
[
{
type: 'title',
title: strings('whats_new.blockaid.title'),
},
{
type: 'image',
image: require('../../../images/whats_new_blockaid.png'),
},
{
type: 'description',
description: strings('whats_new.blockaid.description_1'),
},
{
type: 'description',
description: strings('whats_new.blockaid.description_2'),
},
{
type: 'button',
buttonText: strings('whats_new.blockaid.action_text'),
buttonType: 'blue',
onPress: (props) =>
props.navigation.navigate(Routes.SETTINGS_VIEW, {
screen: Routes.SETTINGS.EXPERIMENTAL_SETTINGS,
}),
},
],
] as WhatsNew['slides'])
: []),
],
};
15 changes: 1 addition & 14 deletions app/components/Views/BrowserTab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { withNavigation } from '@react-navigation/compat';
import { WebView } from 'react-native-webview';
import Icon from 'react-native-vector-icons/FontAwesome';
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons';
import { useIsFocused } from '@react-navigation/native';
import BrowserBottomBar from '../../UI/BrowserBottomBar';
import PropTypes from 'prop-types';
import Share from 'react-native-share';
Expand Down Expand Up @@ -254,8 +253,6 @@ const sessionENSNames = {};
const ensIgnoreList = [];

export const BrowserTab = (props) => {
const isFocused = useIsFocused();
const [key, setKey] = useState(1);
const [backEnabled, setBackEnabled] = useState(false);
const [forwardEnabled, setForwardEnabled] = useState(false);
const [progress, setProgress] = useState(0);
Expand Down Expand Up @@ -1433,15 +1430,6 @@ export const BrowserTab = (props) => {
[reload],
);

/**
* According to Apple docs, it is not possible to update properties such as `javascriptEnabled` dynamically
* - https://developer.apple.com/documentation/webkit/wkwebviewconfiguration.
* By updating the key prop, we are forcing iOS WebView to reinitialize with the new `javascriptEnabled` value.
*/
useEffect(() => {
if (Platform.OS === 'ios') setKey((prevKey) => prevKey + 1);
}, [isFocused]);

const renderIpfsBanner = () => (
<View style={styles.bannerContainer}>
<Banner
Expand Down Expand Up @@ -1490,7 +1478,6 @@ export const BrowserTab = (props) => {
{!!entryScriptWeb3 && firstUrlLoaded && (
<>
<WebView
key={key}
originWhitelist={['*']}
decelerationRate={'normal'}
ref={webviewRef}
Expand All @@ -1508,12 +1495,12 @@ export const BrowserTab = (props) => {
onError={onError}
onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}
sendCookies
javascriptEnabled
allowsInlineMediaPlayback
useWebkit
testID={BrowserViewSelectorsIDs.ANDROID_CONTAINER}
applicationNameForUserAgent={'WebView MetaMaskMobile'}
onFileDownload={handleOnFileDownload}
javaScriptEnabled={isFocused}
/>
{ipfsBannerVisible && renderIpfsBanner()}
</>
Expand Down
5 changes: 0 additions & 5 deletions app/components/Views/Wallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,6 @@ const Wallet = ({ navigation }: any) => {
}, [navigate, providerConfig.chainId]);
const { colors: themeColors } = useTheme();

useEffect(() => {
const { TokenRatesController } = Engine.context;
TokenRatesController.poll();
}, [tokens]);

/**
* Check to see if we need to show What's New modal
*/
Expand Down
35 changes: 16 additions & 19 deletions app/core/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,25 +531,20 @@ class Engine {
},
{ interval: 10000 },
),
new TokenRatesController(
{
onTokensStateChange: (listener) =>
tokensController.subscribe(listener),
onCurrencyRateStateChange: (listener) =>
this.controllerMessenger.subscribe(
`${currencyRateController.name}:stateChange`,
listener,
),
onNetworkStateChange: (listener) =>
this.controllerMessenger.subscribe(
AppConstants.NETWORK_STATE_CHANGE_EVENT,
listener,
),
},
{
chainId: networkController.state.providerConfig.chainId,
},
),
new TokenRatesController({
onTokensStateChange: (listener) => tokensController.subscribe(listener),
onNetworkStateChange: (listener) =>
this.controllerMessenger.subscribe(
AppConstants.NETWORK_STATE_CHANGE_EVENT,
listener,
),
onPreferencesStateChange: (listener) =>
preferencesController.subscribe(listener),
chainId: networkController.state.providerConfig.chainId,
ticker: networkController.state.providerConfig.ticker ?? 'ETH',
selectedAddress: preferencesController.state.selectedAddress,
coinGeckoHeader: process.env.COIN_GECKO_HEADER as string,
}),
new TransactionController({
blockTracker:
networkController.getProviderAndBlockTracker().blockTracker,
Expand Down Expand Up @@ -790,12 +785,14 @@ class Engine {
TokenDetectionController,
TokenListController,
TransactionController,
TokenRatesController,
} = this.context;

TokenListController.start();
NftDetectionController.start();
TokenDetectionController.start();
TransactionController.startIncomingTransactionPolling();
TokenRatesController.start();
}

configureControllersOnNetworkChange() {
Expand Down
Binary file added app/images/whats_new_sell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/whats_new_sell@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/whats_new_sell@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app/util/address/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ export function isQRHardwareAccount(address) {
* get address's kerying
*
* @param {String} address - String corresponding to an address
* @returns {Keyring} - Returns address's account keyriong
* @returns {Keyring | undefined} - Returns the keyring of the provided address if keyring found, otherwise returns undefined
*/
export function getKeyringByAddress(address) {
if (!isValidHexAddress(address)) {
throw new Error(`Invalid address: ${address}`);
return undefined;
}
const { KeyringController } = Engine.context;
const { keyrings } = KeyringController.state;
Expand Down
9 changes: 5 additions & 4 deletions app/util/address/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,11 @@ describe('isQRHardwareAccount', () => {
});
});
describe('getKeyringByAddress', () => {
it('should throw an error if argument address is undefined', () => {
expect(() => getKeyringByAddress(undefined as any)).toThrow(
'Invalid address: undefined',
);
it('should return undefined if argument address is undefined', () => {
expect(getKeyringByAddress(undefined as any)).toBeUndefined();
});
it('should return undefined if argument address is not hex address', () => {
expect(getKeyringByAddress('ens.eth')).toBeUndefined();
});
it('should return address if found', () => {
expect(
Expand Down
4 changes: 2 additions & 2 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -850,10 +850,10 @@ app:
PROJECT_LOCATION_IOS: ios
- opts:
is_expand: false
VERSION_NAME: 7.11.0
VERSION_NAME: 7.12.1
- opts:
is_expand: false
VERSION_NUMBER: 1197
VERSION_NUMBER: 1221
- opts:
is_expand: false
ANDROID_APK_LINK: ''
Expand Down
6 changes: 3 additions & 3 deletions e2e/specs/wallet/wallet-tests.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ describe(Smoke('Wallet Tests'), () => {
await ImportTokensView.tapImportButton();
await WalletView.isVisible();
await TestHelpers.delay(8000); // to prevent flakey behavior in bitrise
await WalletView.isTokenVisibleInWallet('0 XRP20');
await WalletView.isTokenVisibleInWallet('0 XRP');
});

it('should hide token from Wallet view', async () => {
await WalletView.removeTokenFromWallet('0 XRP20');
await WalletView.removeTokenFromWallet('0 XRP');
await TestHelpers.delay(1500);
await WalletView.tokenIsNotVisibleInWallet('0 XRP20');
await WalletView.tokenIsNotVisibleInWallet('XRP');
});
});
7 changes: 7 additions & 0 deletions e2e/viewHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,11 @@ export const loginToApp = async () => {
await LoginView.enterPassword(PASSWORD);

await WalletView.isVisible();
await TestHelpers.delay(2500);
try {
await WhatsNewModal.isVisible();
await WhatsNewModal.tapCloseButton();
} catch {
//
}
};
16 changes: 8 additions & 8 deletions ios/MetaMask.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMaskDebug.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1197;
CURRENT_PROJECT_VERSION = 1221;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 48XVW22RCG;
Expand Down Expand Up @@ -1073,7 +1073,7 @@
);
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift$(inherited)";
LLVM_LTO = YES;
MARKETING_VERSION = 7.11.0;
MARKETING_VERSION = 7.12.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
Expand Down Expand Up @@ -1102,7 +1102,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1197;
CURRENT_PROJECT_VERSION = 1221;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 48XVW22RCG;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG;
Expand Down Expand Up @@ -1136,7 +1136,7 @@
);
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift$(inherited)";
LLVM_LTO = YES;
MARKETING_VERSION = 7.11.0;
MARKETING_VERSION = 7.12.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
Expand Down Expand Up @@ -1256,7 +1256,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1197;
CURRENT_PROJECT_VERSION = 1221;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 48XVW22RCG;
Expand Down Expand Up @@ -1294,7 +1294,7 @@
"\"$(SRCROOT)/MetaMask/System/Library/Frameworks\"",
);
LLVM_LTO = YES;
MARKETING_VERSION = 7.11.0;
MARKETING_VERSION = 7.12.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -1326,7 +1326,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1197;
CURRENT_PROJECT_VERSION = 1221;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 48XVW22RCG;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG;
Expand Down Expand Up @@ -1364,7 +1364,7 @@
"\"$(SRCROOT)/MetaMask/System/Library/Frameworks\"",
);
LLVM_LTO = YES;
MARKETING_VERSION = 7.11.0;
MARKETING_VERSION = 7.12.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = (
"$(inherited)",
Expand Down
Loading
Loading