mirror of https://github.com/BTCPrivate/copay.git
Bug fixes - ledger testing
This commit is contained in:
parent
c0e90ac21a
commit
413990f94c
|
@ -183,7 +183,7 @@ angular.module('copayApp.controllers').controller('createController',
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
src.getInfoForNewWallet(opts, function(err, lopts) {
|
src.getInfoForNewWallet(opts.n > 1, account, function(err, lopts) {
|
||||||
ongoingProcess.set('connecting' + $scope.seedSource.id, false);
|
ongoingProcess.set('connecting' + $scope.seedSource.id, false);
|
||||||
if (err) {
|
if (err) {
|
||||||
popupService.showAlert(gettextCatalog.getString('Error'), err);
|
popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||||
|
|
|
@ -35,7 +35,7 @@ angular.module('copayApp.controllers').controller('importController',
|
||||||
if ($scope.isChromeApp || $scope.isDevel) {
|
if ($scope.isChromeApp || $scope.isDevel) {
|
||||||
$scope.seedOptions.push({
|
$scope.seedOptions.push({
|
||||||
id: walletService.externalSource.trezor.id,
|
id: walletService.externalSource.trezor.id,
|
||||||
label: walletService.externalSource.ledger.longName,
|
label: walletService.externalSource.trezor.longName,
|
||||||
});
|
});
|
||||||
$scope.formData.seedSource = $scope.seedOptions[0];
|
$scope.formData.seedSource = $scope.seedOptions[0];
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,6 +138,7 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
account = account - 1;
|
account = account - 1;
|
||||||
|
|
||||||
opts.account = account;
|
opts.account = account;
|
||||||
|
opts.isMultisig = true;
|
||||||
ongoingProcess.set('connecting' + self.seedSourceId, true);
|
ongoingProcess.set('connecting' + self.seedSourceId, true);
|
||||||
var src = self.seedSourceId == walletService.externalSource.ledger.id ? ledger : trezor;
|
var src = self.seedSourceId == walletService.externalSource.ledger.id ? ledger : trezor;
|
||||||
|
|
||||||
|
|
|
@ -8,20 +8,22 @@ angular.module('copayApp.controllers').controller('preferencesExternalController
|
||||||
return source.id == wallet.getPrivKeyExternalSourceName();
|
return source.id == wallet.getPrivKeyExternalSourceName();
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.hardwareConnected = $scope.externalSource.version.length > 0;
|
if ($scope.externalSource.hasEmbeddedHardware) {
|
||||||
|
$scope.hardwareConnected = $scope.externalSource.version.length > 0;
|
||||||
|
|
||||||
$scope.showMneumonicFromHardwarePopup = function() {
|
$scope.showMneumonicFromHardwarePopup = function() {
|
||||||
var title = gettextCatalog.getString('Warning!');
|
var title = gettextCatalog.getString('Warning!');
|
||||||
var message = gettextCatalog.getString('Are you being watched? Anyone with your recovery phrase can access or spend your bitcoin.');
|
var message = gettextCatalog.getString('Are you being watched? Anyone with your recovery phrase can access or spend your bitcoin.');
|
||||||
popupService.showConfirm(title, message, null, null, function(res) {
|
popupService.showConfirm(title, message, null, null, function(res) {
|
||||||
if (res) {
|
if (res) {
|
||||||
walletService.showMneumonicFromHardware(wallet, function(err) {
|
walletService.showMneumonicFromHardware(wallet, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
popupService.showAlert(gettextCatalog.getString('Error'), err.message || err);
|
popupService.showAlert(gettextCatalog.getString('Error'), err.message || err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
|
@ -11,7 +11,8 @@ angular.module('copayApp.services')
|
||||||
id: 'intelTEE',
|
id: 'intelTEE',
|
||||||
name: 'Intel TEE',
|
name: 'Intel TEE',
|
||||||
longName: 'Intel TEE Hardware Wallet',
|
longName: 'Intel TEE Hardware Wallet',
|
||||||
derivationStrategy: 'BIP44'
|
derivationStrategy: 'BIP44',
|
||||||
|
hasEmbeddedHardware: true
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!root.description.supported) {
|
if (!root.description.supported) {
|
||||||
|
@ -27,16 +28,16 @@ angular.module('copayApp.services')
|
||||||
$log.error('Failed to create Intel Wallet enclave');
|
$log.error('Failed to create Intel Wallet enclave');
|
||||||
}
|
}
|
||||||
|
|
||||||
root.getInfoForNewWallet = function(opts, callback) {
|
root.getInfoForNewWallet = function(isMultisig, account, callback) {
|
||||||
|
var opts = {};
|
||||||
initSource(opts, function(err, opts) {
|
initSource(opts, function(err, opts) {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
|
|
||||||
var isMultisig = opts.n > 1;
|
root.getEntropySource(opts.hwInfo.id, isMultisig, account, function(err, entropySource) {
|
||||||
root.getEntropySource(opts.hwInfo.id, isMultisig, opts.account, function(err, entropySource) {
|
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
|
|
||||||
opts.entropySource = entropySource;
|
opts.entropySource = entropySource;
|
||||||
root.getXPubKey(opts.hwInfo.id, hwWallet.getAddressPath(root.description.id, isMultisig, opts.account, opts.networkName), function(data) {
|
root.getXPubKey(opts.hwInfo.id, hwWallet.getAddressPath(root.description.id, isMultisig, account, opts.networkName), function(data) {
|
||||||
if (!data.success) {
|
if (!data.success) {
|
||||||
$log.warn(data.message);
|
$log.warn(data.message);
|
||||||
return callback(data);
|
return callback(data);
|
||||||
|
|
|
@ -9,7 +9,8 @@ angular.module('copayApp.services')
|
||||||
supported: platformInfo.supportsLedger,
|
supported: platformInfo.supportsLedger,
|
||||||
id: 'ledger',
|
id: 'ledger',
|
||||||
name: 'Ledger',
|
name: 'Ledger',
|
||||||
longName: 'Ledger Hardware Wallet'
|
longName: 'Ledger Hardware Wallet',
|
||||||
|
hasEmbeddedHardware: false
|
||||||
};
|
};
|
||||||
|
|
||||||
root.callbacks = {};
|
root.callbacks = {};
|
||||||
|
@ -42,13 +43,13 @@ angular.module('copayApp.services')
|
||||||
return callback(opts);
|
return callback(opts);
|
||||||
};
|
};
|
||||||
|
|
||||||
root.getInfoForNewWallet = function(opts, callback) {
|
root.getInfoForNewWallet = function(isMultisig, account, callback) {
|
||||||
var isMultisig = opts.n > 1;
|
root.getEntropySource(isMultisig, account, function(err, entropySource) {
|
||||||
root.getEntropySource(isMultisig, opts.account, function(err, entropySource) {
|
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
|
|
||||||
|
var opts = {};
|
||||||
opts.entropySource = entropySource;
|
opts.entropySource = entropySource;
|
||||||
root.getXPubKey(hwWallet.getAddressPath(root.description.id, isMultisig, opts.account), function(data) {
|
root.getXPubKey(hwWallet.getAddressPath(root.description.id, isMultisig, account), function(data) {
|
||||||
if (!data.success) {
|
if (!data.success) {
|
||||||
$log.warn(data.message);
|
$log.warn(data.message);
|
||||||
return callback(data);
|
return callback(data);
|
||||||
|
|
|
@ -12,7 +12,8 @@ angular.module('copayApp.services')
|
||||||
id: 'trezor',
|
id: 'trezor',
|
||||||
name: 'Trezor',
|
name: 'Trezor',
|
||||||
longName: 'Trezor Hardware Wallet',
|
longName: 'Trezor Hardware Wallet',
|
||||||
derivationStrategy: 'BIP48'
|
derivationStrategy: 'BIP48',
|
||||||
|
hasEmbeddedHardware: false
|
||||||
};
|
};
|
||||||
|
|
||||||
root.getEntropySource = function(isMultisig, account, callback) {
|
root.getEntropySource = function(isMultisig, account, callback) {
|
||||||
|
@ -39,15 +40,15 @@ angular.module('copayApp.services')
|
||||||
return callback(opts);
|
return callback(opts);
|
||||||
};
|
};
|
||||||
|
|
||||||
root.getInfoForNewWallet = function(opts, callback) {
|
root.getInfoForNewWallet = function(isMultisig, account, callback) {
|
||||||
var isMultisig = opts.n > 1;
|
var opts = {};
|
||||||
root.getEntropySource(isMultisig, opts.account, function(err, data) {
|
root.getEntropySource(isMultisig, account, function(err, data) {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
opts.entropySource = data;
|
opts.entropySource = data;
|
||||||
$log.debug('Waiting TREZOR to settle...');
|
$log.debug('Waiting TREZOR to settle...');
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
|
||||||
root.getXPubKey(hwWallet.getAddressPath(root.description.id, isMultisig, opts.account), function(data) {
|
root.getXPubKey(hwWallet.getAddressPath(root.description.id, isMultisig, account), function(data) {
|
||||||
if (!data.success)
|
if (!data.success)
|
||||||
return callback(hwWallet._err(data));
|
return callback(hwWallet._err(data));
|
||||||
|
|
||||||
|
|
|
@ -4,16 +4,11 @@
|
||||||
<div>
|
<div>
|
||||||
<span ng-show="wallet.status.wallet.singleAddress" class="size-12"><span translate>Auditable</span></span>
|
<span ng-show="wallet.status.wallet.singleAddress" class="size-12"><span translate>Auditable</span></span>
|
||||||
<img style="height:0.6em; margin-right: 1px;" ng-show="wallet.network != 'livenet'" src="img/icon-testnet-white.svg">
|
<img style="height:0.6em; margin-right: 1px;" ng-show="wallet.network != 'livenet'" src="img/icon-testnet-white.svg">
|
||||||
<img style="height:0.6em; margin-right: 1px;" ng-show="wallet.getPrivKeyExternalSourceName() == 'trezor'"
|
<img style="height:0.6em; margin-right: 1px;" ng-show="!wallet.canSign() && !wallet.isPrivKeyExternal()" src="img/icon-read-only-white.svg">
|
||||||
src="img/icon-trezor-white.svg">
|
|
||||||
<img style="height:0.6em; margin-right: 1px;" ng-show="wallet.getPrivKeyExternalSourceName() == 'ledger'"
|
|
||||||
src="img/icon-ledger-white.svg">
|
|
||||||
<img style="height:0.6em; margin-right: 1px;" ng-show="wallet.getPrivKeyExternalSourceName() == 'intelTEE'"
|
|
||||||
src="img/icon-inteltee-white.svg">
|
|
||||||
<span class="size-12 dib" style="height:0.6em; margin-right: 1px;" ng-show="wallet.account">#{{wallet.account || 0}} </span>
|
|
||||||
|
|
||||||
<img style="height:0.6em; margin-right: 1px;" ng-show="wallet.getPrivKeyExternalSourceName() == 'trezor'" src="img/icon-trezor-white.svg">
|
<img style="height:0.6em; margin-right: 1px;" ng-show="wallet.getPrivKeyExternalSourceName() == 'trezor'" src="img/icon-trezor-white.svg">
|
||||||
<img style="height:0.6em; margin-right: 1px;" ng-show="wallet.getPrivKeyExternalSourceName() == 'ledger'" src="img/icon-ledger-white.svg">
|
<img style="height:0.6em; margin-right: 1px;" ng-show="wallet.getPrivKeyExternalSourceName() == 'ledger'" src="img/icon-ledger-white.svg">
|
||||||
|
<img style="height:0.6em; margin-right: 1px;" ng-show="wallet.getPrivKeyExternalSourceName() == 'intelTEE'" src="img/icon-inteltee-white.svg">
|
||||||
<span ng-show="wallet.credentials.n > 1" class="size-12"><span translate>{{wallet.m}}-of-{{wallet.n}}</span></span>
|
<span ng-show="wallet.credentials.n > 1" class="size-12"><span translate>{{wallet.m}}-of-{{wallet.n}}</span></span>
|
||||||
<span class="size-12 dib" style="height:0.6em; margin-right: 1px;" ng-show="wallet.credentials.account">#{{wallet.credentials.account || 0}} </span>
|
<span class="size-12 dib" style="height:0.6em; margin-right: 1px;" ng-show="wallet.credentials.account">#{{wallet.credentials.account || 0}} </span>
|
||||||
|
|
||||||
|
|
|
@ -6,26 +6,36 @@
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<div ng-include="'views/includes/walletItem.html'"></div>
|
<div ng-include="'views/includes/walletItem.html'"></div>
|
||||||
<div ng-if="!hardwareConnected" class="warning centered">
|
|
||||||
<span translate>Hardware not connected.</span><br>
|
<div ng-if="!hasEmbeddedHardware">
|
||||||
<span translate>Check installation and retry.</span>
|
<div ng-if="!hardwareConnected" class="info centered">
|
||||||
|
<span translate>No hardware information available.</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-if="hardwareConnected">
|
<div ng-if="hasEmbeddedHardware">
|
||||||
<div class="list">
|
<div ng-if="!hardwareConnected" class="warning centered">
|
||||||
<div class="item">
|
<span translate>Hardware not connected.</span><br>
|
||||||
<span translate>Version</span>
|
<span translate>Check installation and retry.</span>
|
||||||
<span class="item-note">
|
</div>
|
||||||
{{externalSource.version || 'hardware disconnected'}}
|
|
||||||
</span>
|
<div ng-if="hardwareConnected">
|
||||||
|
<div class="list">
|
||||||
|
<div class="item">
|
||||||
|
<span translate>Version</span>
|
||||||
|
<span class="item-note">
|
||||||
|
{{externalSource.version || 'hardware disconnected'}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="padding">
|
||||||
|
<button class="button button-standard button-assertive" ng-click="showMneumonicFromHardwarePopup()">
|
||||||
|
{{'Show Recovery Phrase'|translate}}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="padding">
|
|
||||||
<button class="button button-standard button-assertive" ng-click="showMneumonicFromHardwarePopup()">
|
|
||||||
{{'Show Recovery Phrase'|translate}}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
</ion-view>
|
</ion-view>
|
||||||
|
|
Loading…
Reference in New Issue