MetricsDAO / harmony_dbt

DBT Project for the Harmony Blockchain
12 stars 8 forks source link

[Bug] add gas used for txns #125

Closed antonyip closed 2 years ago

antonyip commented 2 years ago

This is from chainwalkers.prod.harmony_txs

  1. Extract out cumulativeGasUsed as gas_used and convert it into integer for the stg_txs table,
  2. Add gas_used to txs table
    {
    "bech32_from": "one17q49nlt0kq6wq87ex8ymm0adr9cnfqnw7w79xv",
    "bech32_to": "one10zuhn4ff2ps7k697xy6czjmggenkzxd0fgmhrq",
    "block_hash": "0xf022ad7d86be3c21f43c3b9f9beac78bcfc9130e58d542e769abe8818fd9a7ac",
    "block_number": 20262462,
    "from": "0xf02a59fd6fb034e01fd931c9bdbfad197134826e",
    "gas": 50000,
    "gas_price": 150000000000,
    "hash": "0x292a2ad9a59da2928c0982b7a43336d4e69330121220028da1afb27711e5e3f6",
    "input": "0x",
    "nonce": "0x65351",
    "r": "0xe87807e23155ebe50b72eb6846b1e5406aa9609debb43390cd889e4a53e7823e",
    "receipt": {
      "bech32_from": "one17q49nlt0kq6wq87ex8ymm0adr9cnfqnw7w79xv",
      "bech32_to": "one10zuhn4ff2ps7k697xy6czjmggenkzxd0fgmhrq",
      "blockHash": "0xf022ad7d86be3c21f43c3b9f9beac78bcfc9130e58d542e769abe8818fd9a7ac",
      "blockNumber": "0x1352e3e",
      "contractAddress": "",
      "cumulativeGasUsed": "0x5208",
      "from": "0xf02a59fd6fb034e01fd931c9bdbfad197134826e",
      "logs": [],
      "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "status": "0x1",
      "to": "0x78b979d5295061eb68be3135814b6846676119af",
      "transactionHash": "0x292a2ad9a59da2928c0982b7a43336d4e69330121220028da1afb27711e5e3f6",
      "transactionIndex": "0x0"
    },
    "s": "0x5725df61d1ac05e4dd7c798b86037c448cc19e384750ebb5e48130b0688db658",
    "to": "0x78b979d5295061eb68be3135814b6846676119af",
    "transactionIndex": 0,
    "v": "0x26",
    "value": 107290600000000000000
    }