subquery / subql

SubQuery is an Open, Flexible, Fast and Universal data indexing framework for web3. Our mission is to help developers create the decentralised products of the future.
https://subquery.network
GNU General Public License v3.0
18.94k stars 331 forks source link

Dynamic DS unable to retrieve data from store #1486

Closed bz888 closed 1 year ago

bz888 commented 1 year ago

Prerequisites

Description

The example project uses subql-ethereum https://github.com/subquery/subql-ethereum

When dealing with dynamicDatasources, it cannot get data from the store Example project In the example:

handleInitialize (core.ts) is a dynamic datasource that updates pool when used however, it fails to retrieve the pool data saved by handlePoolCreated (factory.ts)

Screenshot 2023-01-11 at 7 35 10 AM

Steps to Reproduce

  1. [yarn && yarn codegen && yarn build ]
    • For the example project, you would have to manually update the "@subql/types" to "@subql/types-ethereum" to succeed yarn build
  2. [ To run the project: yarn start:docker ]
    • It would then output the error in the screenshot above, as const pool = await Pool.get(event.address) in handleInitialize outputs undefined

Expected behavior: [What you expected to happen]

stwiname commented 1 year ago

This was an issue with the project.

This line should be const pool = new Pool(event.args.pool)