Skip to content

Commit 53dee32

Browse files
committed
feat: remove outdated web3.utils._ lib usage
1 parent d1ede9a commit 53dee32

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

merkle-tree/src/utils-web3.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,18 @@ async function subscribeToEvent(
206206
type: 'event',
207207
signature: '0x881cc8af0159324ccea314ad98a0cf26fe0e460c2afa693c92f591613d4de7b2' }
208208
*/
209-
const eventJsonInterface = web3.utils._.find(
210-
contractInstance._jsonInterface, // eslint-disable-line no-underscore-dangle
211-
o => o.name === eventName && o.type === 'event',
212-
);
213209

214-
logger.silly(`eventJsonInterface: ${JSON.stringify(eventJsonInterface, null, 2)}`);
210+
211+
// changed below for sepolia ws url - NOT TESTED ON ANY OTHER BLOCKCHAIN
212+
213+
// const eventJsonInterface = web3.utils._.find(
214+
// contractInstance._jsonInterface, // eslint-disable-line no-underscore-dangle
215+
// o => o.name === eventName && o.type === 'event',
216+
// );
217+
218+
const eventJsonInterface = contractInstance._jsonInterface.find(o => o.name === eventName && o.type === 'event');
219+
220+
logger.info(`eventJsonInterface: ${JSON.stringify(eventJsonInterface, null, 2)}`);
215221

216222
const eventSubscription = await contractInstance.events[eventName]({
217223
fromBlock,

0 commit comments

Comments
 (0)