api: Unable to decode Contract Event

When deploying the Smart Contract, I get Unable to decode Contract Event error.

Screenshot from 2020-11-14 18-44-15

The JSON that is visible here on the console also differs from the JSON that I get as a terminal output. This is from the Browser’s Console.

{
  "dispatchInfo": {
    "weight": 700500000,
    "class": "Normal",
    "paysFee": "Yes"
  },
  "events": [
    {
      "phase": {
        "ApplyExtrinsic": 1
      },
      "event": {
        "index": "0x0905",
        "data": [
          "5HjpDS3KA3iAZSHNzQfyXoa72o6nadQpSjBeAT6jQrezuQf2",
          "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"
        ]
      },
      "topics": [
        "0x696660f4c1d1f9fc5fbc8c946c1f89e4c8b35b12ffa60d1752ef92030625f1f5"
      ]
    },
    {
      "phase": {
        "ApplyExtrinsic": 1
      },
      "event": {
        "index": "0x0000",
        "data": [
          {
            "weight": 700500000,
            "class": "Normal",
            "paysFee": "Yes"
          }
        ]
      },
      "topics": []
    }
  ],
  "status": {
    "InBlock": "0x2ffc594155a50541c9dc08008cf0b1219f051b8ebfc36c23d7215e9c15c7622e"
  },
  "contractEvents": []
}

Whereas the terminal output is somewhat like:

{
  "dispatchInfo": {
    "weight": 150000000,
    "class": "Normal",
    "paysFee": "Yes"
  },
  "events": [
    {
      "phase": {
        "ApplyExtrinsic": 1
      },
      "event": {
        "index": "0x0000",
        "data": [
          {
            "weight": 150000000,
            "class": "Normal",
            "paysFee": "Yes"
          }
        ]
      },
      "topics": []
    }
  ],
  "status": {
    "Finalized": "0x3159371db6098be8c0c9552664aa7aa2c792e6c0c7d67ebbb08aef8a0a2eb193"
  }
}

PS : The above two JSONs are from two different transactions, but the idea is to point out that the terminal output of the response JSON from the api-contract doesn’t show full information as it is shown in the browser console.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 45 (25 by maintainers)

Most upvoted comments

AssetTransfer.zip Here you go. The zip file contains both the ABI and the WASM file.