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,
|
output: this.output ? this.output.toJSON() : null,
|
||||||
script: utils.toHex(bcoin.script.encode(this.script)),
|
script: utils.toHex(bcoin.script.encode(this.script)),
|
||||||
witness: this.witness.map(function(chunk) {
|
witness: utils.toHex(bcoin.protocol.framer.witness(this.witness)),
|
||||||
return utils.toHex(chunk);
|
|
||||||
}),
|
|
||||||
sequence: this.sequence
|
sequence: this.sequence
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -278,9 +276,7 @@ Input._fromJSON = function _fromJSON(json) {
|
|||||||
},
|
},
|
||||||
output: json.output ? bcoin.coin._fromJSON(json.output) : null,
|
output: json.output ? bcoin.coin._fromJSON(json.output) : null,
|
||||||
script: bcoin.script.decode(new Buffer(json.script, 'hex')),
|
script: bcoin.script.decode(new Buffer(json.script, 'hex')),
|
||||||
witness: json.witness.map(function(chunk) {
|
witness: bcoin.protocol.parser.parseWitness(new Buffer(json.witness, 'hex')),
|
||||||
return new Buffer(chunk, 'hex');
|
|
||||||
}),
|
|
||||||
sequence: json.sequence
|
sequence: json.sequence
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user