File tree Expand file tree Collapse file tree 7 files changed +13
-13
lines changed Expand file tree Collapse file tree 7 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
3- exports . REVERSE_OPS = exports . OPS = void 0 ;
3+ exports . OPS = void 0 ;
44// Define OPS enum
55var OPS ;
66( function ( OPS ) {
@@ -123,4 +123,4 @@ var OPS;
123123 OPS [ ( OPS [ 'OP_PUBKEYHASH' ] = 253 ) ] = 'OP_PUBKEYHASH' ;
124124 OPS [ ( OPS [ 'OP_PUBKEY' ] = 254 ) ] = 'OP_PUBKEY' ;
125125 OPS [ ( OPS [ 'OP_INVALIDOPCODE' ] = 255 ) ] = 'OP_INVALIDOPCODE' ;
126- } ) ( OPS || ( exports . REVERSE_OPS = exports . OPS = OPS = { } ) ) ;
126+ } ) ( OPS || ( exports . OPS = OPS = { } ) ) ;
Original file line number Diff line number Diff line change @@ -119,4 +119,4 @@ declare enum OPS {
119119 OP_PUBKEY = 254 ,
120120 OP_INVALIDOPCODE = 255
121121}
122- export { OPS , OPS as REVERSE_OPS } ;
122+ export { OPS } ;
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ function toASM(chunks) {
209209 chunk = op ;
210210 }
211211 // opcode!
212- return ops_js_1 . REVERSE_OPS [ chunk ] ;
212+ return ops_js_1 . OPS [ chunk ] ;
213213 } )
214214 . join ( ' ' ) ;
215215}
@@ -224,7 +224,7 @@ function fromASM(asm) {
224224 return compile (
225225 asm . split ( ' ' ) . map ( chunk => {
226226 // Check if the chunk is an opcode
227- if ( chunk in ops_js_1 . OPS ) {
227+ if ( isNaN ( Number ( chunk ) ) && chunk in ops_js_1 . OPS ) {
228228 return ops_js_1 . OPS [ chunk ] ;
229229 }
230230 // Validate if the chunk is a hexadecimal string
Original file line number Diff line number Diff line change @@ -122,4 +122,4 @@ var OPS;
122122 OPS [ ( OPS [ 'OP_INVALIDOPCODE' ] = 255 ) ] = 'OP_INVALIDOPCODE' ;
123123} ) ( OPS || ( OPS = { } ) ) ;
124124// Export modules
125- export { OPS , OPS as REVERSE_OPS } ;
125+ export { OPS } ;
Original file line number Diff line number Diff line change 33 * @packageDocumentation
44 */
55import * as bip66 from './bip66.js' ;
6- import { OPS , REVERSE_OPS } from './ops.js' ;
6+ import { OPS } from './ops.js' ;
77import * as pushdata from './push_data.js' ;
88import * as scriptNumber from './script_number.js' ;
99import * as scriptSignature from './script_signature.js' ;
@@ -147,7 +147,7 @@ export function toASM(chunks) {
147147 chunk = op ;
148148 }
149149 // opcode!
150- return REVERSE_OPS [ chunk ] ;
150+ return OPS [ chunk ] ;
151151 } )
152152 . join ( ' ' ) ;
153153}
@@ -162,7 +162,7 @@ export function fromASM(asm) {
162162 return compile (
163163 asm . split ( ' ' ) . map ( chunk => {
164164 // Check if the chunk is an opcode
165- if ( chunk in OPS ) {
165+ if ( isNaN ( Number ( chunk ) ) && chunk in OPS ) {
166166 return OPS [ chunk ] ;
167167 }
168168 // Validate if the chunk is a hexadecimal string
Original file line number Diff line number Diff line change @@ -136,4 +136,4 @@ enum OPS {
136136}
137137
138138// Export modules
139- export { OPS , OPS as REVERSE_OPS } ;
139+ export { OPS } ;
Original file line number Diff line number Diff line change 33 * @packageDocumentation
44 */
55import * as bip66 from './bip66.js' ;
6- import { OPS , REVERSE_OPS } from './ops.js' ;
6+ import { OPS } from './ops.js' ;
77import { Stack } from './payments/index.js' ;
88import * as pushdata from './push_data.js' ;
99import * as scriptNumber from './script_number.js' ;
@@ -187,7 +187,7 @@ export function toASM(chunks: Uint8Array | Array<number | Uint8Array>): string {
187187 }
188188
189189 // opcode!
190- return REVERSE_OPS [ chunk ] ;
190+ return OPS [ chunk ] ;
191191 } )
192192 . join ( ' ' ) ;
193193}
@@ -204,7 +204,7 @@ export function fromASM(asm: string): Uint8Array {
204204 return compile (
205205 asm . split ( ' ' ) . map ( ( chunk : string ) : number | Uint8Array => {
206206 // Check if the chunk is an opcode
207- if ( chunk in OPS ) {
207+ if ( isNaN ( Number ( chunk ) ) && chunk in OPS ) {
208208 return OPS [ chunk as keyof typeof OPS ] ;
209209 }
210210
You can’t perform that action at this time.
0 commit comments