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

invalid value for value.type #3459

Closed
zemse opened this issue Oct 23, 2022 · 8 comments
Closed

invalid value for value.type #3459

zemse opened this issue Oct 23, 2022 · 8 comments
Assignees
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published. v6 Issues regarding v6

Comments

@zemse
Copy link
Collaborator

zemse commented Oct 23, 2022

Ethers Beta Version

6.0.0-beta-exports.4

Describe the Problem

Ganache's eth_getTransactionReceipt does not include tx.type. Hence waiting for a tx gives an error. If tx.type is not present, it is likely that it's an old infra and tx.type can be taken as 0 implicitly.

Here is the rpc response:

{
  id: 17,
  jsonrpc: '2.0',
  result: {
    transactionHash: '0x3ed44b5b94bbff1c1a5463b41c79a0b8709af10e72c606e955a1b50dc2e4958c',
    transactionIndex: '0x0',
    blockHash: '0x614760a60117471a61e2b6132f1e81f88bc43dac917d1b2eb8ef9267bd54ec0d',
    blockNumber: '0x2',
    from: '0xaa45a60f5a98b6859a7cbf057d27766347263216',
    to: '0x88ef4f3291fb068bc0b813d3b0d1461af901c14d',
    gasUsed: '0x81d4',
    cumulativeGasUsed: '0x81d4',
    contractAddress: null,
    logs: [ [Object] ],
    status: '0x1',
    logsBloom: '0x00000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000200000100000000000200000000000000000000000000000000000000000000000000008000000000000000000000000000000000004000000000000000000000000000000000010000000000000000000000000000000000008000000000000000000000000000000'
  }
}

Code Snippet

const tx = await simpleStorageInstance.setValue("hi");
await tx.wait();

Errors

Error: invalid value for value.type (invalid numeric value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=6.0.0-beta-exports.4)) (value={"transactionHash":"0x3ed44b5b94bbff1c1a5463b41c79a0b8709af10e72c606e955a1b50dc2e4958c","transactionIndex":"0x0","blockHash":"0x614760a60117471a61e2b6132f1e81f88bc43dac917d1b2eb8ef9267bd54ec0d","blockNumber":"0x2","from":"0xaa45a60f5a98b6859a7cbf057d27766347263216","to":"0x88ef4f3291fb068bc0b813d3b0d1461af901c14d","gasUsed":"0x81d4","cumulativeGasUsed":"0x81d4","contractAddress":null,"logs":[{"logIndex":"0x0","transactionIndex":"0x0","transactionHash":"0x3ed44b5b94bbff1c1a5463b41c79a0b8709af10e72c606e955a1b50dc2e4958c","blockHash":"0x614760a60117471a61e2b6132f1e81f88bc43dac917d1b2eb8ef9267bd54ec0d","blockNumber":"0x2","address":"0x88ef4f3291fb068bc0b813d3b0d1461af901c14d","data":"0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b68656c6c6f20776f726c6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000026869000000000000000000000000000000000000000000000000000000000000","topics":["0xe826f71647b8486f2bae59832124c70792fba044036720a54ec8dacdd5df4fcb","0x000000000000000000000000aa45a60f5a98b6859a7cbf057d27766347263216"],"type":"mined","removed":false}],"status":"0x1","logsBloom":"0x00000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000200000100000000000200000000000000000000000000000000000000000000000000008000000000000000000000000000000000004000000000000000000000000000000000010000000000000000000000000000000000008000000000000000000000000000000","effectiveGasPrice":"0x77359400"}, code=BAD_DATA, version=6.0.0-beta-exports.4)

Environment

Ganache

Environment (Other)

No response

@zemse zemse added the v6 Issues regarding v6 label Oct 23, 2022
@ricmoo ricmoo added the on-deck This Enhancement or Bug is currently being worked on. label Nov 9, 2022
@pustovalov
Copy link

I also encountered this error in version 6.0.0-beta-exports.11

@pustovalov
Copy link

Issue exists in 6.0.2, is this expected behaviour?

@albertov19
Copy link

I can confirm that exists on 6.0.2 when running a client (of Moonbeam) that used to not have the tx type included in the receipt:

{
    "jsonrpc": "2.0",
    "result": {
        "blockHash": "0x8edcba7af40852ad3056aa0b4dbd8647febe4d8eb487fc669f7d6167d9d9f0f3",
        "blockNumber": "0x1",
        "contractAddress": "0xc2bf5f29a4384b1ab0c063e1c666f02121b6084a",
        "cumulativeGasUsed": "0x7058f",
        "effectiveGasPrice": "0xd09dc300",
        "from": "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b",
        "gasUsed": "0x7058f",
        "logs": [],
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "status": "0x1",
        "to": null,
        "transactionHash": "0xc74d3c2b424119e37e207cc08a6e901746cfc9c239f3876d767a397649d5f6eb",
        "transactionIndex": "0x0"
    },
    "id": 1
}

@ricmoo
Copy link
Member

ricmoo commented Feb 10, 2023

I’ll get this in the next patch release.

@ricmoo
Copy link
Member

ricmoo commented Feb 13, 2023

This should be fixed now. Let me know if you still have any problems.

Thanks! :)

@ricmoo ricmoo added bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. labels Feb 13, 2023
@albertov19
Copy link

I tested the previous scenario that was failing in 6.0.2 and it is working as expected on 6.0.3 😃 thanks for the quick turnaround!

@wanglonghong
Copy link

I tested the previous scenario that was failing in 6.0.2 and it is working as expected on 6.0.3 😃 thanks for the quick turnaround!
I had the same case, failing in 6.0.2 but working in 6.0.3. Nice fix!

@ricmoo
Copy link
Member

ricmoo commented Feb 13, 2023

Awesome!

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published. v6 Issues regarding v6
Projects
None yet
Development

No branches or pull requests

5 participants