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

Dictionary v2 poc update #221

Closed
wants to merge 3 commits into from

Conversation

jiqiang90
Copy link

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

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

Comment on lines 37 to +38
protected abstract buildDictionaryQueryEntries(dataSources: DS[]): DictionaryQueryEntry[];
protected abstract buildFatDictionaryQueryEntries(dataSources: DS[]): FatDictionaryQueryEntry;

Choose a reason for hiding this comment

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

Does it make sense to move this to the dictionary classes?

if (Array.isArray(dsOptions)) {
const addresses = dsOptions.map((option) => option.address).filter(Boolean);

if (addresses.length > queryAddressLimit) {

Choose a reason for hiding this comment

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

I think it would be worth testing if we need this limit

Copy link

github-actions bot commented Nov 29, 2023

Coverage report

❌ An unexpected error occurred. For more details, check console

Error: The process '/usr/local/bin/yarn' failed with exit code 1
St.
Category Percentage Covered / Total
🔴 Statements 49.61% 3363/6779
🟡 Branches 64.52% 291/451
🔴 Functions 37.55% 95/253
🔴 Lines 49.61% 3363/6779

Test suite run failed

Failed tests: 7/198. Failed suites: 11/42.
  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Jest worker encountered 4 child process exceptions, exceeding retry limit

      at ChildProcessWorker.initialize (node_modules/jest-worker/build/workers/ChildProcessWorker.js:181:21)


  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Api.ethereum › Resolves the correct tags for finalization

    expect(received).toBeTruthy()

    Received: false

      244 |   it('Resolves the correct tags for finalization', async () => {
      245 |     // Ethereum
    > 246 |     expect((ethApi as any).supportsFinalization).toBeTruthy();
          |                                                  ^
      247 |
      248 |     // Moonbeam
      249 |     ethApi = new EthereumApi(

      at Object.<anonymous> (packages/node/src/ethereum/api.ethereum.test.ts:246:50)


  ● Worker Store Service › can make a request with an object

    thrown: "Exceeded timeout of 5000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      70 |   });
      71 |
    > 72 |   it('can make a request with an object', async () => {
         |   ^
      73 |     const spy = jest.spyOn(store, 'getByField');
      74 |
      75 |     await worker.callStoreFunction('getByField', ['Entity', 'field', '1', {offset: 0, limit: 1}]);

      at packages/node-core/src/indexer/worker/worker.store.service.test.ts:72:3
      at Object.<anonymous> (packages/node-core/src/indexer/worker/worker.store.service.test.ts:42:1)

  ● Worker Store Service › can make a respone with an object

    thrown: "Exceeded timeout of 5000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      78 |   });
      79 |
    > 80 |   it('can make a respone with an object', async () => {
         |   ^
      81 |     const spy = jest.spyOn(store, 'set');
      82 |
      83 |     const entity = new EntityCls('1', '1');

      at packages/node-core/src/indexer/worker/worker.store.service.test.ts:80:3
      at Object.<anonymous> (packages/node-core/src/indexer/worker/worker.store.service.test.ts:42:1)


  ● CeloJsonRpcProvider › should not set gasLimit to zero for blocks after the hard fork

    thrown: "Exceeded timeout of 5000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      27 |
      28 |   // Test if gasLimit is correctly set for blocks after the hard fork
    > 29 |   it('should not set gasLimit to zero for blocks after the hard fork', async () => {
         |   ^
      30 |     const block = formatBlock(
      31 |       await provider.send('eth_getBlockByNumber', ['latest', true]),
      32 |     );

      at packages/node/src/ethereum/ethers/celo/celo-json-rpc-batch-provider.spec.ts:29:3
      at Object.<anonymous> (packages/node/src/ethereum/ethers/celo/celo-json-rpc-batch-provider.spec.ts:8:1)


  ● CeloJsonRpcProvider › should not set gasLimit to zero for blocks after the hard fork

    thrown: "Exceeded timeout of 5000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      25 |
      26 |   // Test if gasLimit is correctly set for blocks after the hard fork
    > 27 |   it('should not set gasLimit to zero for blocks after the hard fork', async () => {
         |   ^
      28 |     const block = formatBlock(
      29 |       await provider.send('eth_getBlockByNumber', ['latest', true]),
      30 |     );

      at packages/node/src/ethereum/ethers/celo/celo-json-rpc-provider.spec.ts:27:3
      at Object.<anonymous> (packages/node/src/ethereum/ethers/celo/celo-json-rpc-provider.spec.ts:8:1)


  ● sandbox for subql-node › wait until promise resolved

    VMError: Cannot find module './main.js'

      at CustomResolver.resolveFull (node_modules/vm2/lib/resolver.js:279:10)
      at CustomResolver.resolve (node_modules/vm2/lib/resolver.js:121:15)
      at resolve (node_modules/vm2/lib/nodevm.js:317:21)
      at VM2 Wrapper.apply (node_modules/vm2/lib/bridge.js:485:11)
      at requireImpl (node_modules/vm2/lib/setup-node-sandbox.js:90:19)
      at require (node_modules/vm2/lib/setup-node-sandbox.js:171:10)
      at packages/node-core/test/sandbox/sandbox:1:26
      at VM2 Wrapper.apply (node_modules/vm2/lib/bridge.js:485:11)
      at IndexerSandbox.run (node_modules/vm2/lib/nodevm.js:497:23)
      at IndexerSandbox.runTimeout (packages/node-core/src/indexer/sandbox.ts:74:12)
      at IndexerSandbox.securedExec (packages/node-core/src/indexer/sandbox.ts:154:18)
      at Object.<anonymous> (packages/node-core/src/indexer/sandbox.spec.ts:34:14)


  ● CeloJsonRpcProvider › should not set gasLimit to zero for blocks after the hard fork

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

      Object {
    -   "hex": "0x01e84800",
    +   "hex": "0x02faf080",
        "type": "BigNumber",
      }

      29 |       await provider.send('eth_getBlockByNumber', ['latest', true]),
      30 |     );
    > 31 |     expect(BigNumber.from(block.gasLimit)).toEqual(BigNumber.from(0x01e84800));
         |                                            ^
      32 |   });
      33 | });
      34 |

      at Object.<anonymous> (packages/node/src/ethereum/ethers/celo/celo-ws-provider.spec.ts:31:44)


  ● Test suite failed to run

    Jest worker encountered 4 child process exceptions, exceeding retry limit

      at ChildProcessWorker.initialize (node_modules/jest-worker/build/workers/ChildProcessWorker.js:181:21)


  ● Test suite failed to run

    A jest worker process (pid=2527) was terminated by another process: signal=SIGKILL, exitCode=null. Operating system logs may contain more information on why this occurred.

      at ChildProcessWorker._onExit (node_modules/jest-worker/build/workers/ChildProcessWorker.js:370:23)

Report generated by 🧪jest coverage report action from 038e1c9

@jiqiang90 jiqiang90 closed this Feb 15, 2024
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