Skip to content

Commit 1fd7f13

Browse files
committed
Merge branch 'master' of github.com:bitpay/bitcore into feature/env-bitcore-node-http-port
2 parents cfe9fbf + ee6e136 commit 1fd7f13

File tree

4 files changed

+27
-25
lines changed

4 files changed

+27
-25
lines changed

packages/bitcore-wallet-service/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
"mocha": "^5.2.0",
7171
"mocha-lcov-reporter": "^1.3.0",
7272
"proxyquire": "^1.7.2",
73-
"rimraf": "^2.6.3",
7473
"sinon": "^7.1.1",
7574
"supertest": "*",
7675
"ts-node": "^8.0.3",
@@ -88,7 +87,7 @@
8887
"compile": "npm run tsc",
8988
"tsc": "npm run clean &&./node_modules/.bin/tsc",
9089
"build": "tsc && npm run lint",
91-
"clean": "rimraf ./ts_build",
90+
"clean": "rm -rf ./ts_build",
9291
"lint": "tslint -c tslint.json 'src/**/*.ts'",
9392
"lint-fix": "tslint --fix -c tslint.json 'src/**/*.ts'"
9493
},
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
module.exports = function(wallet, appName, appVersion) {
1+
module.exports = (wallet, appName, appVersion) => {
22
if (!appVersion || !appName) return;
33

4-
if (wallet.network == 'livenet' && appVersion.major==5 && wallet.createdOn < 1443461026 ) {
4+
if (wallet.network == 'livenet' && appVersion.major == 5 && wallet.createdOn < 1443461026) {
55
return {
66
title: 'Deprecated Test message',
77
body: 'Only for bitpay, old wallets',
@@ -12,4 +12,4 @@ module.exports = function(wallet, appName, appVersion) {
1212
app: 'bitpay',
1313
};
1414
}
15-
}
15+
};

packages/bitcore-wallet-service/src/lib/pushnotificationsservice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import * as async from 'async';
44
import * as fs from 'fs';
55
import * as _ from 'lodash';
66
import request from 'request';
7+
import { MessageBroker } from './messagebroker';
78
import { INotification } from './model/notification';
89
import { IPreferences } from './model/preferences';
910
import { Storage } from './storage';
1011
var Mustache = require('mustache');
1112
var defaultRequest = require('request');
12-
var MessageBroker = require('./messagebroker');
1313
var path = require('path');
1414
var Utils = require('./common/utils');
1515
var Defaults = require('./common/defaults');

packages/bitcore-wallet-service/src/lib/server.ts

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { IWallet, Wallet } from './model/wallet';
1515
import { Storage } from './storage';
1616

1717
const $ = require('preconditions').singleton();
18+
var deprecatedServerMessage = require('../deprecated-serverMessages');
1819
var serverMessages = require('../serverMessages');
1920
var BCHAddressTranslator = require('./bchaddresstranslator');
2021

@@ -215,7 +216,7 @@ export class WalletService {
215216
}
216217

217218
static handleIncomingNotifications(notification, cb) {
218-
cb = cb || function() {};
219+
cb = cb || function() { };
219220

220221
// do nothing here....
221222
// bc height cache is cleared on bcmonitor
@@ -695,6 +696,8 @@ export class WalletService {
695696
}
696697
status.wallet = wallet;
697698

699+
status.serverMessage = deprecatedServerMessage(wallet, self.appName, self.appVersion);
700+
698701
status.serverMessage = serverMessages(
699702
wallet,
700703
self.appName,
@@ -798,7 +801,7 @@ export class WalletService {
798801

799802
// self.logi('Notification', type);
800803

801-
cb = cb || function() {};
804+
cb = cb || function() { };
802805

803806
var walletId = self.walletId || data.walletId;
804807
var copayerId = self.copayerId || data.copayerId;
@@ -1791,7 +1794,7 @@ export class WalletService {
17911794
return cb(
17921795
new ClientError(
17931796
'Invalid fee level. Valid values are ' +
1794-
_.map(feeLevels, 'name').join(', ')
1797+
_.map(feeLevels, 'name').join(', ')
17951798
)
17961799
);
17971800
}
@@ -1915,10 +1918,10 @@ export class WalletService {
19151918
var logger = network == 'livenet' ? self.logw : self.logi;
19161919
logger(
19171920
'Could not compute fee estimation in ' +
1918-
network +
1919-
': ' +
1920-
failed.join(', ') +
1921-
' blocks.'
1921+
network +
1922+
': ' +
1923+
failed.join(', ') +
1924+
' blocks.'
19221925
);
19231926
}
19241927

@@ -2142,20 +2145,20 @@ export class WalletService {
21422145
if (totalValueInUtxos < txpAmount) {
21432146
self.logi(
21442147
'Total value in all utxos (' +
2145-
Utils.formatAmountInBtc(totalValueInUtxos) +
2146-
') is insufficient to cover for txp amount (' +
2147-
Utils.formatAmountInBtc(txpAmount) +
2148-
')'
2148+
Utils.formatAmountInBtc(totalValueInUtxos) +
2149+
') is insufficient to cover for txp amount (' +
2150+
Utils.formatAmountInBtc(txpAmount) +
2151+
')'
21492152
);
21502153
return cb(Errors.INSUFFICIENT_FUNDS);
21512154
}
21522155
if (netValueInUtxos < txpAmount) {
21532156
self.logi(
21542157
'Value after fees in all utxos (' +
2155-
Utils.formatAmountInBtc(netValueInUtxos) +
2156-
') is insufficient to cover for txp amount (' +
2157-
Utils.formatAmountInBtc(txpAmount) +
2158-
')'
2158+
Utils.formatAmountInBtc(netValueInUtxos) +
2159+
') is insufficient to cover for txp amount (' +
2160+
Utils.formatAmountInBtc(txpAmount) +
2161+
')'
21592162
);
21602163
return cb(Errors.INSUFFICIENT_FUNDS_FOR_FEE);
21612164
}
@@ -2373,9 +2376,9 @@ export class WalletService {
23732376
txp.fee;
23742377
self.logi(
23752378
'Successfully built transaction. Total fees: ' +
2376-
Utils.formatAmountInBtc(txp.fee) +
2377-
', total change: ' +
2378-
Utils.formatAmountInBtc(change)
2379+
Utils.formatAmountInBtc(txp.fee) +
2380+
', total change: ' +
2381+
Utils.formatAmountInBtc(change)
23792382
);
23802383
} else {
23812384
self.logw('Error building transaction', err);
@@ -2514,7 +2517,7 @@ export class WalletService {
25142517
return next(
25152518
new ClientError(
25162519
'Invalid fee level. Valid values are ' +
2517-
_.map(feeLevels, 'name').join(', ')
2520+
_.map(feeLevels, 'name').join(', ')
25182521
)
25192522
);
25202523
}

0 commit comments

Comments
 (0)