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

Store slot and tx-ordinal in DB for successful and failed transactions #11

Open vsubhuman opened 5 years ago

vsubhuman commented 5 years ago

In order for v2 API in backend to properly work on the client-side - they need to be able to sort txs in "chain-order". And for that we need to store additional fields in DB:

  1. epoch - int number or epoch, zero or positive
  2. slot - in-epoch slot, number in [0, 21599]
  3. ordinal - in-slot tx ordinal number, zero or positive

These fields are also required for some future projects.

Note - failed txs only have epoch and slot, pointing to the slot that was "current" (ongoing) at the point when the tx failed. Failed txs don't have ordinal.

vsubhuman commented 5 years ago

Discussed with @nicarq - we also store slots for failed txs ("last update slot").