From d1ede9acc5119ea733032fdc060c893ac544061a Mon Sep 17 00:00:00 2001 From: MirandaWood Date: Thu, 5 Jan 2023 16:42:31 +0000 Subject: [PATCH 1/3] fix: re-add admin user to make updates --- merkle-tree/src/db/common/adminDbConnection.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/merkle-tree/src/db/common/adminDbConnection.js b/merkle-tree/src/db/common/adminDbConnection.js index 01cd3a4..c1de11e 100644 --- a/merkle-tree/src/db/common/adminDbConnection.js +++ b/merkle-tree/src/db/common/adminDbConnection.js @@ -10,8 +10,13 @@ else url = `mongodb://${host}:${port}`; dbConnections.admin = mongoose.createConnection(`${url}/${databaseName}`, { useNewUrlParser: true, useCreateIndex: true, + authSource: "admin", + user: "admin", + pass: "admin", + useUnifiedTopology: true, + useFindAndModify: false }); const adminDbConnection = dbConnections.admin; -export default adminDbConnection; +export default adminDbConnection; \ No newline at end of file From 53dee320b90b94d86a7a4dd6a0cc01d579616365 Mon Sep 17 00:00:00 2001 From: MirandaWood Date: Thu, 5 Jan 2023 16:43:01 +0000 Subject: [PATCH 2/3] feat: remove outdated web3.utils._ lib usage --- merkle-tree/src/utils-web3.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/merkle-tree/src/utils-web3.js b/merkle-tree/src/utils-web3.js index 54472c9..43b2a85 100644 --- a/merkle-tree/src/utils-web3.js +++ b/merkle-tree/src/utils-web3.js @@ -206,12 +206,18 @@ async function subscribeToEvent( type: 'event', signature: '0x881cc8af0159324ccea314ad98a0cf26fe0e460c2afa693c92f591613d4de7b2' } */ - const eventJsonInterface = web3.utils._.find( - contractInstance._jsonInterface, // eslint-disable-line no-underscore-dangle - o => o.name === eventName && o.type === 'event', - ); - logger.silly(`eventJsonInterface: ${JSON.stringify(eventJsonInterface, null, 2)}`); + + // changed below for sepolia ws url - NOT TESTED ON ANY OTHER BLOCKCHAIN + + // const eventJsonInterface = web3.utils._.find( + // contractInstance._jsonInterface, // eslint-disable-line no-underscore-dangle + // o => o.name === eventName && o.type === 'event', + // ); + + const eventJsonInterface = contractInstance._jsonInterface.find(o => o.name === eventName && o.type === 'event'); + + logger.info(`eventJsonInterface: ${JSON.stringify(eventJsonInterface, null, 2)}`); const eventSubscription = await contractInstance.events[eventName]({ fromBlock, From a99c9c6ee5a4604e220b00cb60c4ac9793d37010 Mon Sep 17 00:00:00 2001 From: Miranda Wood Date: Wed, 1 Feb 2023 13:40:51 +0000 Subject: [PATCH 3/3] chore: remove comments now tested --- merkle-tree/src/utils-web3.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/merkle-tree/src/utils-web3.js b/merkle-tree/src/utils-web3.js index 43b2a85..f499f9b 100644 --- a/merkle-tree/src/utils-web3.js +++ b/merkle-tree/src/utils-web3.js @@ -207,17 +207,9 @@ async function subscribeToEvent( signature: '0x881cc8af0159324ccea314ad98a0cf26fe0e460c2afa693c92f591613d4de7b2' } */ - - // changed below for sepolia ws url - NOT TESTED ON ANY OTHER BLOCKCHAIN - - // const eventJsonInterface = web3.utils._.find( - // contractInstance._jsonInterface, // eslint-disable-line no-underscore-dangle - // o => o.name === eventName && o.type === 'event', - // ); - const eventJsonInterface = contractInstance._jsonInterface.find(o => o.name === eventName && o.type === 'event'); - logger.info(`eventJsonInterface: ${JSON.stringify(eventJsonInterface, null, 2)}`); + logger.silly(`eventJsonInterface: ${JSON.stringify(eventJsonInterface, null, 2)}`); const eventSubscription = await contractInstance.events[eventName]({ fromBlock,