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

Add support for endpoint config headers and batch size #334

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

stwiname
Copy link

@stwiname stwiname commented Aug 1, 2024

Description

Update dependencies and support for network endpoint configs including setting headers and batch sizes.

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 Update endpoint config for eth sdk documentation#550

Checklist

  • I have tested locally
  • I have performed a self review of my changes
  • Updated any relevant documentation Update endpoint config for eth sdk documentation#550
  • 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 1, 2024

Coverage report

Caution

Test run failed

St.
Category Percentage Covered / Total
🔴 Statements 56.34% 3522/6251
🟡 Branches 68.97% 429/622
🔴 Functions 55.83% 158/283
🔴 Lines 56.34% 3522/6251

Test suite run failed

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

    missing response (requestBody="[{\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x3e579e\",true],\"id\":42,\"jsonrpc\":\"2.0\"}]", requestMethod="POST", serverError={"code":"DEPTH_ZERO_SELF_SIGNED_CERT"}, url="https://ethereum.rpc.subquery.network/public", code=SERVER_ERROR, version=web/5.7.1)

      371 |         response = (<any>error).response;
      372 |         if (response == null) runningTimeout.cancel();
    > 373 |         throw logger.throwError(
          |                      ^
      374 |           'missing response',
      375 |           Logger.errors.SERVER_ERROR,
      376 |           {

      at Logger.Object.<anonymous>.Logger.makeError (node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
      at Logger.Object.<anonymous>.Logger.throwError (node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
      at packages/node/src/ethereum/ethers/web/index.ts:373:22

  ● rawBlockToEthBlock › can fetch receipts

    missing response (requestBody="[{\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x3e579e\",true],\"id\":42,\"jsonrpc\":\"2.0\"}]", requestMethod="POST", serverError={"code":"DEPTH_ZERO_SELF_SIGNED_CERT"}, url="https://ethereum.rpc.subquery.network/public", code=SERVER_ERROR, version=web/5.7.1)

      371 |         response = (<any>error).response;
      372 |         if (response == null) runningTimeout.cancel();
    > 373 |         throw logger.throwError(
          |                      ^
      374 |           'missing response',
      375 |           Logger.errors.SERVER_ERROR,
      376 |           {

      at Logger.Object.<anonymous>.Logger.makeError (node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
      at Logger.Object.<anonymous>.Logger.throwError (node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
      at packages/node/src/ethereum/ethers/web/index.ts:373:22


  ● ApiService › can get the finalized height

    expect(received).toBeGreaterThan(expected)

    Expected: > 16000000
    Received:   0

      87 |
      88 |     console.log('Finalized height', height);
    > 89 |     expect(height).toBeGreaterThan(16_000_000);
         |                    ^
      90 |   });
      91 |
      92 |   it('ensure api errorCode is exposed when throwing', async () => {

      at Object.<anonymous> (packages/node/src/ethereum/api.service.ethereum.test.ts:89:20)


  ● Api.ethereum › Assert blockHash on logs and block

    thrown: "Exceeded timeout of 90000 ms for a hook.
    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."

      53 |   };
      54 |
    > 55 |   beforeEach(async () => {
         |   ^
      56 |     ethApi = new EthereumApi(HTTP_ENDPOINT, BLOCK_CONFIRMATIONS, eventEmitter);
      57 |     await ethApi.init();
      58 |     blockData = await fetchBlock(16258633);

      at packages/node/src/ethereum/api.ethereum.test.ts:55:3
      at Object.<anonymous> (packages/node/src/ethereum/api.ethereum.test.ts:44:1)

Report generated by 🧪jest coverage report action from 563e912

@stwiname stwiname merged commit 2dcacc3 into main Aug 1, 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