fix mocha testing!

This commit is contained in:
Matias Alejo Garcia 2014-04-15 18:23:35 -03:00
commit b382e2b99f
10 changed files with 305 additions and 221 deletions

View file

@ -10,13 +10,13 @@ angular.module('copay.home').controller('HomeController',
$location.path('signin');
}
else {
$scope.addrs = $rootScope.wallet.publicKeyRing.getAddresses();
$scope.addrs = $rootScope.wallet.getAddressesStr();
$scope.selectedAddr = $scope.addrs[0];
}
$scope.newAddr = function() {
var a = $rootScope.wallet.generateAddress();
$scope.addrs.push({ addrStr: a.toString('hex') });
$scope.addrs.push({ addrStr: a.toString() });
};
$scope.selectAddr = function(addr) {

View file

@ -16,29 +16,22 @@ angular.module('copay.send').controller('SendController',
var opts = {remainderOut: { address: pkr.generateAddress(true).toString() }};
// From @cmgustavo's wallet
var unspentTest = [{
"txid": "2ac165fa7a3a2b535d106a0041c7568d03b531e58aeccdd3199d7289ab12cfc1",
"vout": 1,
"amount": 10,
"confirmations":7
}];
w.listUnspent(function (unspentTest) {
console.log('[send.js.19:unspentTest:]',unspentTest); //TODO
unspentTest[0].address = pkr.generateAddress(false).toString();
unspentTest[0].scriptPubKey = pkr.getScriptPubKeyHex(false);
console.log('[send.js.29:txp:] BEFORE',txp); //TODO
txp.create(
'15q6HKjWHAksHcH91JW23BJEuzZgFwydBt',
'123456789',
unspentTest,
w.privateKey,
opts
);
txp.create(
'15q6HKjWHAksHcH91JW23BJEuzZgFwydBt',
'123456789',
unspentTest,
w.privateKey,
opts
);
console.log('[send.js.29:txp:] READY:',txp); //TODO
Network.storeOpenWallet();
Network.sendTxProposals();
$rootScope.$digest;
Network.storeOpenWallet();
Network.sendTxProposals();
$rootScope.$digest;
});
};
});