@gearbox-protocol/deploy-tools 1.5.3 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +23 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -276989,7 +276989,7 @@ var require_package2 = __commonJS({
|
|
|
276989
276989
|
module2.exports = {
|
|
276990
276990
|
name: "@gearbox-protocol/deploy-tools",
|
|
276991
276991
|
description: "Gearbox deploy tools",
|
|
276992
|
-
version: "1.5.
|
|
276992
|
+
version: "1.5.3",
|
|
276993
276993
|
homepage: "https://gearbox.fi",
|
|
276994
276994
|
keywords: [
|
|
276995
276995
|
"gearbox"
|
|
@@ -277899,7 +277899,18 @@ var _logger, _sandboxDir, _auditFile, auditFile_fn, _findMatches, findMatches_fn
|
|
|
277899
277899
|
var AuditChecker = class {
|
|
277900
277900
|
constructor(sandboxDir) {
|
|
277901
277901
|
__privateAdd(this, _auditFile);
|
|
277902
|
+
/**
|
|
277903
|
+
* Given file from transaction that we want to check for audits, will compare this file with all audits of this repo
|
|
277904
|
+
* @param file
|
|
277905
|
+
* @returns
|
|
277906
|
+
*/
|
|
277902
277907
|
__privateAdd(this, _findMatches);
|
|
277908
|
+
/**
|
|
277909
|
+
* Given file from transaction in question, will try to find the same file in audited repository and compare it's content
|
|
277910
|
+
* @param file
|
|
277911
|
+
* @param repoAudit
|
|
277912
|
+
* @returns
|
|
277913
|
+
*/
|
|
277903
277914
|
__privateAdd(this, _findMatch);
|
|
277904
277915
|
/**
|
|
277905
277916
|
* Will create '<repo>/<commitish>' dir in sandbox and checkout this repo @ this commit into this folder
|
|
@@ -277979,7 +277990,17 @@ findMatch_fn = async function(file, repoAudit) {
|
|
|
277979
277990
|
);
|
|
277980
277991
|
try {
|
|
277981
277992
|
const content = await (0, import_promises2.readFile)(filePath);
|
|
277982
|
-
|
|
277993
|
+
let matches = content.equals(file.buffer);
|
|
277994
|
+
if (matches) {
|
|
277995
|
+
__privateGet(this, _logger).trace(
|
|
277996
|
+
`file ${file.repo}/${file.path} matches with audit ${file.repo}@${commitish}`
|
|
277997
|
+
);
|
|
277998
|
+
} else {
|
|
277999
|
+
__privateGet(this, _logger).trace(
|
|
278000
|
+
`file ${file.repo}/${file.path} does not match match with audit ${file.repo}@${commitish}, checking variations...`
|
|
278001
|
+
);
|
|
278002
|
+
}
|
|
278003
|
+
return matches;
|
|
277983
278004
|
} catch (e) {
|
|
277984
278005
|
if ((e == null ? void 0 : e.code) !== "ENOENT") {
|
|
277985
278006
|
__privateGet(this, _logger).warn(e);
|