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

Fixes and optimisations to dictionary queries #344

Merged
merged 3 commits into from
Aug 28, 2024
Merged

Fixes and optimisations to dictionary queries #344

merged 3 commits into from
Aug 28, 2024

Conversation

stwiname
Copy link

Description

A couple of improvements to dictionary queries:

  • Don't base grouping off templates name, this was a regression where the name was no longer available and so grouping wouldn't occur. So now it groups on matching filters.
  • Fixes not using dict, when a handler has no filters but an address was set in the options. This is an edge case.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have tested locally
  • I have performed a self review of my changes
  • Updated any relevant documentation
  • Linked to any relevant issues
  • I have added tests relevant to my changes
  • Any dependent changes have been merged and published in downstream modules
  • My code is up to date with the base branch
  • I have updated relevant changelogs. We suggest using chan

Copy link

github-actions bot commented Aug 28, 2024

Coverage report

Caution

Test run failed

St.
Category Percentage Covered / Total
🔴 Statements 53.07% 3306/6229
🟡 Branches 69.62% 424/609
🔴 Functions 50.53% 143/283
🔴 Lines 53.07% 3306/6229

Test suite run failed

Failed tests: 4/96. Failed suites: 3/14.
  ● rawBlockToEthBlock › successfully converts a block

    Receipt not available for From block 4085662.

      173 |             );
      174 |           } else if (payload.error) {
    > 175 |             const error = new Error(payload.error.message);
          |                           ^
      176 |             (<any>error).code = payload.error.code;
      177 |             (<any>error).data = payload.error.data;
      178 |             if (

      at packages/node/src/ethereum/ethers/json-rpc-batch-provider.ts:175:27
          at Array.forEach (<anonymous>)
      at packages/node/src/ethereum/ethers/json-rpc-batch-provider.ts:166:15

  ● rawBlockToEthBlock › can fetch receipts

    Receipt not available for From block 4085662.

      173 |             );
      174 |           } else if (payload.error) {
    > 175 |             const error = new Error(payload.error.message);
          |                           ^
      176 |             (<any>error).code = payload.error.code;
      177 |             (<any>error).data = payload.error.data;
      178 |             if (

      at packages/node/src/ethereum/ethers/json-rpc-batch-provider.ts:175:27
          at Array.forEach (<anonymous>)
      at packages/node/src/ethereum/ethers/json-rpc-batch-provider.ts:166:15


  ● ProjectService › can get a block timestamps

    TypeError: Cannot read properties of null (reading 'timestamp')

      76 |     const block = await this.apiService.unsafeApi.api.getBlock(height);
      77 |
    > 78 |     return new Date(block.timestamp * 1000); // TODO test and make sure its in MS not S
         |                           ^
      79 |   }
      80 |
      81 |   protected onProjectChange(project: SubqueryProject): void | Promise<void> {

      at ProjectService.getBlockTimestamp (packages/node/src/indexer/project.service.ts:78:27)
      at Object.<anonymous> (packages/node/src/indexer/project.service.test.ts:43:23)


  ● Api.ethereum › Should able to check is fullBlock

    Failed to fetch block 10001

      320 |
      321 |     if (!rawBlock) {
    > 322 |       throw new Error(`Failed to fetch block ${num}`);
          |             ^
      323 |     }
      324 |
      325 |     const block = formatBlock(rawBlock);

      at EthereumApi.getBlockPromise (packages/node/src/ethereum/api.ethereum.ts:322:13)
      at EthereumApi.fetchBlock (packages/node/src/ethereum/api.ethereum.ts:341:21)
      at Object.<anonymous> (packages/node/src/ethereum/api.ethereum.test.ts:371:25)

Report generated by 🧪jest coverage report action from 03c8258

@stwiname stwiname merged commit 2608e53 into main Aug 28, 2024
1 of 2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants