paypro: reorganize createPaymentTxSync.
This commit is contained in:
parent
5f20b09b0b
commit
18d1e4f6e7
2 changed files with 36 additions and 36 deletions
|
|
@ -246,18 +246,6 @@ describe('PayPro (in Wallet) model', function() {
|
|||
.setUnspent(unspentTest)
|
||||
.setOutputs(outs);
|
||||
|
||||
var selectedUtxos = b.getSelectedUnspent();
|
||||
var inputChainPaths = selectedUtxos.map(function(utxo) {
|
||||
return pkr.pathForAddress(utxo.address);
|
||||
});
|
||||
|
||||
b = b.setHashToScriptMap(pkr.getRedeemScriptMap(inputChainPaths));
|
||||
|
||||
if (priv) {
|
||||
var keys = priv.getForPaths(inputChainPaths);
|
||||
var signed = b.sign(keys);
|
||||
}
|
||||
|
||||
outputs.forEach(function(output, i) {
|
||||
var amount = output.get('amount');
|
||||
var script = {
|
||||
|
|
@ -282,6 +270,18 @@ describe('PayPro (in Wallet) model', function() {
|
|||
b.tx.outs[i].s = s;
|
||||
});
|
||||
|
||||
var selectedUtxos = b.getSelectedUnspent();
|
||||
var inputChainPaths = selectedUtxos.map(function(utxo) {
|
||||
return pkr.pathForAddress(utxo.address);
|
||||
});
|
||||
|
||||
b = b.setHashToScriptMap(pkr.getRedeemScriptMap(inputChainPaths));
|
||||
|
||||
if (priv) {
|
||||
var keys = priv.getForPaths(inputChainPaths);
|
||||
var signed = b.sign(keys);
|
||||
}
|
||||
|
||||
var tx = b.build();
|
||||
|
||||
var refund_outputs = [];
|
||||
|
|
@ -472,18 +472,6 @@ describe('PayPro (in Wallet) model', function() {
|
|||
.setUnspent(unspentTest)
|
||||
.setOutputs(outs);
|
||||
|
||||
var selectedUtxos = b.getSelectedUnspent();
|
||||
var inputChainPaths = selectedUtxos.map(function(utxo) {
|
||||
return pkr.pathForAddress(utxo.address);
|
||||
});
|
||||
|
||||
b = b.setHashToScriptMap(pkr.getRedeemScriptMap(inputChainPaths));
|
||||
|
||||
if (priv) {
|
||||
var keys = priv.getForPaths(inputChainPaths);
|
||||
var signed = b.sign(keys);
|
||||
}
|
||||
|
||||
outputs.forEach(function(output, i) {
|
||||
var amount = output.get('amount');
|
||||
var script = {
|
||||
|
|
@ -508,6 +496,18 @@ describe('PayPro (in Wallet) model', function() {
|
|||
b.tx.outs[i].s = s;
|
||||
});
|
||||
|
||||
var selectedUtxos = b.getSelectedUnspent();
|
||||
var inputChainPaths = selectedUtxos.map(function(utxo) {
|
||||
return pkr.pathForAddress(utxo.address);
|
||||
});
|
||||
|
||||
b = b.setHashToScriptMap(pkr.getRedeemScriptMap(inputChainPaths));
|
||||
|
||||
if (priv) {
|
||||
var keys = priv.getForPaths(inputChainPaths);
|
||||
var signed = b.sign(keys);
|
||||
}
|
||||
|
||||
var tx = b.build();
|
||||
|
||||
var refund_outputs = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue