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

StoredVersionedContractByName is generating invalid body hash #215

Open
meywood opened this issue Aug 7, 2023 · 0 comments
Open

StoredVersionedContractByName is generating invalid body hash #215

meywood opened this issue Aug 7, 2023 · 0 comments

Comments

@meywood
Copy link
Collaborator

meywood commented Aug 7, 2023

The following JSON generated by the Java SDK is is giving invalid body hash:

{
  "id": "1324170213",
  "jsonrpc": "2.0",
  "method": "account_put_deploy",
  "params": [
    {
      "hash": "d13dc28dcaf8d0fefcf2b903a329a1ef93d20b87596d1b30c3eca97abfd6bcd7",
      "header": {
        "account": "014b810b7b016a00dfc1ff7b9d749cf957f21911860a0a1afe1d398e86a77ac675",
        "dependencies": [],
        "ttl": "30m",
        "body_hash": "94e141505fcc0c144e2998392461ce9ee2dc5193fa90f707c62b17c30010f077",
        "chain_name": "casper-net-1",
        "gas_price": 1,
        "timestamp": "2023-08-07T09:15:53.883Z"
      },
      "approvals": [
        {
          "signer": "014b810b7b016a00dfc1ff7b9d749cf957f21911860a0a1afe1d398e86a77ac675",
          "signature": "019e6885c7494b90486314b81cbdc8f18551b08029a4d5578064e9ee770121ed9cd3d4c3ad1aef518aff7091e3a6c61593cc2903d7274fb732f39d33e0e291a504"
        }
      ],
      "payment": {
        "ModuleBytes": {
          "args": [
            [
              "amount",
              {
                "bytes": "0400f90295",
                "cl_type": "U512"
              }
            ]
          ],
          "module_bytes": ""
        }
      },
      "session": {
        "StoredVersionedContractByName": {
          "name": "ERC20",
          "version": 1,
          "args": [
            [
              "recipient",
              {
                "bytes": "6e0978007127c16ff0521104d7c52b8dab8da839ea3df8776a4f8d3e24853bcf",
                "cl_type": {
                  "ByteArray": 32
                }
              }
            ],
            [
              "amount",
              {
                "bytes": "0400180d8f",
                "cl_type": "U256"
              }
            ]
          ],
          "entry_point": "transfer"
        }
      }
    }
  ]
}

The response is:

{
    "jsonrpc": "2.0",
    "id": "1324170213",
    "error": {
        "code": -32008,
        "message": "Invalid Deploy",
        "data": "invalid deploy: the provided body hash does not match the actual hash of the body"
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant