File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,40 @@ function testImportExportEquivalence {
145145 done
146146 done
147147
148+ if ! $SOLC --combined-json asm --pretty-json --import-asm-json expected.asm > obtained_direct_import_export.json 2> obtained_direct_import_export.error
149+ then
150+ printf " \n"
151+ echo " $nth_input_file "
152+ cat obtained_direct_import_export.error
153+ FAILED=$(( FAILED + 1 ))
154+ return 0
155+ else
156+ for obtained_contract in $( jq ' .contracts | keys | .[]' obtained_direct_import_export.json 2> /dev/null)
157+ do
158+ jq --raw-output " .contracts.${obtained_contract} .\" asm\" " obtained_direct_import_export.json > obtained_direct_import_export.asm
159+ set +e
160+ DIFF=" $( diff expected.asm obtained_direct_import_export.asm) "
161+ set -e
162+ if [ " $DIFF " != " " ]
163+ then
164+ if [ " $DIFFVIEW " == " " ]
165+ then
166+ echo -e " ERROR: JSONS differ for $1 : \n $DIFF \n"
167+ echo " Expected:"
168+ cat expected.asm
169+ echo " Obtained:"
170+ cat obtained_direct_import_export.asm
171+ else
172+ # Use user supplied diff view binary
173+ $DIFFVIEW expected.asm obtained_direct_import_export.asm
174+ fi
175+ _TESTED=
176+ FAILED=$(( FAILED + 1 ))
177+ return 0
178+ fi
179+ done
180+ fi
181+
148182 rm obtained.json
149183 rm -f obtained.error
150184 for type in " ${types[@]} "
You can’t perform that action at this time.
0 commit comments