mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
Feature/merge history l2 tables (#156)
* WIP rebase * Combine both SQL DBs * API and DB refactor
This commit is contained in:
@@ -13,7 +13,9 @@ type L2Tx struct {
|
||||
FromIdx Idx
|
||||
ToIdx Idx
|
||||
Amount *big.Int
|
||||
USD *float64
|
||||
Fee FeeSelector
|
||||
FeeUSD *float64
|
||||
Nonce Nonce
|
||||
Type TxType
|
||||
EthBlockNum int64 // Ethereum Block Number in which this L2Tx was added to the queue
|
||||
@@ -23,6 +25,12 @@ type L2Tx struct {
|
||||
func (tx *L2Tx) Tx() *Tx {
|
||||
f := new(big.Float).SetInt(tx.Amount)
|
||||
amountFloat, _ := f.Float64()
|
||||
batchNum := new(BatchNum)
|
||||
*batchNum = tx.BatchNum
|
||||
fee := new(FeeSelector)
|
||||
*fee = tx.Fee
|
||||
nonce := new(Nonce)
|
||||
*nonce = tx.Nonce
|
||||
return &Tx{
|
||||
IsL1: false,
|
||||
TxID: tx.TxID,
|
||||
@@ -31,11 +39,13 @@ func (tx *L2Tx) Tx() *Tx {
|
||||
FromIdx: tx.FromIdx,
|
||||
ToIdx: tx.ToIdx,
|
||||
Amount: tx.Amount,
|
||||
USD: tx.USD,
|
||||
AmountFloat: amountFloat,
|
||||
BatchNum: tx.BatchNum,
|
||||
BatchNum: batchNum,
|
||||
EthBlockNum: tx.EthBlockNum,
|
||||
Fee: tx.Fee,
|
||||
Nonce: tx.Nonce,
|
||||
Fee: fee,
|
||||
FeeUSD: tx.FeeUSD,
|
||||
Nonce: nonce,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user