Merge pull request #261 from hermeznetwork/feature/til-extra

Move logic to extend til blocks to til
This commit is contained in:
arnau
2020-11-06 11:46:49 +01:00
committed by GitHub
6 changed files with 282 additions and 154 deletions

View File

@@ -278,7 +278,7 @@ func (hdb *HistoryDB) GetAllBatches() ([]common.Batch, error) {
err := meddler.QueryAll(
hdb.db, &batches,
`SELECT batch.batch_num, batch.eth_block_num, batch.forger_addr, batch.fees_collected,
batch.state_root, batch.num_accounts, batch.last_idx, batch.exit_root,
batch.fee_idxs_coordinator, batch.state_root, batch.num_accounts, batch.last_idx, batch.exit_root,
batch.forge_l1_txs_num, batch.slot_num, batch.total_fees_usd FROM batch;`,
)
return db.SlicePtrsToSlice(batches).([]common.Batch), err

View File

@@ -21,6 +21,7 @@ CREATE TABLE batch (
eth_block_num BIGINT NOT NULL REFERENCES block (eth_block_num) ON DELETE CASCADE,
forger_addr BYTEA NOT NULL, -- fake foreign key for coordinator
fees_collected BYTEA NOT NULL,
fee_idxs_coordinator BYTEA NOT NULL,
state_root BYTEA NOT NULL,
num_accounts BIGINT NOT NULL,
last_idx BIGINT NOT NULL,