From d51c1c552f7bcf203a9287227918f36dc2050206 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 5 Aug 2014 18:12:26 -0700 Subject: [PATCH] paypro: potentially use verbatim scripts after setting outputs. --- js/models/core/Wallet.js | 10 ++++++++++ test/test.PayPro.js | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 73fb086a6..86ada9890 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -1165,6 +1165,16 @@ Wallet.prototype.createPaymentTxSync = function(options, merchantData, unspent) .setUnspent(unspent) .setOutputs(outs); + // merchantData.pr.pd.outputs.forEach(function(output, i) { + // var script = { + // offset: output.script.offset, + // limit: output.script.limit, + // buffer: new Buffer(output.script.buffer, 'hex') + // }; + // var s = script.buffer.slice(script.offset, script.limit); + // b.tx.outs[i].s = s; + // }); + var selectedUtxos = b.getSelectedUnspent(); var inputChainPaths = selectedUtxos.map(function(utxo) { return pkr.pathForAddress(utxo.address); diff --git a/test/test.PayPro.js b/test/test.PayPro.js index a5e9186cb..d78ed883c 100644 --- a/test/test.PayPro.js +++ b/test/test.PayPro.js @@ -270,6 +270,16 @@ describe('PayPro (in Wallet) model', function() { .setUnspent(unspentTest) .setOutputs(outs); + // outputs.forEach(function(output, i) { + // var script = { + // offset: output.get('script').offset, + // limit: output.get('script').limit, + // buffer: output.get('script').buffer + // }; + // var s = script.buffer.slice(script.offset, script.limit); + // b.tx.outs[i].s = s; + // }); + var selectedUtxos = b.getSelectedUnspent(); var inputChainPaths = selectedUtxos.map(function(utxo) { return pkr.pathForAddress(utxo.address); @@ -496,6 +506,16 @@ describe('PayPro (in Wallet) model', function() { .setUnspent(unspentTest) .setOutputs(outs); + // outputs.forEach(function(output, i) { + // var script = { + // offset: output.get('script').offset, + // limit: output.get('script').limit, + // buffer: output.get('script').buffer + // }; + // var s = script.buffer.slice(script.offset, script.limit); + // b.tx.outs[i].s = s; + // }); + var selectedUtxos = b.getSelectedUnspent(); var inputChainPaths = selectedUtxos.map(function(utxo) { return pkr.pathForAddress(utxo.address);