File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,15 @@ describe('script', function () {
4545 fixtures . valid . forEach ( function ( f ) {
4646 it ( 'returns ' + ! ! f . stack + ' for ' + f . asm , function ( ) {
4747 var script = bscript . fromASM ( f . asm )
48- var chunks = bscript . decompile ( script )
4948
50- try {
51- var stack = bscript . toStack ( chunks ) . map ( function ( x ) { return x . toString ( 'hex' ) } )
52- assert . deepEqual ( stack , f . stack )
53- } catch ( e ) {
54- assert . strictEqual ( f . stack , undefined )
49+ if ( f . stack && f . asm ) {
50+ try {
51+ var stack = bscript . toStack ( script )
52+ assert . deepEqual ( stack . map ( function ( x ) { return x . toString ( 'hex' ) } ) , f . stack )
53+ assert . equal ( bscript . toASM ( bscript . compile ( stack ) ) , f . asm , 'should rebuild same script from stack' )
54+ } catch ( e ) {
55+ assert . strictEqual ( f . stack , undefined )
56+ }
5557 }
5658 } )
5759 } )
You can’t perform that action at this time.
0 commit comments