Serialize now returns a buffer
This commit is contained in:
parent
d17f85f5a6
commit
10ee5532c3
3 changed files with 32 additions and 19 deletions
src
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue