Serialize now returns a buffer

This commit is contained in:
Daniel Cousens 2014-05-02 06:25:57 +10:00
parent d17f85f5a6
commit 10ee5532c3
3 changed files with 32 additions and 19 deletions

View file

@ -13,8 +13,14 @@ function Script(data) {
this.parse()
}
Script.fromHex = function(data) {
return new Script(convert.hexToBytes(data))
Script.fromBuffer = function(buffer) {
// assert(Buffer.isBuffer(buffer)) // FIXME: transitionary
return new Script(Array.prototype.slice.call(buffer))
}
Script.fromHex = function(hex) {
return Script.fromBuffer(new Buffer(hex, 'hex'))
}
Script.fromPubKey = function(str) {