mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-19 05:45:15 +01:00
ADD: performance measure button on settings/about screen
This commit is contained in:
parent
cd0b6c4812
commit
6223ede46c
@ -211,6 +211,8 @@
|
||||
"about_license": "MIT License",
|
||||
"about_release_notes": "Release notes",
|
||||
"about_review": "Leave us a review",
|
||||
"performance_score": "Performance score: {num}",
|
||||
"run_performance_test": "Test performance",
|
||||
"about_selftest": "Run self-test",
|
||||
"about_selftest_electrum_disabled": "Self-testing is not available with Electrum Offline Mode. Please disable offline mode and try again.",
|
||||
"about_selftest_ok": "All internal tests have passed successfully. The wallet works well.",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { useContext } from 'react';
|
||||
import { TouchableOpacity, ScrollView, Linking, Image, View, Text, StyleSheet, useWindowDimensions, Platform } from 'react-native';
|
||||
import { TouchableOpacity, ScrollView, Linking, Image, View, Text, StyleSheet, useWindowDimensions, Platform, Alert } from 'react-native';
|
||||
import { useNavigation, useTheme } from '@react-navigation/native';
|
||||
import { Icon } from 'react-native-elements';
|
||||
import { getApplicationName, getVersion, getBundleId, getBuildNumber, getUniqueId, hasGmsSync } from 'react-native-device-info';
|
||||
@ -10,6 +10,7 @@ import loc, { formatStringAddTwoWhiteSpaces } from '../../loc';
|
||||
import Clipboard from '@react-native-clipboard/clipboard';
|
||||
import { BlueStorageContext } from '../../blue_modules/storage-context';
|
||||
import alert from '../../components/Alert';
|
||||
import { HDSegwitBech32Wallet } from '../../class';
|
||||
|
||||
const A = require('../../blue_modules/analytics');
|
||||
const branch = require('../../current-branch.json');
|
||||
@ -208,6 +209,31 @@ const About = () => {
|
||||
testID="RunSelfTestButton"
|
||||
title={loc.settings.about_selftest}
|
||||
/>
|
||||
<BlueListItem
|
||||
leftIcon={{
|
||||
name: 'flask',
|
||||
type: 'font-awesome',
|
||||
color: '#FC0D44',
|
||||
}}
|
||||
chevron
|
||||
onPress={async () => {
|
||||
const secret = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about';
|
||||
const w = new HDSegwitBech32Wallet();
|
||||
w.setSecret(secret);
|
||||
|
||||
const start = Date.now();
|
||||
let num;
|
||||
for (num = 0; num < 1000; num++) {
|
||||
w._getExternalAddressByIndex(num);
|
||||
if (Date.now() - start > 10 * 1000) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Alert.alert(loc.formatString(loc.settings.performance_score, { num }));
|
||||
}}
|
||||
title={loc.settings.run_performance_test}
|
||||
/>
|
||||
<BlueSpacing20 />
|
||||
<BlueSpacing20 />
|
||||
<BlueTextCentered>
|
||||
|
Loading…
Reference in New Issue
Block a user