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

Commit 57cbeab

Browse files
authored
chore: merge develop into master (#416)
chore: merge develop into master
2 parents f5898de + ccf0dc0 commit 57cbeab

File tree

17 files changed

+395
-277
lines changed

17 files changed

+395
-277
lines changed

.circleci/config.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
types: [ready_for_review, synchronize, opened]
9+
10+
jobs:
11+
source:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [10.x, 12.x]
17+
18+
steps:
19+
- uses: actions/checkout@v1
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- name: Install pre dependencies
25+
run: yarn global add ionic@4.x cordova@8.x
26+
- name: Install
27+
run: npm rebuild node-sass && yarn install --frozen-lockfile
28+
- name: Lint
29+
run: npm run lint --bailOnLintError true

.github/workflows/test.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
types: [ready_for_review, synchronize, opened]
9+
10+
jobs:
11+
unit:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [10.x, 12.x]
17+
18+
steps:
19+
- uses: actions/checkout@v1
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- name: Install pre dependencies
25+
run: yarn global add ionic@4.x cordova@8.x
26+
- name: Install
27+
run: npm rebuild node-sass && yarn install --frozen-lockfile
28+
- name: Test
29+
run: npm run test:coverage
30+
- name: Build
31+
run: npm run build -- --prod
32+
33+
e2e:
34+
runs-on: ubuntu-latest
35+
36+
strategy:
37+
matrix:
38+
node-version: [10.x, 11.x, 12.x]
39+
40+
steps:
41+
- uses: actions/checkout@v1
42+
- name: Use Node.js ${{ matrix.node-version }}
43+
uses: actions/setup-node@v1
44+
with:
45+
node-version: ${{ matrix.node-version }}
46+
- name: Install pre dependencies
47+
run: yarn global add ionic@4.x cordova@8.x
48+
- name: Install
49+
run: npm rebuild node-sass && yarn install --frozen-lockfile
50+
- name: Test
51+
run: npm run test:e2e
52+
- name: Build
53+
run: npm run build -- --prod

config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<widget id="io.ark.wallet.mobile" version="1.5.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
2+
<widget id="io.ark.wallet.mobile" version="1.5.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
33
<name>Ark Mobile</name>
44
<description>ARK</description>
55
<author email="lucio@ark.io" href="http://ark.io/">Ark Ecosystem</author>

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ark-mobile",
3-
"version": "1.5.2",
3+
"version": "1.5.3",
44
"author": {
55
"name": "Lucio Rubens",
66
"email": "luciorubeens@gmail.com",
@@ -80,7 +80,7 @@
8080
"cordova-plugin-console": "^1.1.0",
8181
"cordova-plugin-device": "^2.0.3",
8282
"cordova-plugin-inappbrowser": "^3.1.0",
83-
"cordova-plugin-ionic-keyboard": "^2.1.3",
83+
"cordova-plugin-ionic-keyboard": "^2.2.0",
8484
"cordova-plugin-network-information": "^2.0.2",
8585
"cordova-plugin-qrscanner": "^3.0.1",
8686
"cordova-plugin-screen-orientation": "^3.0.2",
@@ -89,20 +89,22 @@
8989
"cordova-plugin-swift-support": "^3.1.1",
9090
"cordova-plugin-vibration": "^3.1.1",
9191
"cordova-plugin-whitelist": "^1.3.4",
92-
"cordova-plugin-x-socialsharing": "^5.4.7",
92+
"cordova-plugin-x-socialsharing": "^5.6.0",
9393
"cordova-sqlite-storage": "git+https://github.com/litehelpers/Cordova-sqlite-storage.git",
9494
"es6-promise-plugin": "^4.2.2",
9595
"iod": "^1.1.1",
9696
"ionic-angular": "^3.9.8",
9797
"ionic2-auto-complete": "^1.6.2-alpha",
9898
"ionicons": "^3",
99+
"is-url": "^1.2.4",
99100
"json-typescript-mapper": "github:luciorubeens/json-typescript-mapper#master",
100101
"lodash": "^4.17.15",
101102
"moment-timezone": "^0.5.21",
102103
"ng2-charts": "^1.6.0",
103104
"ngx-filter-pipe": "^1.0.2",
104105
"node-forge": "^0.8.5",
105106
"rxjs": "^5.5.12",
107+
"semver": "^6.3.0",
106108
"string-hash": "^1.1.3",
107109
"sw-toolbox": "3.6.0",
108110
"wif": "^2.0.6",

renovate.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["config:base", ":preserveSemverRanges"]
3+
}

src/modals/custom-network-create/custom-network-create.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@
3737
</ion-item>
3838
</ion-col>
3939
</ion-row>
40-
<ion-row nowrap>
41-
<ion-col>
42-
<ion-item>
43-
<ion-label stacked>{{ 'CUSTOM_NETWORK.IS_VERSION_2' | translate }}</ion-label>
44-
<ion-toggle name="IsVersion2" [(ngModel)]="isVersion2"></ion-toggle>
45-
</ion-item>
46-
</ion-col>
47-
</ion-row>
4840
</ion-grid>
4941
</form>
5042
</ion-content>

src/modals/custom-network-create/custom-network-create.ts

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { Component } from '@angular/core';
22
import { IonicPage, LoadingController, ViewController } from 'ionic-angular';
33
import { ToastProvider } from '@providers/toast/toast';
4-
import { LoaderAutoConfigure, Network, NetworkType, Peer, PeerVersion2ConfigResponse } from 'ark-ts';
5-
import * as arkts from 'ark-ts';
4+
import { LoaderAutoConfigure, Network, Peer, PeerVersion2ConfigResponse } from 'ark-ts';
5+
import ArkClient from '@utils/ark-client';
66
import lodash from 'lodash';
7+
import { HttpClient } from '@angular/common/http';
78

89
@IonicPage()
910
@Component({
@@ -15,56 +16,26 @@ export class CustomNetworkCreateModal {
1516
public network: Network = new Network();
1617
public name: string;
1718
public seedServer: string;
18-
public isVersion2: boolean;
1919

2020
public constructor(private viewCtrl: ViewController,
2121
private toastProvider: ToastProvider,
22-
private loadingCtrl: LoadingController) {
22+
private loadingCtrl: LoadingController,
23+
private httpClient: HttpClient) {
2324
}
2425

2526
public dismiss(network?: Network): void {
2627
this.viewCtrl.dismiss(network);
2728
}
2829

29-
public configure(): void {
30-
if (this.isVersion2) {
31-
return this.configureVersion2();
32-
}
33-
30+
private configure(): void {
3431
const loading = this.loadingCtrl.create();
3532
loading.present();
3633

3734
const seedServerUrl = this.getSeedServerUrl();
38-
new arkts.Client(Network.getDefault(NetworkType.Mainnet))
39-
.loader.autoConfigure(seedServerUrl.origin)
40-
.finally(() => loading.dismiss())
41-
.subscribe((r: LoaderAutoConfigure) => {
42-
if (!r.success) {
43-
this.configureError();
44-
return;
45-
}
46-
47-
this.network.name = this.name;
48-
this.network.nethash = r.network.nethash;
49-
this.network.token = r.network.token;
50-
this.network.symbol = r.network.symbol;
51-
this.network.explorer = r.network.explorer;
52-
this.network.version = r.network.version;
53-
this.network.activePeer = new Peer();
54-
this.network.activePeer.ip = seedServerUrl.hostname;
55-
this.network.activePeer.port = Number(seedServerUrl.port);
56-
this.network.type = null;
57-
this.dismiss(this.network);
58-
}, () => this.configureError());
59-
}
35+
const protocol = seedServerUrl.protocol === 'https:' ? 'https' : 'http';
6036

61-
private configureVersion2(): void {
62-
const loading = this.loadingCtrl.create();
63-
loading.present();
64-
65-
const seedServerUrl = this.getSeedServerUrl();
66-
new arkts.Client(Network.getDefault(NetworkType.Mainnet))
67-
.peer.getVersion2Config(seedServerUrl.hostname, Number(seedServerUrl.port))
37+
new ArkClient(this.seedServer, this.httpClient)
38+
.getPeerConfig(seedServerUrl.hostname, Number(seedServerUrl.port), protocol)
6839
.finally(() => loading.dismiss())
6940
.subscribe((r: PeerVersion2ConfigResponse) => {
7041
if (!r.data) {

src/models/stored-network.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Network, Peer } from 'ark-ts';
2+
import { PeerApiResponse } from '@utils/ark-client';
23

34
export interface FeeStatistic {
45
type: number;
@@ -16,7 +17,7 @@ export interface BlocksEpochResponse {
1617

1718
export class StoredNetwork extends Network {
1819
public marketTickerName: string;
19-
public peerList: Peer[];
20+
public peerList: PeerApiResponse[];
2021
public feeStatistics: FeeStatistic[];
2122
public epoch: Date;
2223
public activeDelegates: number;

src/pages/network-status/network-status.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ <h4 item-content class="content">{{ currentPeer?.version }}</h4>
4141
<ion-row>
4242
<ion-col text-center align-self-end>
4343
<button class="button-continue" ion-button (click)="changePeer()">{{ 'NETWORKS_PAGE.CHANGE_PEER' | translate }}</button>
44-
<button class="button-continue" ion-button (click)="resetToSeed()" [clear]="true">{{ 'NETWORKS_PAGE.RESET_TO_SEED' | translate }}</button>
4544
</ion-col>
4645
</ion-row>
4746
</ion-grid>

0 commit comments

Comments
 (0)