mirror of https://github.com/BTCPrivate/copay.git
commit
633366cf1a
|
@ -35,33 +35,33 @@
|
|||
<preference name="android-minSdkVersion" value="19" />
|
||||
|
||||
<!-- Supported Platforms -->
|
||||
<engine name="android" spec="6.2.3" />
|
||||
<engine name="ios" spec="4.5.2" />
|
||||
<engine name="android" spec="^6.3.0" />
|
||||
<engine name="ios" spec="^4.5.3" />
|
||||
|
||||
<!-- Plugins -->
|
||||
<plugin name="cordova-clipboard" spec="1.1.0" />
|
||||
<plugin name="cordova-plugin-android-fingerprint-auth" spec="1.4.0" />
|
||||
<plugin name="cordova-plugin-device" spec="1.1.6" />
|
||||
<plugin name="cordova-plugin-globalization" spec="1.0.7" />
|
||||
<plugin name="cordova-plugin-qrscanner" spec="2.5.0" />
|
||||
<plugin name="cordova-plugin-splashscreen" spec="4.0.3" />
|
||||
<plugin name="cordova-plugin-statusbar" spec="2.2.3" />
|
||||
<plugin name="cordova-plugin-inappbrowser" spec="1.7.1" />
|
||||
<plugin name="cordova-plugin-touch-id" spec="3.2.0" />
|
||||
<plugin name="cordova-plugin-whitelist" spec="1.3.2" />
|
||||
<plugin name="cordova-plugin-x-socialsharing" spec="5.2.0" />
|
||||
<plugin name="cordova-plugin-x-toast" spec="2.6.0" />
|
||||
<plugin name="ionic-plugin-keyboard" spec="2.2.1" />
|
||||
<plugin name="cordova-clipboard" spec="^1.1.0" />
|
||||
<plugin name="cordova-plugin-android-fingerprint-auth" spec="^1.4.0" />
|
||||
<plugin name="cordova-plugin-device" spec="^1.1.6" />
|
||||
<plugin name="cordova-plugin-globalization" spec="^1.0.7" />
|
||||
<plugin name="cordova-plugin-qrscanner" spec="^2.5.0" />
|
||||
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
|
||||
<plugin name="cordova-plugin-statusbar" spec="^2.2.3" />
|
||||
<plugin name="cordova-plugin-inappbrowser" spec="^1.7.1" />
|
||||
<plugin name="cordova-plugin-touch-id" spec="^3.3.1" />
|
||||
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
|
||||
<plugin name="cordova-plugin-x-socialsharing" spec="^5.2.1" />
|
||||
<plugin name="cordova-plugin-x-toast" spec="^2.6.0" />
|
||||
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
|
||||
|
||||
<plugin name="cordova-plugin-spinner-dialog" spec="1.3.1" />
|
||||
<plugin name="cordova-plugin-dialogs" spec="1.3.3" />
|
||||
<plugin name="cordova-plugin-network-information" spec="1.3.3" />
|
||||
<plugin name="cordova-plugin-uniquedeviceid" spec="1.3.2" />
|
||||
<plugin name="cordova-plugin-file" spec="4.3.3" />
|
||||
<plugin name="cordova-plugin-transport-security" spec="0.1.2" />
|
||||
<plugin name="cordova-ios-requires-fullscreen" spec="0.0.2" />
|
||||
<plugin name="cordova-plugin-screen-orientation" spec="1.4.3" />
|
||||
<plugin name="cordova-custom-config" spec="4.0.2" />
|
||||
<plugin name="cordova-plugin-native-spinner" spec="^1.0.8" />
|
||||
<plugin name="cordova-plugin-dialogs" spec="^1.3.3" />
|
||||
<plugin name="cordova-plugin-network-information" spec="^1.3.3" />
|
||||
<plugin name="cordova-plugin-uniquedeviceid" spec="^1.3.2" />
|
||||
<plugin name="cordova-plugin-file" spec="^4.3.3" />
|
||||
<plugin name="cordova-plugin-transport-security" spec="^0.1.2" />
|
||||
<plugin name="cordova-ios-requires-fullscreen" spec="^0.0.2" />
|
||||
<plugin name="cordova-plugin-screen-orientation" spec="^2.0.1" />
|
||||
<plugin name="cordova-custom-config" spec="^4.0.2" />
|
||||
<plugin name="cordova-plugin-customurlscheme" spec="https://github.com/cmgustavo/Custom-URL-scheme.git#v4.0">
|
||||
<variable name="URL_SCHEME" value="bitcoin" />
|
||||
<variable name="SECOND_URL_SCHEME" value="*APPURI*" />
|
||||
|
@ -69,7 +69,7 @@
|
|||
</plugin>
|
||||
<plugin name="cordova-plugin-fcm" spec="https://github.com/cmgustavo/cordova-plugin-fcm.git" />
|
||||
|
||||
<plugin name="cordova-plugin-ionic-webview" spec="1.1.15" />
|
||||
<plugin name="cordova-plugin-ionic-webview" spec="^1.1.16" />
|
||||
|
||||
<!-- Platform Specific Settings -->
|
||||
<platform name="ios">
|
||||
|
|
140
package.json
140
package.json
|
@ -49,41 +49,40 @@
|
|||
"apply:bitpay": "npm i && cd app-template && node apply.js bitpay"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/common": "4.4.3",
|
||||
"@angular/compiler": "4.4.3",
|
||||
"@angular/compiler-cli": "4.4.3",
|
||||
"@angular/core": "4.4.3",
|
||||
"@angular/forms": "4.4.3",
|
||||
"@angular/http": "4.4.3",
|
||||
"@angular/platform-browser": "4.4.3",
|
||||
"@angular/platform-browser-dynamic": "4.4.3",
|
||||
"@angular/tsc-wrapped": "4.4.3",
|
||||
"@biesbjerg/ngx-translate-po-http-loader": "1.0.1",
|
||||
"@angular/common": "^5.0.1",
|
||||
"@angular/compiler": "^5.0.1",
|
||||
"@angular/compiler-cli": "^5.0.1",
|
||||
"@angular/core": "^5.0.1",
|
||||
"@angular/forms": "^5.0.1",
|
||||
"@angular/http": "^5.0.1",
|
||||
"@angular/platform-browser": "^5.0.1",
|
||||
"@angular/platform-browser-dynamic": "^5.0.1",
|
||||
"@angular/tsc-wrapped": "^4.4.6",
|
||||
"@biesbjerg/ngx-translate-po-http-loader": "^2.0.1",
|
||||
"@ionic-native/android-fingerprint-auth": "^4.2.1",
|
||||
"@ionic-native/clipboard": "^4.1.0",
|
||||
"@ionic-native/core": "^3.12.1",
|
||||
"@ionic-native/core": "^4.3.3",
|
||||
"@ionic-native/file": "^4.1.0",
|
||||
"@ionic-native/qr-scanner": "^4.1.0",
|
||||
"@ionic-native/social-sharing": "^4.1.0",
|
||||
"@ionic-native/splash-screen": "^3.12.1",
|
||||
"@ionic-native/status-bar": "^3.12.1",
|
||||
"@ionic-native/splash-screen": "^4.3.3",
|
||||
"@ionic-native/status-bar": "^4.3.3",
|
||||
"@ionic-native/toast": "^4.1.0",
|
||||
"@ionic-native/touch-id": "^4.2.1",
|
||||
"@ionic/storage": "^2.0.1",
|
||||
"@ngx-translate/core": "6.0.1",
|
||||
"@nsalaun/ng-logger": "2.0.1",
|
||||
"ajv": "5.2.2",
|
||||
"angular2-moment": "1.7.0",
|
||||
"angular2-qrcode": "2.0.1",
|
||||
"autoprefixer": "7.1.2",
|
||||
"bitcore-wallet-client": "6.4.0",
|
||||
"preconditions": "2.2.0",
|
||||
"buffer-compare": "1.1.1",
|
||||
"cordova-android": "6.2.3",
|
||||
"@ionic/storage": "^2.1.3",
|
||||
"@ngx-translate/core": "^8.0.0",
|
||||
"@nsalaun/ng-logger": "^5.0.0",
|
||||
"ajv": "^5.3.0",
|
||||
"angular2-moment": "^1.7.0",
|
||||
"angular2-qrcode": "^2.0.1",
|
||||
"autoprefixer": "^7.1.6",
|
||||
"bitcore-wallet-client": "^6.4.0",
|
||||
"buffer-compare": "^1.1.1",
|
||||
"cordova-android": "^6.3.0",
|
||||
"cordova-clipboard": "^1.1.0",
|
||||
"cordova-custom-config": "^4.0.2",
|
||||
"cordova-ios": "4.5.2",
|
||||
"cordova-ios-requires-fullscreen": "0.0.2",
|
||||
"cordova-ios": "^4.5.3",
|
||||
"cordova-ios-requires-fullscreen": "^0.0.2",
|
||||
"cordova-plugin-android-fingerprint-auth": "^1.4.0",
|
||||
"cordova-plugin-compat": "^1.2.0",
|
||||
"cordova-plugin-customurlscheme": "https://github.com/cmgustavo/Custom-URL-scheme.git#v4.0",
|
||||
|
@ -96,66 +95,65 @@
|
|||
"cordova-plugin-ionic-webview": "^1.1.16",
|
||||
"cordova-plugin-network-information": "^1.3.3",
|
||||
"cordova-plugin-qrscanner": "^2.5.0",
|
||||
"cordova-plugin-screen-orientation": "^1.4.3",
|
||||
"cordova-plugin-spinner-dialog": "^1.3.1",
|
||||
"cordova-plugin-screen-orientation": "^2.0.1",
|
||||
"cordova-plugin-native-spinner": "^1.0.8",
|
||||
"cordova-plugin-splashscreen": "^4.0.3",
|
||||
"cordova-plugin-statusbar": "^2.2.3",
|
||||
"cordova-plugin-swift-support": "^3.1.1",
|
||||
"cordova-plugin-touch-id": "^3.2.0",
|
||||
"cordova-plugin-touch-id": "^3.3.1",
|
||||
"cordova-plugin-transport-security": "^0.1.2",
|
||||
"cordova-plugin-uniquedeviceid": "^1.3.2",
|
||||
"cordova-plugin-whitelist": "^1.3.2",
|
||||
"cordova-plugin-x-socialsharing": "^5.2.1",
|
||||
"cordova-plugin-x-toast": "^2.6.0",
|
||||
"cordova-sqlite-storage": "^2.0.4",
|
||||
"es6-promise-plugin": "^4.1.0",
|
||||
"ionic-angular": "3.7.1",
|
||||
"ionic-angular": "^3.9.2",
|
||||
"ionic-plugin-keyboard": "^2.2.1",
|
||||
"ionicons": "3.0.0",
|
||||
"lodash": "4.17.4",
|
||||
"ngx-clipboard": "8.0.3",
|
||||
"rxjs": "5.4.3",
|
||||
"simple-plist": "0.2.1",
|
||||
"sw-toolbox": "3.6.0",
|
||||
"zone.js": "0.8.18"
|
||||
"ionicons": "^3.0.0",
|
||||
"lodash": "^4.17.4",
|
||||
"ngx-clipboard": "^8.1.1",
|
||||
"preconditions": "^2.2.0",
|
||||
"rxjs": "^5.5.2",
|
||||
"simple-plist": "^0.2.1",
|
||||
"sw-toolbox": "^3.6.0",
|
||||
"zone.js": "^0.8.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/cli": "1.3.0",
|
||||
"@biesbjerg/ngx-translate-extract": "2.3.2",
|
||||
"@ionic/app-scripts": "3.0.1",
|
||||
"@types/chrome": "0.0.47",
|
||||
"@types/cordova-plugin-qrscanner": "1.0.31",
|
||||
"@types/jasmine": "2.5.53",
|
||||
"@types/lodash": "4.14.71",
|
||||
"angular2-template-loader": "0.6.2",
|
||||
"codecov": "2.2.0",
|
||||
"@angular/cli": "^1.5.0",
|
||||
"@biesbjerg/ngx-translate-extract": "^2.3.4",
|
||||
"@ionic/app-scripts": "^3.1.0",
|
||||
"@types/chrome": "^0.0.52",
|
||||
"@types/cordova-plugin-qrscanner": "^1.0.31",
|
||||
"@types/jasmine": "^2.6.3",
|
||||
"@types/lodash": "^4.14.83",
|
||||
"angular2-template-loader": "^0.6.2",
|
||||
"codecov": "^3.0.0",
|
||||
"fs-extra": "^4.0.2",
|
||||
"html-loader": "0.4.5",
|
||||
"ionic": "3.17.0",
|
||||
"jasmine-core": "2.6.4",
|
||||
"jasmine-spec-reporter": "4.1.1",
|
||||
"karma": "1.7.0",
|
||||
"karma-chrome-launcher": "2.2.0",
|
||||
"karma-jasmine": "1.1.0",
|
||||
"karma-jasmine-html-reporter": "0.2.2",
|
||||
"karma-mocha-reporter": "2.2.3",
|
||||
"karma-phantomjs-launcher": "1.0.4",
|
||||
"karma-remap-istanbul": "0.6.0",
|
||||
"karma-sourcemap-loader": "0.3.7",
|
||||
"karma-webpack": "2.0.4",
|
||||
"null-loader": "0.1.1",
|
||||
"path": "0.12.7",
|
||||
"trash-cli": "1.4.0",
|
||||
"ts-loader": "2.0.3",
|
||||
"ts-node": "3.3.0",
|
||||
"tslint": "5.5.0",
|
||||
"tslint-eslint-rules": "4.1.1",
|
||||
"typescript": "2.3.4",
|
||||
"webpack": "3.8.1"
|
||||
"html-loader": "^0.5.1",
|
||||
"ionic": "^3.17.0",
|
||||
"jasmine-core": "^2.8.0",
|
||||
"jasmine-spec-reporter": "^4.2.1",
|
||||
"karma": "^1.7.1",
|
||||
"karma-chrome-launcher": "^2.2.0",
|
||||
"karma-jasmine": "^1.1.0",
|
||||
"karma-jasmine-html-reporter": "^0.2.2",
|
||||
"karma-mocha-reporter": "^2.2.5",
|
||||
"karma-phantomjs-launcher": "^1.0.4",
|
||||
"karma-remap-istanbul": "^0.6.0",
|
||||
"karma-sourcemap-loader": "^0.3.7",
|
||||
"karma-webpack": "^2.0.5",
|
||||
"null-loader": "^0.1.1",
|
||||
"path": "^0.12.7",
|
||||
"trash-cli": "^1.4.0",
|
||||
"ts-loader": "^3.1.1",
|
||||
"ts-node": "^3.3.0",
|
||||
"tslint": "^5.8.0",
|
||||
"tslint-eslint-rules": "^4.1.1",
|
||||
"typescript": "^2.6.1",
|
||||
"webpack": "^3.8.1"
|
||||
},
|
||||
"cordova": {
|
||||
"plugins": {
|
||||
"cordova-sqlite-storage": {},
|
||||
"cordova-plugin-device": {},
|
||||
"cordova-plugin-splashscreen": {},
|
||||
"cordova-plugin-statusbar": {},
|
||||
|
@ -167,7 +165,7 @@
|
|||
"cordova-plugin-qrscanner": {},
|
||||
"cordova-plugin-touch-id": {},
|
||||
"cordova-plugin-android-fingerprint-auth": {},
|
||||
"cordova-plugin-spinner-dialog": {},
|
||||
"cordova-plugin-native-spinner": {},
|
||||
"cordova-plugin-dialogs": {},
|
||||
"cordova-plugin-network-information": {},
|
||||
"cordova-plugin-uniquedeviceid": {},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { ErrorHandler, NgModule, APP_INITIALIZER } from '@angular/core';
|
||||
import { HttpModule, Http } from '@angular/http';
|
||||
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
||||
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
|
||||
|
||||
/* Native modules */
|
||||
|
@ -94,7 +94,7 @@ import { TxConfirmNotificationProvider } from '../providers/tx-confirm-notificat
|
|||
import { TxFormatProvider } from '../providers/tx-format/tx-format';
|
||||
import { WalletProvider } from '../providers/wallet/wallet';
|
||||
|
||||
export function createTranslateLoader(http: Http) {
|
||||
export function createTranslateLoader(http: HttpClient) {
|
||||
return new TranslatePoHttpLoader(http, 'assets/i18n', '.po');
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ export function providersComponents() {
|
|||
tabsPlacement: 'bottom'
|
||||
}),
|
||||
BrowserModule,
|
||||
HttpModule,
|
||||
HttpClientModule,
|
||||
NgLoggerModule.forRoot(Level.LOG),
|
||||
MomentModule,
|
||||
QRCodeModule,
|
||||
|
@ -214,7 +214,7 @@ export function providersComponents() {
|
|||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useFactory: createTranslateLoader,
|
||||
deps: [Http]
|
||||
deps: [HttpClient]
|
||||
}
|
||||
}),
|
||||
],
|
||||
|
|
|
@ -146,8 +146,8 @@ export class AmountPage {
|
|||
// Always return to BTC... TODO?
|
||||
this.altUnitIndex = 0;
|
||||
} else {
|
||||
this.altUnitIndex = _.findIndex(this.availableUnits, {
|
||||
isFiat: true
|
||||
this.altUnitIndex = _.findIndex(this.availableUnits, function(o) {
|
||||
return o.isFiat == true;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Logger } from '@nsalaun/ng-logger';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { LanguageProvider } from '../../providers/language/language';
|
||||
import { ConfigProvider } from '../../providers/config/config';
|
||||
|
@ -41,11 +40,11 @@ interface App {
|
|||
|
||||
@Injectable()
|
||||
export class AppProvider {
|
||||
public info: App;
|
||||
public info: any;
|
||||
private jsonPath: string = 'assets/appConfig.json';
|
||||
|
||||
constructor(
|
||||
public http: Http,
|
||||
public http: HttpClient,
|
||||
private logger: Logger,
|
||||
private language: LanguageProvider,
|
||||
private config: ConfigProvider,
|
||||
|
@ -71,7 +70,6 @@ export class AppProvider {
|
|||
}
|
||||
|
||||
private getInfo() {
|
||||
return this.http.get(this.jsonPath)
|
||||
.map((res: Response) => res.json());
|
||||
return this.http.get(this.jsonPath);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,12 +44,12 @@ export class FeeProvider {
|
|||
let feeLevelRate: any;
|
||||
|
||||
if (response.fromCache) {
|
||||
feeLevelRate = _.find(response.levels[network], {
|
||||
level: feeLevel
|
||||
feeLevelRate = _.find(response.levels[network], function (o) {
|
||||
return o.level == feeLevel;
|
||||
});
|
||||
} else {
|
||||
feeLevelRate = _.find(response[network], {
|
||||
level: feeLevel
|
||||
feeLevelRate = _.find(response[network], function (o) {
|
||||
return o.level == feeLevel;
|
||||
});
|
||||
}
|
||||
if (!feeLevelRate || !feeLevelRate.feePerKb) {
|
||||
|
@ -104,4 +104,4 @@ export class FeeProvider {
|
|||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Http } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
import * as _ from "lodash";
|
||||
|
||||
@Injectable()
|
||||
|
@ -8,7 +6,7 @@ export class Filter {
|
|||
|
||||
public formats: any;
|
||||
|
||||
constructor(public http: Http) {
|
||||
constructor() {
|
||||
console.log('Hello Filter Provider');
|
||||
this.formats = {
|
||||
CURRENCY_SYM: "$",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { TestBed, inject, async } from '@angular/core/testing';
|
||||
import { Http } from '@angular/http';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Logger } from '@nsalaun/ng-logger';
|
||||
import { WalletProvider } from '../wallet/wallet';
|
||||
import { ProfileProvider } from './profile';
|
||||
|
@ -36,7 +36,7 @@ describe('Profile Provider', () => {
|
|||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
ProfileProvider,
|
||||
{ provide: Http },
|
||||
{ provide: HttpClient },
|
||||
{ provide: Logger },
|
||||
{ provide: WalletProvider },
|
||||
{ provide: PersistenceProvider, useClass: PersistenceProviderMock },
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Http } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
import 'rxjs/add/operator/toPromise';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
@Injectable()
|
||||
|
@ -17,7 +15,7 @@ export class RateProvider {
|
|||
private rateServiceUrl = 'https://bitpay.com/api/rates';
|
||||
private bchRateServiceUrl = 'https://api.kraken.com/0/public/Ticker?pair=BCHUSD,BCHEUR';
|
||||
|
||||
constructor(public http: Http) {
|
||||
constructor(public http: HttpClient) {
|
||||
console.log('Hello RateProvider Provider');
|
||||
this._rates = {};
|
||||
this._alternatives = [];
|
||||
|
@ -65,17 +63,19 @@ export class RateProvider {
|
|||
}
|
||||
|
||||
getBTC(): Promise<any> {
|
||||
return this.http.get(this.rateServiceUrl)
|
||||
.map((response) => response.json())
|
||||
.toPromise()
|
||||
.catch((error) => console.log("Error", error));
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get(this.rateServiceUrl).subscribe((data) => {
|
||||
resolve(data);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getBCH(): Promise<any> {
|
||||
return this.http.get(this.bchRateServiceUrl)
|
||||
.map((response) => response.json())
|
||||
.toPromise()
|
||||
.catch((error) => console.log("Error", error));
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get(this.bchRateServiceUrl).subscribe((data) => {
|
||||
resolve(data);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getRate(code, chain?) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { TestBed, inject, async } from '@angular/core/testing';
|
||||
import { Http } from '@angular/http';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { AppProvider } from '../../providers/app/app';
|
||||
import { ReleaseProvider } from './release';
|
||||
|
||||
|
@ -17,9 +17,9 @@ describe('Release Provider', () => {
|
|||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
ReleaseProvider,
|
||||
{ provide: Http },
|
||||
{ provide: AppProvider, useClass: AppProviderMock },
|
||||
ReleaseProvider,
|
||||
{ provide: HttpClient },
|
||||
{ provide: AppProvider, useClass: AppProviderMock },
|
||||
]
|
||||
});
|
||||
});
|
||||
|
@ -34,7 +34,7 @@ describe('Release Provider', () => {
|
|||
it('should get successfully the current app version', () => {
|
||||
// Should return the AppProviderMock object
|
||||
const appVersion = service.getCurrentAppVersion();
|
||||
|
||||
|
||||
expect(appVersion).toBeDefined();
|
||||
expect(appVersion).toEqual(currentAppVersion);
|
||||
});
|
||||
|
@ -49,20 +49,20 @@ describe('Release Provider', () => {
|
|||
expect(version).toEqual(latestAppVersion);
|
||||
});
|
||||
}));
|
||||
|
||||
|
||||
it('should check unsuccessfully the current app version format', () => {
|
||||
const result = service.checkForUpdates(latestAppVersion, 'V..3.3.3');
|
||||
|
||||
|
||||
expect(result.updateAvailable).toBeNull;
|
||||
expect(result.availabeVersion).toBeNull;
|
||||
expect(result.error).toBeDefined();
|
||||
expect(result.error).toMatch('Cannot');
|
||||
expect(result.error).toMatch('version tag');
|
||||
});
|
||||
|
||||
|
||||
it('should check unsuccessfully the latest app version format', () => {
|
||||
const result = service.checkForUpdates('V..3.3.3', currentAppVersion);
|
||||
|
||||
|
||||
expect(result.updateAvailable).toBeNull;
|
||||
expect(result.availabeVersion).toBeNull;
|
||||
expect(result.error).toBeDefined();
|
||||
|
@ -77,10 +77,10 @@ describe('Release Provider', () => {
|
|||
expect(result.updateAvailable).toBeNull;
|
||||
expect(result.availabeVersion).toBeNull;
|
||||
});
|
||||
|
||||
|
||||
it('should be a new version available', () => {
|
||||
const result = service.checkForUpdates(latestAppVersion, currentAppVersion);
|
||||
|
||||
|
||||
expect(result.error).toBeNull;
|
||||
expect(result.updateAvailable).toBeTruthy;
|
||||
expect(result.availabeVersion).toEqual(latestAppVersion);
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Http } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
import 'rxjs/add/operator/toPromise';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { AppProvider } from '../../providers/app/app';
|
||||
|
||||
@Injectable()
|
||||
|
@ -9,20 +7,21 @@ export class ReleaseProvider {
|
|||
private LATEST_RELEASE_URL: string;
|
||||
private appVersion: string;
|
||||
|
||||
constructor(public http: Http, private app: AppProvider) {
|
||||
constructor(public http: HttpClient, private app: AppProvider) {
|
||||
this.LATEST_RELEASE_URL = 'https://api.github.com/repos/bitpay/copay/releases/latest';
|
||||
this.appVersion = this.app.info.version;
|
||||
}
|
||||
|
||||
|
||||
getCurrentAppVersion() {
|
||||
return this.appVersion;
|
||||
}
|
||||
|
||||
getLatestAppVersion(): Promise<any> {
|
||||
return this.http.get(this.LATEST_RELEASE_URL)
|
||||
.map((response) => response.json().tag_name)
|
||||
.toPromise()
|
||||
.catch((error) => (error));
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get(this.LATEST_RELEASE_URL).subscribe((data) => {
|
||||
resolve(data['tag_name']);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
checkForUpdates(latestVersion: string, currentVersion?: string) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { QRScanner, QRScannerStatus } from '@ionic-native/qr-scanner';
|
||||
import { PlatformProvider } from '../platform/platform';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
@Injectable()
|
||||
export class ScanProvider {
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Http } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
import { BwcProvider } from '../bwc/bwc';
|
||||
import { RateProvider } from '../rate/rate';
|
||||
import { ConfigProvider } from '../config/config';
|
||||
|
@ -14,7 +12,6 @@ export class TxFormatProvider {
|
|||
public pendingTxProposalsCountForUs: number
|
||||
|
||||
constructor(
|
||||
public http: Http,
|
||||
private bwc: BwcProvider,
|
||||
private rate: RateProvider,
|
||||
private config: ConfigProvider,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { TestBed, async } from '@angular/core/testing';
|
||||
import { HttpModule } from '@angular/http';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { ConfigProvider } from '../config/config';
|
||||
import { WalletProvider } from './wallet';
|
||||
import { Logger, Level as LoggerLevel } from '@nsalaun/ng-logger';
|
||||
|
@ -37,7 +37,7 @@ describe('Provider: Wallet Provider', () => {
|
|||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpModule],
|
||||
imports: [HttpClientModule],
|
||||
providers: [
|
||||
WalletProvider,
|
||||
{ provide: ConfigProvider },
|
||||
|
@ -114,4 +114,4 @@ describe('Provider: Wallet Provider', () => {
|
|||
})
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -637,8 +637,8 @@ export class WalletProvider {
|
|||
|
||||
// Approx utxo amount, from which the uxto is economically redeemable
|
||||
private getMinFee(wallet: any, feeLevels: any, nbOutputs?: number): number {
|
||||
let level: any = lodash.find(feeLevels[wallet.network], {
|
||||
level: 'normal',
|
||||
let level: any = lodash.find(feeLevels[wallet.network], function (o) {
|
||||
return o.level == 'normal';
|
||||
});
|
||||
let lowLevelRate = parseInt((level.feePerKb / 1000).toFixed(0));
|
||||
|
||||
|
|
Loading…
Reference in New Issue