paypro: drop old tx code.

This commit is contained in:
Christopher Jeffrey 2014-08-05 17:02:14 -07:00 committed by Manuel Araoz
parent 093fd68c78
commit ac32f56afa
2 changed files with 0 additions and 118 deletions

View File

@ -1161,56 +1161,10 @@ Wallet.prototype.createPaymentTxSync = function(options, merchantData, unspent)
merchantData.total = merchantData.total.toString(10);
/*
var outs = [];
merchantData.pr.pd.outputs.forEach(function(output) {
outs.push({
address: self.getAddressesStr()[0]
|| '2N6J45pqfu5y7zgWDwXDAmdd8qzK1oRdz3A', // dummy address
amountSatStr: '0' // dummy amount
});
});
*/
var b = new Builder(opts)
.setUnspent(unspent)
.setOutputs(outs);
/*
merchantData.total = bignum(merchantData.total, 10);
merchantData.pr.pd.outputs.forEach(function(output, i) {
var amount = output.amount;
var script = {
offset: output.script.offset,
limit: output.script.limit,
buffer: new Buffer(output.script.buffer, 'hex')
};
var v = new Buffer(8);
v[0] = (amount.low >> 0) & 0xff;
v[1] = (amount.low >> 8) & 0xff;
v[2] = (amount.low >> 16) & 0xff;
v[3] = (amount.low >> 24) & 0xff;
v[4] = (amount.high >> 0) & 0xff;
v[5] = (amount.high >> 8) & 0xff;
v[6] = (amount.high >> 16) & 0xff;
v[7] = (amount.high >> 24) & 0xff;
var s = script.buffer.slice(script.offset, script.limit);
b.tx.outs[i].v = v;
b.tx.outs[i].s = s;
merchantData.total = merchantData.total.add(bignum.fromBuffer(v, {
endian: 'little',
size: 1
}));
});
merchantData.total = merchantData.total.toString(10);
*/
var selectedUtxos = b.getSelectedUnspent();
var inputChainPaths = selectedUtxos.map(function(utxo) {
return pkr.pathForAddress(utxo.address);

View File

@ -266,46 +266,10 @@ describe('PayPro (in Wallet) model', function() {
});
});
/*
var outs = [];
outputs.forEach(function(output) {
outs.push({
address: w.getAddressesStr()[0] || '2N6J45pqfu5y7zgWDwXDAmdd8qzK1oRdz3A',
amountSatStr: '0'
});
});
*/
var b = new bitcore.TransactionBuilder(opts)
.setUnspent(unspentTest)
.setOutputs(outs);
/*
outputs.forEach(function(output, i) {
var amount = output.get('amount');
var script = {
offset: output.get('script').offset,
limit: output.get('script').limit,
buffer: output.get('script').buffer
};
var v = new Buffer(8);
v[0] = (amount.low >> 0) & 0xff;
v[1] = (amount.low >> 8) & 0xff;
v[2] = (amount.low >> 16) & 0xff;
v[3] = (amount.low >> 24) & 0xff;
v[4] = (amount.high >> 0) & 0xff;
v[5] = (amount.high >> 8) & 0xff;
v[6] = (amount.high >> 16) & 0xff;
v[7] = (amount.high >> 24) & 0xff;
var s = script.buffer.slice(script.offset, script.limit);
b.tx.outs[i].v = v;
b.tx.outs[i].s = s;
});
*/
var selectedUtxos = b.getSelectedUnspent();
var inputChainPaths = selectedUtxos.map(function(utxo) {
return pkr.pathForAddress(utxo.address);
@ -528,46 +492,10 @@ describe('PayPro (in Wallet) model', function() {
});
});
/*
var outs = [];
outputs.forEach(function(output) {
outs.push({
address: w.getAddressesStr()[0] || '2N6J45pqfu5y7zgWDwXDAmdd8qzK1oRdz3A',
amountSatStr: '0'
});
});
*/
var b = new bitcore.TransactionBuilder(opts)
.setUnspent(unspentTest)
.setOutputs(outs);
/*
outputs.forEach(function(output, i) {
var amount = output.get('amount');
var script = {
offset: output.get('script').offset,
limit: output.get('script').limit,
buffer: output.get('script').buffer
};
var v = new Buffer(8);
v[0] = (amount.low >> 0) & 0xff;
v[1] = (amount.low >> 8) & 0xff;
v[2] = (amount.low >> 16) & 0xff;
v[3] = (amount.low >> 24) & 0xff;
v[4] = (amount.high >> 0) & 0xff;
v[5] = (amount.high >> 8) & 0xff;
v[6] = (amount.high >> 16) & 0xff;
v[7] = (amount.high >> 24) & 0xff;
var s = script.buffer.slice(script.offset, script.limit);
b.tx.outs[i].v = v;
b.tx.outs[i].s = s;
});
*/
var selectedUtxos = b.getSelectedUnspent();
var inputChainPaths = selectedUtxos.map(function(utxo) {
return pkr.pathForAddress(utxo.address);