kardiachain/go-kardia

Subscribe filter logs return data but cannot get transaction with hash

ngdlong91 opened this issue · 2 comments

Subscribe LogFilter with ws

{
  "level": "debug",
  "ts": 1619000339.835479,
  "caller": "handler/pair.go:39",
  "msg": "PairEvent",
  "method": "OnPairEvents",
  "Log": {
    "address": "0xA37888A6FF1B0A5347D8355DE05A044F2981a959",
    "methodName": "Swap",
    "argumentsName": "index_topic_1 address sender, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out, index_topic_2 address to",
    "arguments": {
      "amount0In": "10000000000000000000",
      "amount0Out": "0",
      "amount1In": "0",
      "amount1Out": "2388318147512360489",
      "sender": "0x581e5fdb8114023faef21666910b3b9b4e612ddc",
      "to": "0xf64c35a3d5340b8493ce4cd988b3c1e890b2bd68"
    },
    "topics": [
      "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822",
      "0x000000000000000000000000581e5fdb8114023faef21666910b3b9b4e612ddc",
      "0x000000000000000000000000f64c35a3d5340b8493ce4cd988b3c1e890b2bd68"
    ],
    "data": "0000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000212502b38917de29",
    "blockHeight": 459708,
    "time": "0001-01-01T00:00:00Z",
    "transactionHash": "0xbf4b6118e2ecd922efddbc049693fd64b7ad43bc3dc49f6d35fd0718de5b3bce",
    "blockHash": "0x97d584e4a97560d3001f5e86bc5194abe579fc08dcb91e919cf488a2fd58abe3",
    "logIndex": 5
  }
}

Sometimes, cannot get txHash which got from event logs

{
  "level": "error",
  "ts": 1619000339.9845388,
  "caller": "handler/pair.go:69",
  "msg": "cannot get tx",
  "method": "OnSwapEvent",
  "error": "tx for hash not found",
  "stacktrace": ""
}

Please fix asap

Fixed at #157