Skip to content

Commit

Permalink
fix(Script.encode2): Adding encode2 function to Script class for alte…
Browse files Browse the repository at this point in the history
…rnate compilation rules of Script
  • Loading branch information
christroutner committed Dec 19, 2019
1 parent db7e27f commit 558cf6b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@ export class Script {
return Bitcoin.script.compile(arr)
}

public encode2(scriptChunks: Array<number | Buffer>): Buffer {
const arr: Array<number | Buffer> = []
scriptChunks.forEach((chunk: number | Buffer) => {
arr.push(chunk)
})
return Bitcoin.script.compile2(arr)
}

public decode(scriptBuffer: Buffer): Array<number | Buffer> {
return Bitcoin.script.decompile(scriptBuffer)
}
Expand Down

0 comments on commit 558cf6b

Please sign in to comment.