oursky / likecoin-chain

LikeCoin chain node
https://likecoin.bigdipper.live
GNU General Public License v3.0
1 stars 2 forks source link

Extra `""` in `EventNewClass` tx logs #277

Closed williamchong closed 2 years ago

williamchong commented 2 years ago

In likechain.likenft.EventNewClass seems the logs contains string that is always wrapped in extra ""s Example:

{
            "type": "likechain.likenft.EventNewClass",
            "attributes": [
              {
                "key": "class_id",
                "value": "\"likenft1hjppkjry9zhwq0e6r4pehp0fqrkvkmkz7pp3dmnfdlylgx8y5gcq79mrq9\""
              },
              {
                "key": "parent_iscn_id_prefix",
                "value": "\"iscn://likecoin-chain/obr5VPRtkMSaDzaQyg1izE0_dqC7yzwNGm8kUrsbHJg\""
              },
              {
                "key": "parent_account",
                "value": "\"\""
              }
            ]
          },

Seems it doesn't happen in other parts of tx body, is this expected?

Full tx json:

{
  "tx": {
    "body": {
      "messages": [
        {
          "@type": "/likechain.likenft.MsgNewClass",
          "creator": "like1yney2cqn5qdrlc50yr5l53898ufdhxafqz9gxp",
          "parent": {
            "type": "ISCN",
            "iscn_id_prefix": "iscn://likecoin-chain/obr5VPRtkMSaDzaQyg1izE0_dqC7yzwNGm8kUrsbHJg"
          },
          "input": {
            "name": "Liker NFT #1",
            "symbol": "",
            "description": "",
            "uri": "",
            "uri_hash": "",
            "metadata": {
              "@context": "http://schema.org/",
              "@type": "Article",
              "keywords": "matrix,recursion",
              "name": "使用矩陣計算遞歸關係式",
              "usageInfo": "https://creativecommons.org/licenses/by/4.0",
              "version": 1,
              "a": "b"
            },
            "config": {
              "burnable": false,
              "max_supply": "0",
              "blind_box_config": null
            }
          }
        }
      ],
      "memo": "",
      "timeout_height": "0",
      "extension_options": [],
      "non_critical_extension_options": []
    },
    "auth_info": {
      "signer_infos": [
        {
          "public_key": {
            "@type": "/cosmos.crypto.secp256k1.PubKey",
            "key": "A8m6bje2E6AkGuD/My10L6X7lsnfah3d0pYR3eMvionO"
          },
          "mode_info": {
            "single": {
              "mode": "SIGN_MODE_DIRECT"
            }
          },
          "sequence": "33"
        }
      ],
      "fee": {
        "amount": [
          {
            "denom": "nanolike",
            "amount": "2000000"
          }
        ],
        "gas_limit": "200000",
        "payer": "",
        "granter": ""
      }
    },
    "signatures": [
      "HMjEgQNH4FmecpAywoPm0Hc2lAO9Bv5wCd9CrWYt+Sx/wiqjog/xB+l5slZ7UxDYx/E9itd5xBZbdrmxjffxIg=="
    ]
  },
  "tx_response": {
    "height": "84056",
    "txhash": "5A2322BB24158EE2CECB701F81DE1DCE84AB049DB1D7EC0D697E1E5A98B68CCC",
    "codespace": "",
    "code": 0,
    "data": "0AB4030A1E2F6C696B65636861696E2E6C696B656E66742E4D73674E6577436C6173731291030A8E030A426C696B656E667431686A70706B6A7279397A687771306536723470656870306671726B766B6D6B7A37707033646D6E66646C796C677838793567637137396D727139120C4C696B6572204E46542023313AB9020A1C2F6C696B65636861696E2E6C696B656E66742E436C617373446174611298020ACA017B2240636F6E74657874223A22687474703A2F2F736368656D612E6F72672F222C224074797065223A2241727469636C65222C226B6579776F726473223A226D61747269782C726563757273696F6E222C226E616D65223A22E4BDBFE794A8E79FA9E999A3E8A888E7AE97E9819EE6ADB8E9979CE4BF82E5BC8F222C227573616765496E666F223A2268747470733A2F2F6372656174697665636F6D6D6F6E732E6F72672F6C6963656E7365732F62792F342E30222C2276657273696F6E223A312C2261223A2262227D1247080112416973636E3A2F2F6C696B65636F696E2D636861696E2F6F627235565052746B4D5361447A6151796731697A45305F64714337797A774E476D386B55727362484A6718011A00",
    "raw_log": "[{\"events\":[{\"type\":\"likechain.likenft.EventNewClass\",\"attributes\":[{\"key\":\"class_id\",\"value\":\"\\\"likenft1hjppkjry9zhwq0e6r4pehp0fqrkvkmkz7pp3dmnfdlylgx8y5gcq79mrq9\\\"\"},{\"key\":\"parent_iscn_id_prefix\",\"value\":\"\\\"iscn://likecoin-chain/obr5VPRtkMSaDzaQyg1izE0_dqC7yzwNGm8kUrsbHJg\\\"\"},{\"key\":\"parent_account\",\"value\":\"\\\"\\\"\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"new_class\"}]}]}]",
    "logs": [
      {
        "msg_index": 0,
        "log": "",
        "events": [
          {
            "type": "likechain.likenft.EventNewClass",
            "attributes": [
              {
                "key": "class_id",
                "value": "\"likenft1hjppkjry9zhwq0e6r4pehp0fqrkvkmkz7pp3dmnfdlylgx8y5gcq79mrq9\""
              },
              {
                "key": "parent_iscn_id_prefix",
                "value": "\"iscn://likecoin-chain/obr5VPRtkMSaDzaQyg1izE0_dqC7yzwNGm8kUrsbHJg\""
              },
              {
                "key": "parent_account",
                "value": "\"\""
              }
            ]
          },
          {
            "type": "message",
            "attributes": [
              {
                "key": "action",
                "value": "new_class"
              }
            ]
          }
        ]
      }
    ],
    "info": "",
    "gas_wanted": "200000",
    "gas_used": "77777",
    "tx": {
      "@type": "/cosmos.tx.v1beta1.Tx",
      "body": {
        "messages": [
          {
            "@type": "/likechain.likenft.MsgNewClass",
            "creator": "like1yney2cqn5qdrlc50yr5l53898ufdhxafqz9gxp",
            "parent": {
              "type": "ISCN",
              "iscn_id_prefix": "iscn://likecoin-chain/obr5VPRtkMSaDzaQyg1izE0_dqC7yzwNGm8kUrsbHJg"
            },
            "input": {
              "name": "Liker NFT #1",
              "symbol": "",
              "description": "",
              "uri": "",
              "uri_hash": "",
              "metadata": {
                "@context": "http://schema.org/",
                "@type": "Article",
                "keywords": "matrix,recursion",
                "name": "使用矩陣計算遞歸關係式",
                "usageInfo": "https://creativecommons.org/licenses/by/4.0",
                "version": 1,
                "a": "b"
              },
              "config": {
                "burnable": false,
                "max_supply": "0",
                "blind_box_config": null
              }
            }
          }
        ],
        "memo": "",
        "timeout_height": "0",
        "extension_options": [],
        "non_critical_extension_options": []
      },
      "auth_info": {
        "signer_infos": [
          {
            "public_key": {
              "@type": "/cosmos.crypto.secp256k1.PubKey",
              "key": "A8m6bje2E6AkGuD/My10L6X7lsnfah3d0pYR3eMvionO"
            },
            "mode_info": {
              "single": {
                "mode": "SIGN_MODE_DIRECT"
              }
            },
            "sequence": "33"
          }
        ],
        "fee": {
          "amount": [
            {
              "denom": "nanolike",
              "amount": "2000000"
            }
          ],
          "gas_limit": "200000",
          "payer": "",
          "granter": ""
        }
      },
      "signatures": [
        "HMjEgQNH4FmecpAywoPm0Hc2lAO9Bv5wCd9CrWYt+Sx/wiqjog/xB+l5slZ7UxDYx/E9itd5xBZbdrmxjffxIg=="
      ]
    },
    "timestamp": "2022-06-05T13:50:25Z",
    "events": [
      {
        "type": "coin_spent",
        "attributes": [
          {
            "key": "c3BlbmRlcg==",
            "value": "bGlrZTF5bmV5MmNxbjVxZHJsYzUweXI1bDUzODk4dWZkaHhhZnF6OWd4cA==",
            "index": true
          },
          {
            "key": "YW1vdW50",
            "value": "MjAwMDAwMG5hbm9saWtl",
            "index": true
          }
        ]
      },
      {
        "type": "coin_received",
        "attributes": [
          {
            "key": "cmVjZWl2ZXI=",
            "value": "bGlrZTE3eHBmdmFrbTJhbWc5NjJ5bHM2Zjg0ejNrZWxsOGM1bHI5bHpneA==",
            "index": true
          },
          {
            "key": "YW1vdW50",
            "value": "MjAwMDAwMG5hbm9saWtl",
            "index": true
          }
        ]
      },
      {
        "type": "transfer",
        "attributes": [
          {
            "key": "cmVjaXBpZW50",
            "value": "bGlrZTE3eHBmdmFrbTJhbWc5NjJ5bHM2Zjg0ejNrZWxsOGM1bHI5bHpneA==",
            "index": true
          },
          {
            "key": "c2VuZGVy",
            "value": "bGlrZTF5bmV5MmNxbjVxZHJsYzUweXI1bDUzODk4dWZkaHhhZnF6OWd4cA==",
            "index": true
          },
          {
            "key": "YW1vdW50",
            "value": "MjAwMDAwMG5hbm9saWtl",
            "index": true
          }
        ]
      },
      {
        "type": "message",
        "attributes": [
          {
            "key": "c2VuZGVy",
            "value": "bGlrZTF5bmV5MmNxbjVxZHJsYzUweXI1bDUzODk4dWZkaHhhZnF6OWd4cA==",
            "index": true
          }
        ]
      },
      {
        "type": "tx",
        "attributes": [
          {
            "key": "ZmVl",
            "value": "MjAwMDAwMG5hbm9saWtl",
            "index": true
          }
        ]
      },
      {
        "type": "tx",
        "attributes": [
          {
            "key": "YWNjX3NlcQ==",
            "value": "bGlrZTF5bmV5MmNxbjVxZHJsYzUweXI1bDUzODk4dWZkaHhhZnF6OWd4cC8zMw==",
            "index": true
          }
        ]
      },
      {
        "type": "tx",
        "attributes": [
          {
            "key": "c2lnbmF0dXJl",
            "value": "SE1qRWdRTkg0Rm1lY3BBeXdvUG0wSGMybEFPOUJ2NXdDZDlDcldZdCtTeC93aXFqb2cveEIrbDVzbFo3VXhEWXgvRTlpdGQ1eEJaYmRybXhqZmZ4SWc9PQ==",
            "index": true
          }
        ]
      },
      {
        "type": "message",
        "attributes": [
          {
            "key": "YWN0aW9u",
            "value": "bmV3X2NsYXNz",
            "index": true
          }
        ]
      },
      {
        "type": "likechain.likenft.EventNewClass",
        "attributes": [
          {
            "key": "Y2xhc3NfaWQ=",
            "value": "Imxpa2VuZnQxaGpwcGtqcnk5emh3cTBlNnI0cGVocDBmcXJrdmtta3o3cHAzZG1uZmRseWxneDh5NWdjcTc5bXJxOSI=",
            "index": true
          },
          {
            "key": "cGFyZW50X2lzY25faWRfcHJlZml4",
            "value": "ImlzY246Ly9saWtlY29pbi1jaGFpbi9vYnI1VlBSdGtNU2FEemFReWcxaXpFMF9kcUM3eXp3TkdtOGtVcnNiSEpnIg==",
            "index": true
          },
          {
            "key": "cGFyZW50X2FjY291bnQ=",
            "value": "IiI=",
            "index": true
          }
        ]
      }
    ]
  }
}
elise-ng commented 2 years ago

@williamchong this is a sdk bug related to typed events: https://github.com/tendermint/tendermint/issues/5978

williamchong commented 2 years ago

The issue was not related to double quote being a bug, but a (silly) decision in adr32 to make string contain "" making txs search not working Now I am running into this exact event search issue, which is blocking me from listing events related to a class id 🙃