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

Commit

Permalink
chore: merge develop into master (#416)
Browse files Browse the repository at this point in the history
chore: merge develop into master
  • Loading branch information
luciorubeens committed Sep 30, 2019
2 parents f5898de + ccf0dc0 commit 57cbeab
Show file tree
Hide file tree
Showing 17 changed files with 395 additions and 277 deletions.
49 changes: 0 additions & 49 deletions .circleci/config.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint

on:
push:
branches:
- '**'
pull_request:
types: [ready_for_review, synchronize, opened]

jobs:
source:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install pre dependencies
run: yarn global add [email protected] [email protected]
- name: Install
run: npm rebuild node-sass && yarn install --frozen-lockfile
- name: Lint
run: npm run lint --bailOnLintError true
53 changes: 53 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Test

on:
push:
branches:
- '**'
pull_request:
types: [ready_for_review, synchronize, opened]

jobs:
unit:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install pre dependencies
run: yarn global add [email protected] [email protected]
- name: Install
run: npm rebuild node-sass && yarn install --frozen-lockfile
- name: Test
run: npm run test:coverage
- name: Build
run: npm run build -- --prod

e2e:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 11.x, 12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install pre dependencies
run: yarn global add [email protected] [email protected]
- name: Install
run: npm rebuild node-sass && yarn install --frozen-lockfile
- name: Test
run: npm run test:e2e
- name: Build
run: npm run build -- --prod
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<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">
<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">
<name>Ark Mobile</name>
<description>ARK</description>
<author email="[email protected]" href="http://ark.io/">Ark Ecosystem</author>
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ark-mobile",
"version": "1.5.2",
"version": "1.5.3",
"author": {
"name": "Lucio Rubens",
"email": "[email protected]",
Expand Down Expand Up @@ -80,7 +80,7 @@
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-inappbrowser": "^3.1.0",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-network-information": "^2.0.2",
"cordova-plugin-qrscanner": "^3.0.1",
"cordova-plugin-screen-orientation": "^3.0.2",
Expand All @@ -89,20 +89,22 @@
"cordova-plugin-swift-support": "^3.1.1",
"cordova-plugin-vibration": "^3.1.1",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-x-socialsharing": "^5.4.7",
"cordova-plugin-x-socialsharing": "^5.6.0",
"cordova-sqlite-storage": "git+https://github.com/litehelpers/Cordova-sqlite-storage.git",
"es6-promise-plugin": "^4.2.2",
"iod": "^1.1.1",
"ionic-angular": "^3.9.8",
"ionic2-auto-complete": "^1.6.2-alpha",
"ionicons": "^3",
"is-url": "^1.2.4",
"json-typescript-mapper": "github:luciorubeens/json-typescript-mapper#master",
"lodash": "^4.17.15",
"moment-timezone": "^0.5.21",
"ng2-charts": "^1.6.0",
"ngx-filter-pipe": "^1.0.2",
"node-forge": "^0.8.5",
"rxjs": "^5.5.12",
"semver": "^6.3.0",
"string-hash": "^1.1.3",
"sw-toolbox": "3.6.0",
"wif": "^2.0.6",
Expand Down
3 changes: 3 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["config:base", ":preserveSemverRanges"]
}
8 changes: 0 additions & 8 deletions src/modals/custom-network-create/custom-network-create.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@
</ion-item>
</ion-col>
</ion-row>
<ion-row nowrap>
<ion-col>
<ion-item>
<ion-label stacked>{{ 'CUSTOM_NETWORK.IS_VERSION_2' | translate }}</ion-label>
<ion-toggle name="IsVersion2" [(ngModel)]="isVersion2"></ion-toggle>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</form>
</ion-content>
Expand Down
47 changes: 9 additions & 38 deletions src/modals/custom-network-create/custom-network-create.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Component } from '@angular/core';
import { IonicPage, LoadingController, ViewController } from 'ionic-angular';
import { ToastProvider } from '@providers/toast/toast';
import { LoaderAutoConfigure, Network, NetworkType, Peer, PeerVersion2ConfigResponse } from 'ark-ts';
import * as arkts from 'ark-ts';
import { LoaderAutoConfigure, Network, Peer, PeerVersion2ConfigResponse } from 'ark-ts';
import ArkClient from '@utils/ark-client';
import lodash from 'lodash';
import { HttpClient } from '@angular/common/http';

@IonicPage()
@Component({
Expand All @@ -15,56 +16,26 @@ export class CustomNetworkCreateModal {
public network: Network = new Network();
public name: string;
public seedServer: string;
public isVersion2: boolean;

public constructor(private viewCtrl: ViewController,
private toastProvider: ToastProvider,
private loadingCtrl: LoadingController) {
private loadingCtrl: LoadingController,
private httpClient: HttpClient) {
}

public dismiss(network?: Network): void {
this.viewCtrl.dismiss(network);
}

public configure(): void {
if (this.isVersion2) {
return this.configureVersion2();
}

private configure(): void {
const loading = this.loadingCtrl.create();
loading.present();

const seedServerUrl = this.getSeedServerUrl();
new arkts.Client(Network.getDefault(NetworkType.Mainnet))
.loader.autoConfigure(seedServerUrl.origin)
.finally(() => loading.dismiss())
.subscribe((r: LoaderAutoConfigure) => {
if (!r.success) {
this.configureError();
return;
}

this.network.name = this.name;
this.network.nethash = r.network.nethash;
this.network.token = r.network.token;
this.network.symbol = r.network.symbol;
this.network.explorer = r.network.explorer;
this.network.version = r.network.version;
this.network.activePeer = new Peer();
this.network.activePeer.ip = seedServerUrl.hostname;
this.network.activePeer.port = Number(seedServerUrl.port);
this.network.type = null;
this.dismiss(this.network);
}, () => this.configureError());
}
const protocol = seedServerUrl.protocol === 'https:' ? 'https' : 'http';

private configureVersion2(): void {
const loading = this.loadingCtrl.create();
loading.present();

const seedServerUrl = this.getSeedServerUrl();
new arkts.Client(Network.getDefault(NetworkType.Mainnet))
.peer.getVersion2Config(seedServerUrl.hostname, Number(seedServerUrl.port))
new ArkClient(this.seedServer, this.httpClient)
.getPeerConfig(seedServerUrl.hostname, Number(seedServerUrl.port), protocol)
.finally(() => loading.dismiss())
.subscribe((r: PeerVersion2ConfigResponse) => {
if (!r.data) {
Expand Down
3 changes: 2 additions & 1 deletion src/models/stored-network.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Network, Peer } from 'ark-ts';
import { PeerApiResponse } from '@utils/ark-client';

export interface FeeStatistic {
type: number;
Expand All @@ -16,7 +17,7 @@ export interface BlocksEpochResponse {

export class StoredNetwork extends Network {
public marketTickerName: string;
public peerList: Peer[];
public peerList: PeerApiResponse[];
public feeStatistics: FeeStatistic[];
public epoch: Date;
public activeDelegates: number;
Expand Down
1 change: 0 additions & 1 deletion src/pages/network-status/network-status.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ <h4 item-content class="content">{{ currentPeer?.version }}</h4>
<ion-row>
<ion-col text-center align-self-end>
<button class="button-continue" ion-button (click)="changePeer()">{{ 'NETWORKS_PAGE.CHANGE_PEER' | translate }}</button>
<button class="button-continue" ion-button (click)="resetToSeed()" [clear]="true">{{ 'NETWORKS_PAGE.RESET_TO_SEED' | translate }}</button>
</ion-col>
</ion-row>
</ion-grid>
Expand Down
19 changes: 3 additions & 16 deletions src/pages/network-status/network-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,11 @@ export class NetworkStatusPage implements OnDestroy {
duration: 10000
});

this.arkApiProvider.findGoodPeer();
this.loader.present();
});
}

resetToSeed() {
this.translateService.get('NETWORKS_PAGE.LOOKING_GOOD_PEER').debounceTime(500).subscribe((translation) => {
this.loader = this.loadingCtrl.create({
content: translation,
duration: 10000
this.arkApiProvider.connectToRandomPeer().catch(() => {
this.loader.dismiss();
this.toastProvider.error('NETWORKS_PAGE.NO_GOOD_PEER');
});

this.arkApiProvider.findGoodSeedPeer().then(success => {
if (!success) {
this.loader.dismiss();
this.toastProvider.error('NETWORKS_PAGE.NO_GOOD_PEER');
}
});
this.loader.present();
});
}
Expand Down
8 changes: 4 additions & 4 deletions src/pages/profiles/profile-create/profile-create.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</ion-col>
</ion-row>
<ion-row class="create-field" *ngIf="showAdvancedOptions">
<ion-col>
<ion-row>
<ion-item class="network-types" no-lines>
<span>{{ 'NETWORKS_PAGE.NETWORK_TYPE' | translate }}</span>
<p>{{ 'NETWORKS_PAGE.CHOOSE_ONE' | translate }}.</p>
Expand All @@ -47,12 +47,12 @@
</ion-col>
</ion-row>
</ion-grid>
</ion-col>
<ion-col *ngIf="activeNetworkChoice && !activeNetworkChoice.id">
</ion-row>
<ion-row *ngIf="activeNetworkChoice && !activeNetworkChoice.id">
<ion-item no-lines>
<customNetwork (onNetworkChange)="onCustomNetworkChange($event)"></customNetwork>
</ion-item>
</ion-col>
</ion-row>
</ion-row>
<ion-row class="layout-flex">
<ion-col align-self-end>
Expand Down
Loading

0 comments on commit 57cbeab

Please sign in to comment.