Developers Forum for XinFin XDC Network

Discussion on: xdc dosent suport eth_call with specific blockhash

Collapse
wjrjerome profile image
Blockchain Minions • Edited on

have you tried using block number hex instead of passing the block hash directly?
Looking into the web3 implementation, it is expecting the second parameters to be block number rather than hash.(except those enum such as "latest").

I have tested with the block number 0x22b2277 which is block num for this hash 0xe8ec...64b you provided. Below is what it returned:

curl -X POST https://arpc.apothem.network/ -H "Content-Type: application/json" -d '
{
    "id": 348,
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "data": "0x06fdde03",
            "gas": "0x2faf080",
            "to": "0x53350795c11cee781a7e174479778f848d76ab2a"
        },
        "0x22b2277"
    ]
}'

{"jsonrpc":"2.0","id":348,"result":"0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f44656d6f20476f6c6420546f6b656e0000000000000000000000000000000000"}
Enter fullscreen mode Exit fullscreen mode

Looking at some of the eth API documentation, it also suggest eth_call shall be using block num in hex format OR use the enum it provided, see