witness json.
This commit is contained in:
parent
c2baa09b1f
commit
0104aae9c0
@ -263,9 +263,7 @@ Input.prototype.toJSON = function toJSON() {
|
||||
},
|
||||
output: this.output ? this.output.toJSON() : null,
|
||||
script: utils.toHex(bcoin.script.encode(this.script)),
|
||||
witness: this.witness.map(function(chunk) {
|
||||
return utils.toHex(chunk);
|
||||
}),
|
||||
witness: utils.toHex(bcoin.protocol.framer.witness(this.witness)),
|
||||
sequence: this.sequence
|
||||
};
|
||||
};
|
||||
@ -278,9 +276,7 @@ Input._fromJSON = function _fromJSON(json) {
|
||||
},
|
||||
output: json.output ? bcoin.coin._fromJSON(json.output) : null,
|
||||
script: bcoin.script.decode(new Buffer(json.script, 'hex')),
|
||||
witness: json.witness.map(function(chunk) {
|
||||
return new Buffer(chunk, 'hex');
|
||||
}),
|
||||
witness: bcoin.protocol.parser.parseWitness(new Buffer(json.witness, 'hex')),
|
||||
sequence: json.sequence
|
||||
};
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user