fix tests
This commit is contained in:
parent
ddbfcbe7f5
commit
c3f6442901
|
@ -940,8 +940,6 @@ describe('Copay server', function() {
|
||||||
it('should sign and broadcast a tx', function(done) {
|
it('should sign and broadcast a tx', function(done) {
|
||||||
helpers.stubBlockExplorer(server, utxos, '1122334455');
|
helpers.stubBlockExplorer(server, utxos, '1122334455');
|
||||||
var txOpts = {
|
var txOpts = {
|
||||||
copayerId: '1',
|
|
||||||
walletId: '123',
|
|
||||||
toAddress: '18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7',
|
toAddress: '18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7',
|
||||||
amount: helpers.toSatoshi(10),
|
amount: helpers.toSatoshi(10),
|
||||||
message: 'some message',
|
message: 'some message',
|
||||||
|
@ -953,15 +951,11 @@ describe('Copay server', function() {
|
||||||
txp.should.exist;
|
txp.should.exist;
|
||||||
var txpid = txp.id;
|
var txpid = txp.id;
|
||||||
|
|
||||||
server.getPendingTxs({
|
server.getPendingTxs({}, function(err, txps) {
|
||||||
walletId: '123'
|
|
||||||
}, function(err, txps) {
|
|
||||||
var txp = txps[0];
|
var txp = txps[0];
|
||||||
txp.id.should.equal(txpid);
|
txp.id.should.equal(txpid);
|
||||||
var signatures = helpers.clientSign(txp, someXPrivKey[0], wallet.n);
|
var signatures = helpers.clientSign(txp, someXPrivKey[0], wallet.n);
|
||||||
server.signTx({
|
server.signTx({
|
||||||
walletId: '123',
|
|
||||||
copayerId: '1',
|
|
||||||
txProposalId: txpid,
|
txProposalId: txpid,
|
||||||
signatures: signatures,
|
signatures: signatures,
|
||||||
}, function(err, txp) {
|
}, function(err, txp) {
|
||||||
|
@ -979,8 +973,6 @@ describe('Copay server', function() {
|
||||||
|
|
||||||
helpers.stubBlockExplorer(server, utxos);
|
helpers.stubBlockExplorer(server, utxos);
|
||||||
var txOpts = {
|
var txOpts = {
|
||||||
copayerId: '1',
|
|
||||||
walletId: '123',
|
|
||||||
toAddress: '18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7',
|
toAddress: '18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7',
|
||||||
amount: helpers.toSatoshi(10),
|
amount: helpers.toSatoshi(10),
|
||||||
message: 'some message',
|
message: 'some message',
|
||||||
|
@ -992,9 +984,7 @@ describe('Copay server', function() {
|
||||||
txp.should.exist;
|
txp.should.exist;
|
||||||
var txpid = txp.id;
|
var txpid = txp.id;
|
||||||
|
|
||||||
server.getPendingTxs({
|
server.getPendingTxs({}, function(err, txps) {
|
||||||
walletId: '123'
|
|
||||||
}, function(err, txps) {
|
|
||||||
var txp = txps[0];
|
var txp = txps[0];
|
||||||
txp.id.should.equal(txpid);
|
txp.id.should.equal(txpid);
|
||||||
var signatures = helpers.clientSign(txp, someXPrivKey[0], wallet.n);
|
var signatures = helpers.clientSign(txp, someXPrivKey[0], wallet.n);
|
||||||
|
@ -1003,6 +993,11 @@ describe('Copay server', function() {
|
||||||
signatures: signatures,
|
signatures: signatures,
|
||||||
}, function(err, txp) {
|
}, function(err, txp) {
|
||||||
err.should.contain('broadcast');
|
err.should.contain('broadcast');
|
||||||
|
|
||||||
|
server.getPendingTxs({}, function(err, txps) {
|
||||||
|
should.not.exist(err);
|
||||||
|
txps.length.should.equal(0);
|
||||||
|
server.getTx({ id: txpid }, function (err, txp) {
|
||||||
txp.status.should.equal('accepted');
|
txp.status.should.equal('accepted');
|
||||||
should.not.exist(txp.txid);
|
should.not.exist(txp.txid);
|
||||||
done();
|
done();
|
||||||
|
@ -1011,4 +1006,6 @@ describe('Copay server', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue