Emurgo / project-icarus-importer

Icarus, a reference implementation for a lightweight wallet developed by the IOHK Engineering Team.
Other
4 stars 2 forks source link

#7 Store block hash #9

Closed vsubhuman closed 5 years ago

vsubhuman commented 5 years ago

Closing #7

  1. Dragged HeaderHash value from the closest location in Txp/Global.hs into TxsTable.hs into upsertSuccessfulTx (the only function where this value makes sense)
  2. Bandwagoned HeaderHash with the Maybe BlockCount to drag it into the actual inserting function upsertTxToHistory.
  3. Added new column to the Opaleye scheme: trBlockHash; actual column name is "block_hash"; type - nullable text.
  4. Had to implement extractHash to extract actual digest from the AbstractHash type and to convert it to string. Other than that processing is very similar to the block_num value.
  5. Added new column definition to the blockImporterTables-beta.sql - block_hash text null
vsubhuman commented 5 years ago

This feature is still awaiting local testing. Created PR so that review can be already performed.

vsubhuman commented 5 years ago

image

First tx for comparison - https://cardanoexplorer.com/api/txs/summary/6497b33b10fa2619c6efbd9f874ecd1c91badb10bf70850732aab45b90524d9e

Local testing is successful.

vsubhuman commented 5 years ago

Ready for review and merge. @SebastienGllmt @nicarq