From fc6c0044324f2b7beba4fdb11c020080aa7fa64b Mon Sep 17 00:00:00 2001 From: KRogLA Date: Wed, 7 Feb 2024 22:02:52 +0100 Subject: [PATCH] fix: custom ganache --- .gitmodules | 3 --- _ganache | 1 - package.json | 6 +----- patch-ganache-7.9.2.js | 22 ---------------------- yarn.lock | 42 +++++++++++++++++++++--------------------- 5 files changed, 22 insertions(+), 52 deletions(-) delete mode 100644 .gitmodules delete mode 160000 _ganache delete mode 100644 patch-ganache-7.9.2.js diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index fef73d95..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "_ganache"] - path = _ganache - url = https://github.com/krogla/ganache.git diff --git a/_ganache b/_ganache deleted file mode 160000 index 655bcb24..00000000 --- a/_ganache +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 655bcb24499b06a9773c24c719954ca13931bd24 diff --git a/package.json b/package.json index 9294e854..ca9ca8b0 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,7 @@ "license": "MIT", "readme": "README.md", "homepage": "https://mainnet.lido.fi", - "scripts": { - "postinstall": "yarn patch:ganache", - "patch:ganache": "node patch-ganache-7.9.2.js" - }, "dependencies": { - "ganache": "=7.9.2" + "@lido-js/ganache": "=7.9.2-lido" } } diff --git a/patch-ganache-7.9.2.js b/patch-ganache-7.9.2.js deleted file mode 100644 index d9dfcdeb..00000000 --- a/patch-ganache-7.9.2.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Ganache v7.9.2 patch for JSON.stringify issue - * This fixes reading a lot of events events from debug_traceTransaction - */ -const fs = require('fs'); - -const searchString = '{const s=(0,a.makeResponse)(t.id,e);return"debug_traceTransaction"===t.method&&"object"==typeof e&&Array.isArray(e.structLogs)&&e.structLogs.length>this.BUFFERIFY_THRESHOLD?(0,u.bufferify)(s,""):JSON.stringify(s)}'; - -const replacementString = '{const r=(0,a.makeResponse)(t.id,e);if("debug_traceTransaction"===t.method&&"object"==typeof e&&Array.isArray(e.structLogs)&&e.structLogs.length>this.BUFFERIFY_THRESHOLD)return(0,u.bufferify)(r,"");try{return JSON.stringify(r)}catch(e){return(0,u.bufferify)(r,"")}}'; - -const filename = './node_modules/ganache/dist/node/1.js'; -fs.readFile(filename, 'utf8', function (err,data) { - if (err) { - return console.log(err); - } - const result = data.replace(searchString, replacementString); - - fs.writeFile(filename, result, 'utf8', function (err) { - if (err) return console.log(err); - }); -}); - diff --git a/yarn.lock b/yarn.lock index 0f491b47..e40a6f8a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,27 @@ # yarn lockfile v1 +"@lido-js/ganache@=7.9.2-lido": + version "7.9.2-lido" + resolved "https://registry.yarnpkg.com/@lido-js/ganache/-/ganache-7.9.2-lido.tgz#927611f015c72dbb0d68767ce69dc8f1b2bba6b8" + integrity sha512-q40Q3760CCn4rzg7prpiuPw9sYSKnrVKcIQupqrgAnWagr/I3FkUmNNhBWw4rQpPla4K50vyOJoUtPnN+hRx9g== + dependencies: + "@trufflesuite/bigint-buffer" "1.1.10" + "@trufflesuite/uws-js-unofficial" "20.30.0-unofficial.0" + "@types/bn.js" "^5.1.0" + "@types/lru-cache" "5.1.1" + "@types/seedrandom" "3.0.1" + abstract-level "1.0.3" + abstract-leveldown "7.2.0" + async-eventemitter "0.2.4" + emittery "0.10.0" + keccak "3.0.2" + leveldown "6.1.0" + secp256k1 "4.0.3" + optionalDependencies: + bufferutil "4.0.5" + utf-8-validate "5.0.7" + "@trufflesuite/bigint-buffer@1.1.10": version "1.1.10" resolved "https://registry.yarnpkg.com/@trufflesuite/bigint-buffer/-/bigint-buffer-1.1.10.tgz#a1d9ca22d3cad1a138b78baaf15543637a3e1692" @@ -142,27 +163,6 @@ emittery@0.10.0: resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.10.0.tgz#bb373c660a9d421bb44706ec4967ed50c02a8026" integrity sha512-AGvFfs+d0JKCJQ4o01ASQLGPmSCxgfU9RFXvzPvZdjKK8oscynksuJhWrSTSw7j7Ep/sZct5b5ZhYCi8S/t0HQ== -ganache@=7.9.2: - version "7.9.2" - resolved "https://registry.yarnpkg.com/ganache/-/ganache-7.9.2.tgz#77f506ad2735dd9109696ffa1834a9dd2f806449" - integrity sha512-7gsVVDpO9AhrFyDMWWl7SpMsPpqGcnAzjxz3k32LheIPNd64p2XsY9GYRdhWmKuryb60W1iaWPZWDkFKlbRWHA== - dependencies: - "@trufflesuite/bigint-buffer" "1.1.10" - "@trufflesuite/uws-js-unofficial" "20.30.0-unofficial.0" - "@types/bn.js" "^5.1.0" - "@types/lru-cache" "5.1.1" - "@types/seedrandom" "3.0.1" - abstract-level "1.0.3" - abstract-leveldown "7.2.0" - async-eventemitter "0.2.4" - emittery "0.10.0" - keccak "3.0.2" - leveldown "6.1.0" - secp256k1 "4.0.3" - optionalDependencies: - bufferutil "4.0.5" - utf-8-validate "5.0.7" - hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42"