File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -138,8 +138,8 @@ jobs:
138138 PK_OUTGOING=$(grep -o "Master Outgoing Viewing: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/Master Outgoing Viewing: //' || echo "")
139139 PK_TAGGING=$(grep -o "Master Tagging: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/Master Tagging: //' || echo "")
140140
141- # Extract constructor args (JSON array)
142- CONSTRUCTOR_ARGS=$(grep "Constructor args:" "$TEMP_OUTPUT" | sed 's/.*Constructor args: //' || echo "")
141+ # Extract constructor args (JSON array), strip ANSI codes, and trim whitespace
142+ CONSTRUCTOR_ARGS=$(grep "Constructor args:" "$TEMP_OUTPUT" | sed 's/.*Constructor args: //' | sed 's/\x1b\[[0-9;]*m//g' | tr -d '\n\r' | sed 's/[[:space:]]*$//' | | echo "")
143143
144144 rm "$TEMP_OUTPUT"
145145
Original file line number Diff line number Diff line change @@ -52,12 +52,21 @@ async function main() {
5252 // Parse constructor args
5353 let constructorArgs ;
5454 try {
55- // Remove any surrounding quotes that might have been added
56- const cleanedJson = constructorArgsJson . trim ( ) . replace ( / ^ [ ' " ] | [ ' " ] $ / g, '' ) ;
55+ // Remove any surrounding quotes, whitespace, and control characters
56+ let cleanedJson = constructorArgsJson . trim ( ) ;
57+ // Remove surrounding quotes (single or double)
58+ cleanedJson = cleanedJson . replace ( / ^ [ ' " ] | [ ' " ] $ / g, '' ) ;
59+ // Remove any trailing whitespace or control characters
60+ cleanedJson = cleanedJson . replace ( / [ \s \r \n ] + $ / , '' ) ;
61+
5762 logger . info ( `Parsing constructor args: ${ cleanedJson } ` ) ;
63+ logger . info ( `Constructor args length: ${ cleanedJson . length } ` ) ;
64+
5865 constructorArgs = JSON . parse ( cleanedJson ) . map ( ( arg : string ) => AztecAddress . fromString ( arg ) ) ;
5966 } catch ( error ) {
60- logger . error ( `Failed to parse constructor args: ${ constructorArgsJson } ` ) ;
67+ logger . error ( `Failed to parse constructor args` ) ;
68+ logger . error ( `Raw value: ${ JSON . stringify ( constructorArgsJson ) } ` ) ;
69+ logger . error ( `Raw value length: ${ constructorArgsJson . length } ` ) ;
6170 logger . error ( `Error: ${ error } ` ) ;
6271 throw error ;
6372 }
You can’t perform that action at this time.
0 commit comments