fix comparinf bytecode

pull/3418/head
yann300 2 years ago committed by Aniket
parent ad8e191d21
commit 5bc59a9dd4
  1. 6
      libs/remix-lib/src/util.ts
  2. 8
      libs/remix-lib/test/util.ts

@ -258,6 +258,12 @@ export function compareByteCode (code1, code2) {
code2 = extractcborMetadata(code2)
if (code1 && code2) {
if (code1.length !== code2.length) {
// if the length isn't the same, we have an issue with extracting the metadata hash.
const minLength = code1.length > code2.length ? code2.length: code1.length
code1 = code1.substr(0, minLength - 10)
code2 = code2.substr(0, minLength - 10)
}
const compare = stringSimilarity.compareTwoStrings(code1, code2)
return compare == 1
}

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save