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

Errors at the tests of web3-plugin-example with 4.0.1-rc.1 #6133

Closed
Muhammad-Altabba opened this issue May 31, 2023 · 0 comments · Fixed by #6134
Closed

Errors at the tests of web3-plugin-example with 4.0.1-rc.1 #6133

Muhammad-Altabba opened this issue May 31, 2023 · 0 comments · Fixed by #6134
Assignees
Labels
4.x 4.0 related Bug Addressing a bug

Comments

@Muhammad-Altabba
Copy link
Contributor

Steps to reproduce the behavior

run:

cd tools/web3-plugin-example/
yarn test

You will see those logged:

yarn run v1.22.19
$ jest --config=./test/unit/jest.config.js
 PASS  test/unit/custom_rpc_methods.test.ts
 FAIL  test/unit/contract_method_wrappers.test.ts
  ● CustomRpcMethodsPlugin Tests › CustomRpcMethodsPlugin methods tests › should call contractMethodWrappersPlugin.getFormattedBalance with expected RPC object

    expect(jest.fn()).toHaveBeenCalledWith(...expected)

    - Expected
    + Received

    @@ -1,10 +1,9 @@
      Object {
        "method": "eth_call",
        "params": Array [
          Object {
    -       "data": "0x70a082310000000000000000000000008da5e39ec14b57fb9bcd9aa2b4500e909119795d",
            "input": "0x70a082310000000000000000000000008da5e39ec14b57fb9bcd9aa2b4500e909119795d",
            "to": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
          },
          "latest",
        ],,

    Number of calls: 1

      65 |                              DEFAULT_RETURN_FORMAT,
      66 |                      );
    > 67 |                      expect(requestManagerSendSpy).toHaveBeenCalledWith({
         |                                                    ^
      68 |                              method: 'eth_call',
      69 |                              params: [
      70 |                                      {

      at test/unit/contract_method_wrappers.test.ts:67:34
      at fulfilled (test/unit/contract_method_wrappers.test.ts:5:58)

  ● CustomRpcMethodsPlugin Tests › CustomRpcMethodsPlugin methods tests › should call CustomRpcMethodsPlugin.customRpcMethodWithParameters with expected RPC object

    expect(jest.fn()).toHaveBeenCalledWith(...expected)

    Expected: {"method": "eth_sendTransaction", "params": [{"data": "0xa9059cbb0000000000000000000000004f641def1e7845caab95ac717c80416082430d0d000000000000000000000000000000000000000000000000000000000000002a", "from": "0x8da5e39ec14b57fb9bcd9aa2b4500e909119795d", "gasPrice": "0x1ca14bd70", "input": "0xa9059cbb0000000000000000000000004f641def1e7845caab95ac717c80416082430d0d000000000000000000000000000000000000000000000000000000000000002a", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xdAC17F958D2ee523a2206206994597C13D831ec7"}]}
    Received
           1
              Object {
            -   "method": "eth_sendTransaction",
            +   "method": "eth_call",
                "params": Array [
                  Object {
            -       "data": "0xa9059cbb0000000000000000000000004f641def1e7845caab95ac717c80416082430d0d000000000000000000000000000000000000000000000000000000000000002a",
            -       "from": "0x8da5e39ec14b57fb9bcd9aa2b4500e909119795d",
            -       "gasPrice": "0x1ca14bd70",
            -       "input": "0xa9059cbb0000000000000000000000004f641def1e7845caab95ac717c80416082430d0d000000000000000000000000000000000000000000000000000000000000002a",
            -       "maxFeePerGas": undefined,
            -       "maxPriorityFeePerGas": undefined,
            +       "input": "0x70a082310000000000000000000000008da5e39ec14b57fb9bcd9aa2b4500e909119795d",
                    "to": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
                  },
            +     "latest",
                ],
              },
           2
              Object {
            -   "method": "eth_sendTransaction",
            -   "params": Array [
            -     Object {
            -       "data": "0xa9059cbb0000000000000000000000004f641def1e7845caab95ac717c80416082430d0d000000000000000000000000000000000000000000000000000000000000002a",
            -       "from": "0x8da5e39ec14b57fb9bcd9aa2b4500e909119795d",
            -       "gasPrice": "0x1ca14bd70",
            -       "input": "0xa9059cbb0000000000000000000000004f641def1e7845caab95ac717c80416082430d0d000000000000000000000000000000000000000000000000000000000000002a",
            -       "maxFeePerGas": undefined,
            -       "maxPriorityFeePerGas": undefined,
            -       "to": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
            -     },
            -   ],
            +   "method": "eth_gasPrice",
            +   "params": Array [],
              },
           3
              Object {
            -   "method": "eth_sendTransaction",
            -   "params": Array [
            -     Object {
            -       "data": "0xa9059cbb0000000000000000000000004f641def1e7845caab95ac717c80416082430d0d000000000000000000000000000000000000000000000000000000000000002a",
            -       "from": "0x8da5e39ec14b57fb9bcd9aa2b4500e909119795d",
            -       "gasPrice": "0x1ca14bd70",
            -       "input": "0xa9059cbb0000000000000000000000004f641def1e7845caab95ac717c80416082430d0d000000000000000000000000000000000000000000000000000000000000002a",
            -       "maxFeePerGas": undefined,
            -       "maxPriorityFeePerGas": undefined,
            -       "to": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
            -     },
            -   ],
            +   "method": "eth_blockNumber",
            +   "params": Array [],
              },

    Number of calls: 8

       99 |                             amount,
      100 |                     );
    > 101 |                     expect(requestManagerSendSpy).toHaveBeenCalledWith({
          |                                                   ^
      102 |                             method: 'eth_sendTransaction',
      103 |                             params: [
      104 |                                     {

      at test/unit/contract_method_wrappers.test.ts:101:34
      at fulfilled (test/unit/contract_method_wrappers.test.ts:5:58)

Test Suites: 1 failed, 1 passed, 2 total
Tests:       2 failed, 4 passed, 6 total
@Muhammad-Altabba Muhammad-Altabba added the 4.x 4.0 related label May 31, 2023
@Muhammad-Altabba Muhammad-Altabba self-assigned this May 31, 2023
@Muhammad-Altabba Muhammad-Altabba linked a pull request May 31, 2023 that will close this issue
17 tasks
@mconnelly8 mconnelly8 added the Bug Addressing a bug label May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants