Skip to content
This repository has been archived by the owner on Aug 12, 2021. It is now read-only.

fix: Handle MsgUnjail transactions #41

Merged
merged 1 commit into from
May 25, 2021
Merged

fix: Handle MsgUnjail transactions #41

merged 1 commit into from
May 25, 2021

Conversation

youngjoon-lee
Copy link

@youngjoon-lee youngjoon-lee commented May 24, 2021

So far, MsgUnjail transactions haven't been handled by Explorer Server.
It has been crashed with the following error:

0|npm  |   sql: 'INSERT INTO `transactions` (`blockHeight`,`data`,`executed`,`fromAccount`,`id`,`onChain`,`toAccount`,`txHash`,`blockId`,`createdAt`,`updatedAt`) VALUES (7974433,\'{\\"blockHeight\\":7974433,\\"executed\\":true,\\"fromAccount\\":null,\\"toAccount\\":null,\\"onChain\\":true,\\"txHash\\":\\"5BD51D161A93D8CE5F364BA23A92F3E88A14F4958E1C96AC91E52B58375DC53B:0\\",\\"type\\":\\"cosmos-sdk/MsgUnjail\\",\\"memo\\":\\"\\",\\"amount\\":null}\',true,NULL,NULL,true,NULL,\'5BD51D161A93D8CE5F364BA23A92F3E88A14F4958E1C96AC91E52B58375DC53B:0\',7974433,\'2021-05-24 08:07:22\',\'2021-05-24 08:07:22\');',
0|npm  |   parameters: undefined }
0|npm  | 2021-05-24T08:07:22.885Z [error] : SequelizeDatabaseError: Column 'fromAccount' cannot be null

I fixed it to handle MsgUnjail properly that looks like below:

  "tx": {
    "type": "cosmos-sdk/StdTx",
    "value": {
      "msg": [
        {
          "type": "cosmos-sdk/MsgUnjail",
          "value": {
            "address": "panaceavaloper1j62hw3ylz9sk26staqpa6270sm6qvj6hnzle97"
          }
        }
      ],
      "fee": {
        "amount": [
          {
            "denom": "umed",
            "amount": "1000000"
          }
        ],
        "gas": "200000"
      },
      "signatures": [
        {
          "pub_key": {
            "type": "tendermint/PubKeySecp256k1",
            "value": "A1uck19UHInyY+wqRkyNucuglfUty63aXwk3aKIvRby6"
          },
          "signature": "HzxHpjkui6FbsoWbnWwn+O4e269i8OPGo9o7uJOpcFhVMM/iSoLoPL283Nwrn/0w7ekUUyVsosaLG47Mjjzm7A=="
        }
      ],
      "memo": ""
    }
  },

As we know, this code design isn't clean, but we will deprecate this Explorer soon anyway.

@youngjoon-lee youngjoon-lee requested review from cl9200 and gyuguen May 24, 2021 08:48
Copy link

@gyuguen gyuguen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@cl9200 cl9200 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants