Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop' into desktop-test-coverage
Browse files Browse the repository at this point in the history
* develop: (155 commits)
  Bump electron from 3.1.6 to 3.1.8 in /src/desktop (#1294)
  Bump react-transition-group from 2.7.1 to 2.9.0 in /src/desktop (#1273)
  Bump css-loader from 2.1.0 to 2.1.1 in /src/desktop (#1262)
  Bump electron-builder from 20.38.5 to 20.39.0 in /src/desktop (#1261)
  Bump @ledgerhq/hw-transport-node-hid in /src/desktop (#1290)
  Bump snyk from 1.149.0 to 1.150.0 (#1289)
  Bump fastlane from 2.119.0 to 2.120.0 in /src/mobile/ios (#1288)
  Bump fastlane from 2.119.0 to 2.120.0 in /src/mobile/android (#1287)
  Bump snyk from 1.148.0 to 1.149.0 (#1286)
  Shared: Add node request timeouts for getTransactionsToApprove endpoint (#1284)
  Mobile: Wait for SeedStore constructor promise to resolve before making a retry attempt (#1283)
  Bump snyk from 1.147.4 to 1.148.0 (#1279)
  Mobile: Minor changes to seed text input (#1244)
  New Crowdin translations (#1252)
  Mobile: Reenable and refactor deep linking (#1143)
  Only convert transactions to normalised transactions if notification function is defined (#1276)
  feat: add realm migration from v1 to v2 (#1274)
  Mobile: Fix AsyncStorage migration (#1272)
  Bump webpack-dev-middleware from 3.6.0 to 3.6.2 in /src/desktop (#1264)
  Bump snyk from 1.147.3 to 1.147.4 (#1270)
  ...

# Conflicts:
#	package.json
#	src/desktop/native/Entangled.js
#	src/desktop/package.json
#	src/desktop/src/index.js
#	src/desktop/src/libs/crypto.js
#	src/desktop/src/ui/components/Balance.js
#	src/desktop/src/ui/components/List.js
#	src/desktop/src/ui/global/Theme.js
#	src/desktop/src/ui/views/settings/account/Addresses.js
#	src/desktop/src/ui/views/wallet/Sidebar.js
#	src/shared/libs/currency.js
  • Loading branch information
rihardsgravis committed Apr 12, 2019
2 parents 08dd692 + 99925bf commit 3ac6d01
Show file tree
Hide file tree
Showing 422 changed files with 28,524 additions and 18,786 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ rules:
no-throw-literal: 2
no-unmodified-loop-condition: 2
no-unused-expressions: [2, { "allowShortCircuit": true, "allowTernary": true }]
no-unused-vars: ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": true, "argsIgnorePattern": "^_" }]
no-useless-call: 2
no-useless-concat: 2
no-var: 2
Expand Down
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ local.properties
*.iml
index.android.bundle

# Eclipse project files
.classpath
.project
.metadata
.settings

# node.js
#
node_modules/
Expand Down Expand Up @@ -115,5 +121,11 @@ src/mobile/nodejs-assets/build-native-modules*
src/mobile/android/build/nodejs-native-assets-temp-build*
src/mobile/android/build/nodejs-assets*

# realm
*.realm
*.realm.lock
*.management/
realm-object-server/

# NPM lockfiles
package-lock.json
2 changes: 1 addition & 1 deletion docs/copyrightHeader
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2018 IOTA Foundation
* Copyright (c) 2019 IOTA Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down
40 changes: 40 additions & 0 deletions docs/dev/entangled-mobile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Building `entangled` for Trinity Mobile

## Required Dependencies
- [Bazel](https://docs.bazel.build/versions/master/install.html)
- Xcode with Command Line Tools installed (iOS only)
- Android SDK (Android only)
- Android NDK (Android only)


## iOS
1. Clone `iotaledger/entangled` and navigate to it
```
git clone https://github.com/iotaledger/entangled && cd entangled
```
2. Check out [iotaledger/entangled#26](https://github.com/iotaledger/entangled/pull/26)
```
git fetch origin pull/26/head:ios
```
3. Build the `mobile/ios:ios_bindings` target for all CPU architectures
```
bazel build --ios_multi_cpus=i386,x86_64,armv7,arm64 --copt=-fembed-bitcode --copt=-O3 //mobile/ios:ios_bindings
```
4. Unzip the generated framework
```
unzip bazel-bin/mobile/ios/ios_bindings.zip -d ios_bindings
```
5. Open the Trinity iOS workspace located in `trinity-wallet/src/mobile/ios/iotaWallet.xcworkspace`
6. Delete the existing `EntangledKit.framework` from the workspace (make sure to select `Move to Trash`)
7. Drag the new framework from `entangled/ios_bindings` into the `Frameworks` group in the workspace (ensure that `Copy items if needed` and `Create groups` are selected)

## Android

1. Navigate to `src/mobile/scripts`
```
cd src/mobile/scripts
```
2. Run `build-entangled-android.sh`
```
./build-entangled-android.sh
```
33 changes: 19 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"lint:shared": "./node_modules/.bin/eslint src/shared/",
"lint:desktop": "./node_modules/.bin/eslint src/desktop/",
"format": "prettier --write \"**/*.{js,json,css}\"",
"precommit": "lint-staged && yarn lint && yarn test:all",
"test:all": "cd src/shared/ && yarn test && cd ../mobile/ && yarn test && cd ../desktop/ && yarn test && cd ../",
"deps:shared": "cd src/shared && yarn && cd ../..",
"deps:mobile": "cd src/mobile && yarn && cd ../..",
Expand All @@ -36,25 +35,31 @@
]
},
"devDependencies": {
"auditjs": "^3.0.10",
"auditjs": "^3.1.1",
"babel-eslint": "^10.0.1",
"eslint": "^4.18.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^3.3.0",
"eslint-plugin-babel": "^4.1.2",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-config-prettier": "^4.1.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.7.0",
"eslint-plugin-react-native": "^3.2.1",
"husky": "^1.2.0",
"lint-staged": "^4.2.3",
"node-cmd": "^3.0.0",
"os": "^0.1.1",
"prettier": "^1.11.0",
"shared-modules": "./src/shared/"
"husky": "^1.3.1",
"lint-staged": "^8.1.5",
"prettier": "^1.11.0"
},
"dependencies": {
"snyk": "^1.116.2"
"snyk": "^1.150.0"
},
"snyk": true
"resolutions": {
"request": ">=2.88.0",
"node.extend": ">=1.1.7"
},
"snyk": true,
"husky": {
"hooks": {
"pre-commit": "lint-staged && yarn lint && yarn test:all"
}
}
}
6 changes: 6 additions & 0 deletions src/desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ This is the repository for the IOTA Trinity Desktop Wallet. The application is b
On **Windows** platforms you'll need to install build tools to succesfully compile native modules:

```
# Install Visual C++ Build Tools and Python 2.7
npm install --global windows-build-tools
# Install OpenSSL VC++ Static 64bit Library
git clone https://github.com/Microsoft/vcpkg C:\src\vcpkg
cd C:\src\vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg install openssl:x64-windows-static
```

On **Linux** platforms you'll need to additional packages to build native modules:
Expand Down
5 changes: 5 additions & 0 deletions src/desktop/__mocks__/samples/keychain.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/desktop/__tests__/libs/seedStore/keychain.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Keychain SeedStore class', () => {
test('Get max inputs', async () => {
const seedVault = await new Keychain(passwordMock);

expect(seedVault.maxInputs).toEqual(0);
expect(seedVault.getMaxInputs()).toEqual(0);
});

test('Create new account', async () => {
Expand Down
6 changes: 5 additions & 1 deletion src/desktop/__tests__/libs/seedStore/ledger.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ global.Electron = {
getAddress,
};
}),
getAppMaxBundleSize: jest.fn(() => {
return 5;
}),
},
};

Expand All @@ -26,7 +29,8 @@ describe('Ledger SeedStore class', () => {
test('get max inputs', async () => {
const seedVault = await new Ledger();

expect(seedVault.maxInputs).toEqual(2);
const maxInputs = await seedVault.getMaxInputs();
expect(maxInputs).toEqual(5);
});

test('Get seed object', async () => {
Expand Down
8 changes: 3 additions & 5 deletions src/desktop/__tests__/libs/seedStore/seedStoreCore.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ import SeedStoreCore from 'libs/SeedStore/SeedStoreCore';
import trytes from '../../../__mocks__/samples/trytes.js';

global.Electron = {
powFn: async () => 'N9UIMZQVDYWLXWGHLELNRCUUPMP',
getPowFn: () => async () => 'N9UIMZQVDYWLXWGHLELNRCUUPMP',
};

describe('SeedStore core class', () => {
test('performPow', async () => {
const seedStore = new SeedStoreCore();
const { transactionObjects } = await seedStore.performPow(
const pow = await seedStore.performPow(
trytes.value,
'GSHUHUWAUUGQHHNAPRDPDJRKZFJNIAPFNTVAHZPUNDJWRHZSZASOERZURXZVEHN9OJVS9QNRGSJE99999',
'LLJWVVZFXF9ZGFSBSHPCD9HOIFBCLXGRV9XWSQDTGOMSRGQQIVFVZKHLKTJJVFMXQTZVPNRNAQEPA9999',
14,
);

transactionObjects.forEach((tx, index) => {
expect(tx.currentIndex).toEqual(index);
});
expect(pow).toEqual('N9UIMZQVDYWLXWGHLELNRCUUPMP');
});

test('getDigest', async () => {
Expand Down
12 changes: 5 additions & 7 deletions src/desktop/__tests__/native/preload/electron.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@
import Electron from '../../../native/preload/Electron';

import trytes from '../../../__mocks__/samples/trytes.js';
import { seedTrytesMock, passwordMock } from '../../../__mocks__/samples/keychain';
import { seedTrytesMock, passwordMock, addressMocks } from '../../../__mocks__/samples/keychain';

describe('Electron preload class', () => {
test('Proof of Work', async () => {
const nonce = await Electron.powFn(trytes.value[0], 14);
const pow = Electron.getPowFn();
const nonce = await pow(trytes.value[0], 14);
expect(nonce.length).toEqual(27);
});

test('Single address generation', async () => {
const address = await Electron.genFn(seedTrytesMock, 0, 2, 1);
expect(address).toEqual('XUERGHWTYRTFUYKFKXURKHMFEVLOIFTTCNTXOGLDPCZ9CJLKHROOPGNAQYFJEPGK9OKUQROUECBAVNXRX');
expect(address).toEqual(addressMocks[1]);
});

test('Multiple address generation', async () => {
const address = await Electron.genFn(seedTrytesMock, 0, 2, 2);
expect(address).toEqual([
'XUERGHWTYRTFUYKFKXURKHMFEVLOIFTTCNTXOGLDPCZ9CJLKHROOPGNAQYFJEPGK9OKUQROUECBAVNXRX',
'RJBYLCIOUKWJVCUKZQZCPIKNBUOGRGVXHRTTE9ZFSCGTFRKELMJBDDAKEYYCLHLJDNSHQ9RTIUIDLMUOB',
]);
expect(address).toEqual([addressMocks[1], addressMocks[2]]);
});

test('Calculate seed checksum', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/desktop/__tests__/ui/components/balance.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const props = {
accounts: {
accountInfo: {
foo: {
balance: 5500000,
addressData: [{ balance: 5000000 }, { balance: 500000 }],
},
bar: {
balance: 4000000,
addressData: [{ balance: 4000000 }],
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/desktop/__tests__/ui/components/list.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const props = {
updateAccount: jest.fn(),
toggleEmptyTransactions: jest.fn(),
/** Transaction history */
transfers: [
transactions: [
{
attachmentTimestamp: 1546934663241,
bundle: 'ABCDEFGHIJKLMONPRSTUVXYZABCDEFGHIJKLMONPRSTUVXYZABCDEFGHIJKLMONPRSTUVXYZABCDEFGHI',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3ac6d01

Please sign in to comment.