Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError with getLogs Function on opBNB Chain in Interport Finance #99

Open
dev-dozer opened this issue Dec 20, 2023 · 0 comments
Open

Comments

@dev-dozer
Copy link
Contributor

Environment Details:

Project: Interport Finance
Chain: opBNB
@defillama/sdk Version: ^4.0.64
File: processTransactionsCustom.ts
Issue Description:
We are encountering a recurring TypeError when using the getLogs function from the @defillama/sdk in our Interport Finance bridge adapter, specifically when interacting with the opBNB chain. The error does not occur with other chains, indicating a possible issue specific to the opBNB chain integration or handling within the SDK.

Error Message:

The error message received is as follows:

 TypeError: Cannot read properties of null (reading 'getLogs')
    at /**/bridges-server/node_modules/@defillama/sdk/build/util/index.js:349:88
    at step (/**/bridges-server/node_modules/@defillama/sdk/build/util/index.js:44:23)
    at Object.next (/**/bridges-server/node_modules/@defillama/sdk/build/util/index.js:25:53)
    at /**/bridges-server/node_modules/@defillama/sdk/build/util/index.js:19:71
    at new Promise (<anonymous>)
    at __awaiter (/**/bridges-server/node_modules/@defillama/sdk/build/util/index.js:15:12)
    at getLogs (/**/bridges-server/node_modules/@defillama/sdk/build/util/index.js:325:12)
    at /**/bridges-server/src/adapters/interport-finance/processTransactionsCustom.ts:119:38
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)

This error occurs during the execution of the getLogs function in the processTransactionsCustom.ts file, specifically around line 119.

Steps to Reproduce:

  1. Execute the script: ts-node src/adapters/test interport 10000.
  2. The script attempts to retrieve event logs on the opBNB chain.
  3. The TypeError occurs.

Expected Behavior:

The getLogs function should successfully retrieve event logs from the opBNB chain without resulting in a TypeError.

Additional Context:

  • The error seems to be isolated to the opBNB chain; other chains work correctly.
  • The arguments passed to getLogs have been verified and appear correct. Here are the argument values for reference:
{
  "target": "0x7b2E3FC7510D1A51b3bef735F985446589219354",
  "topic": "ExampleTopic",
  "keys": [],
  "fromBlock": 11314315,
  "toBlock": 11324315,
  "topics": undefined,
  "chain": "opbnb"
}

Note: topics is always undefined, but this does not seem to affect the functionality for other chains.

Request for Assistance:
We request assistance in identifying whether this issue stems from a potential misconfiguration on our end or if there is an underlying issue with the @defillama/sdk specifically related to the opBNB chain. Any guidance or suggestions for troubleshooting this issue would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant