fix #getTx argument

This commit is contained in:
Ivan Socolsky 2015-02-26 10:41:55 -03:00
parent 376d8ad688
commit eabdd4f35a
2 changed files with 11 additions and 11 deletions

View File

@ -569,13 +569,13 @@ WalletService.prototype.createTx = function(opts, cb) {
/**
* Retrieves a tx from storage.
* @param {Object} opts
* @param {string} opts.id - The tx id.
* @param {string} opts.txProposalId - The tx id.
* @returns {Object} txProposal
*/
WalletService.prototype.getTx = function(opts, cb) {
var self = this;
self.storage.fetchTx(self.walletId, opts.id, function(err, txp) {
self.storage.fetchTx(self.walletId, opts.txProposalId, function(err, txp) {
if (err) return cb(err);
if (!txp) return cb(new ClientError('Transaction proposal not found'));
return cb(null, txp);
@ -614,7 +614,7 @@ WalletService.prototype.removePendingTx = function(opts, cb) {
Utils.runLocked(self.walletId, cb, function(cb) {
self.getTx({
id: opts.txProposalId,
txProposalId: opts.txProposalId,
}, function(err, txp) {
if (err) return cb(err);
@ -666,7 +666,7 @@ WalletService.prototype.signTx = function(opts, cb) {
if (err) return cb(err);
self.getTx({
id: opts.txProposalId
txProposalId: opts.txProposalId
}, function(err, txp) {
if (err) return cb(err);
@ -719,7 +719,7 @@ WalletService.prototype.broadcastTx = function(opts, cb) {
if (err) return cb(err);
self.getTx({
id: opts.txProposalId
txProposalId: opts.txProposalId
}, function(err, txp) {
if (err) return cb(err);
@ -761,7 +761,7 @@ WalletService.prototype.rejectTx = function(opts, cb) {
return cb(new ClientError('Required argument missing'));
self.getTx({
id: opts.txProposalId
txProposalId: opts.txProposalId
}, function(err, txp) {
if (err) return cb(err);

View File

@ -993,7 +993,7 @@ describe('Copay server', function() {
should.not.exist(err);
txs.should.be.empty;
server.getTx({
id: txid
txProposalId: txid
}, function(err, tx) {
var actors = tx.getActors();
actors.length.should.equal(1);
@ -1237,7 +1237,7 @@ describe('Copay server', function() {
function(next) {
helpers.getAuthServer(wallet.copayers[2].id, function(server) {
server.getTx({
id: txid
txProposalId: txid
}, function(err, tx) {
should.not.exist(err);
var signatures = helpers.clientSign(tx, TestData.copayers[2].xPrivKey);
@ -1292,7 +1292,7 @@ describe('Copay server', function() {
}, function(err) {
should.not.exist(err);
server.getTx({
id: txpid
txProposalId: txpid
}, function(err, txp) {
should.not.exist(err);
txp.txid.should.equal('999');
@ -1343,7 +1343,7 @@ describe('Copay server', function() {
}, function(err) {
should.exist(err);
server.getTx({
id: txpid
txProposalId: txpid
}, function(err, txp) {
should.not.exist(err);
should.not.exist(txp.txid);
@ -1539,7 +1539,7 @@ describe('Copay server', function() {
},
function(next) {
server.getTx({
id: txpId
txProposalId: txpId
}, function(err, txp) {
should.not.exist(err);
txp.isPending().should.be.false;