bip70: refactor deps.
This commit is contained in:
parent
323d5fb8a4
commit
24b92a2b58
@ -6,10 +6,12 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var bcoin = require('../env');
|
||||
var assert = require('assert');
|
||||
var utils = bcoin.utils;
|
||||
var utils = require('../utils/utils');
|
||||
var crypto = require('../crypto/crypto');
|
||||
var Output = require('../primitives/output');
|
||||
var TX = require('../primitives/tx');
|
||||
var Script = require('../script/script');
|
||||
var x509 = require('./x509');
|
||||
var asn1 = require('./asn1');
|
||||
var protobuf = require('./protobuf');
|
||||
@ -276,7 +278,7 @@ PaymentDetails.prototype.fromOptions = function fromOptions(options) {
|
||||
if (options.outputs) {
|
||||
assert(Array.isArray(options.outputs));
|
||||
for (i = 0; i < options.outputs.length; i++) {
|
||||
output = new bcoin.output(options.outputs[i]);
|
||||
output = new Output(options.outputs[i]);
|
||||
this.outputs.push(output);
|
||||
}
|
||||
}
|
||||
@ -362,7 +364,7 @@ PaymentDetails.prototype.fromRaw = function fromRaw(data) {
|
||||
|
||||
while (p.nextTag() === 2) {
|
||||
op = new ProtoReader(p.readFieldBytes(2));
|
||||
output = new bcoin.output();
|
||||
output = new Output();
|
||||
output.value = op.readFieldU64(1, true);
|
||||
output.script.fromRaw(op.readFieldBytes(2, true));
|
||||
this.outputs.push(output);
|
||||
@ -440,7 +442,7 @@ Payment.prototype.fromOptions = function fromOptions(options) {
|
||||
if (options.transactions) {
|
||||
assert(Array.isArray(options.transactions));
|
||||
for (i = 0; i < options.transactions.length; i++) {
|
||||
tx = new bcoin.tx(options.transactions[i]);
|
||||
tx = new TX(options.transactions[i]);
|
||||
this.transactions.push(tx);
|
||||
}
|
||||
}
|
||||
@ -448,7 +450,7 @@ Payment.prototype.fromOptions = function fromOptions(options) {
|
||||
if (options.refundTo) {
|
||||
assert(Array.isArray(options.refundTo));
|
||||
for (i = 0; i < options.refundTo.length; i++) {
|
||||
output = new bcoin.output(options.refundTo[i]);
|
||||
output = new Output(options.refundTo[i]);
|
||||
this.refundTo.push(output);
|
||||
}
|
||||
}
|
||||
@ -475,15 +477,15 @@ Payment.prototype.fromRaw = function fromRaw(data) {
|
||||
this.merchantData = p.readFieldBytes(1, true);
|
||||
|
||||
while (p.nextTag() === 2) {
|
||||
tx = bcoin.tx.fromRaw(p.readFieldBytes(2));
|
||||
tx = TX.fromRaw(p.readFieldBytes(2));
|
||||
this.transactions.push(tx);
|
||||
}
|
||||
|
||||
while (p.nextTag() === 3) {
|
||||
op = new ProtoReader(p.readFieldBytes(3));
|
||||
output = new bcoin.output();
|
||||
output = new Output();
|
||||
output.value = op.readFieldU64(1, true);
|
||||
output.script = bcoin.script.fromRaw(op.readFieldBytes(2, true));
|
||||
output.script = Script.fromRaw(op.readFieldBytes(2, true));
|
||||
this.refundTo.push(output);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user