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

Do not index data when fullBlock does not exist logs #350

Merged
merged 6 commits into from
Oct 24, 2024
Merged

Conversation

yoozo
Copy link

@yoozo yoozo commented Oct 22, 2024

Description

Do not index data when fullBlock does not exist logs.

Fixes subquery#2575

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

@yoozo yoozo requested a review from stwiname October 22, 2024 08:55
Copy link

github-actions bot commented Oct 22, 2024

Coverage report

Caution

Test run failed

St.
Category Percentage Covered / Total
🔴 Statements 53.49% 3330/6226
🟡 Branches 69.81% 430/616
🔴 Functions 52.3% 148/283
🔴 Lines 53.49% 3330/6226

Test suite run failed

Failed tests: 1/96. Failed suites: 1/14.
  ● rawBlockToEthBlock › can fetch receipts

    expect(received).resolves.not.toThrow()

    Received promise rejected instead of resolved
    Rejected to value: [TypeError: Cannot read properties of null (reading 'from')]

      110 |     const block = rawBlockToEthBlock(raw, api);
      111 |
    > 112 |     await expect(block.block.transactions[0].receipt()).resolves.not.toThrow();
          |           ^
      113 |   });
      114 | });
      115 |

      at expect (node_modules/expect/build/index.js:105:15)
      at Object.<anonymous> (packages/node/src/indexer/dictionary/v2/utils.spec.ts:112:11)

Report generated by 🧪jest coverage report action from 34b3237

@@ -367,6 +368,11 @@ describe('Api.ethereum', () => {
expect(isFullBlock(blockData)).toBeTruthy();
expect(isFullBlock(lightBlock)).toBeFalsy();

// block with transactions, but no logs

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a better test would find a real block with no logs.

@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Do not index data when fullBlock does not exist logs (#350)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense to me. It should still be possible to index a block without logs

@yoozo yoozo merged commit 37945f8 into main Oct 24, 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.

Ethereum transactions not indexed when block only contain native transfers
2 participants