Feature/merge history l2 tables (#156)

* WIP rebase

* Combine both SQL DBs

* API and DB refactor
This commit is contained in:
a_bennassar
2020-09-29 18:27:07 +02:00
committed by GitHub
parent 8efbb7ab18
commit c6f70f3177
34 changed files with 1493 additions and 990 deletions

View File

@@ -29,7 +29,9 @@ type L1Tx struct {
LoadAmount *big.Int
EthBlockNum int64 // Ethereum Block Number in which this L1Tx was added to the queue
Type TxType
BatchNum BatchNum
BatchNum *BatchNum
USD *float64
LoadAmountUSD *float64
}
// Tx returns a *Tx from the L1Tx
@@ -52,11 +54,13 @@ func (tx *L1Tx) Tx() *Tx {
FromBJJ: tx.FromBJJ,
LoadAmount: tx.LoadAmount,
EthBlockNum: tx.EthBlockNum,
USD: tx.USD,
LoadAmountUSD: tx.LoadAmountUSD,
}
if tx.LoadAmount != nil {
lf := new(big.Float).SetInt(tx.LoadAmount)
loadAmountFloat, _ := lf.Float64()
genericTx.LoadAmountFloat = loadAmountFloat
genericTx.LoadAmountFloat = &loadAmountFloat
}
return genericTx
}