Add NewFloor40Floor helper method

Also added tracerr.Wrap(...) to missing places.
This commit is contained in:
arnaucube
2021-03-03 11:35:50 +01:00
parent e460a7e58b
commit dfd49164f4
9 changed files with 85 additions and 22 deletions

View File

@@ -179,7 +179,7 @@ func (hdb *HistoryDB) GetBatch(batchNum common.BatchNum) (*common.Batch, error)
batch.slot_num, batch.total_fees_usd FROM batch WHERE batch_num = $1;`,
batchNum,
)
return &batch, err
return &batch, tracerr.Wrap(err)
}
// GetAllBatches retrieve all batches from the DB
@@ -235,7 +235,7 @@ func (hdb *HistoryDB) GetLastBatch() (*common.Batch, error) {
batch.num_accounts, batch.last_idx, batch.exit_root, batch.forge_l1_txs_num,
batch.slot_num, batch.total_fees_usd FROM batch ORDER BY batch_num DESC LIMIT 1;`,
)
return &batch, err
return &batch, tracerr.Wrap(err)
}
// GetLastL1BatchBlockNum returns the blockNum of the latest forged l1Batch

View File

@@ -458,7 +458,7 @@ func (k *KVDB) CheckpointExists(batchNum common.BatchNum) (bool, error) {
if _, err := os.Stat(source); os.IsNotExist(err) {
return false, nil
} else if err != nil {
return false, err
return false, tracerr.Wrap(err)
}
return true, nil
}