mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
Add forged txs in batch endpoints response
This commit is contained in:
@@ -27,6 +27,7 @@ type testBatch struct {
|
||||
ExitRoot string `json:"exitRoot"`
|
||||
ForgeL1TxsNum *int64 `json:"forgeL1TransactionsNum"`
|
||||
SlotNum int64 `json:"slotNum"`
|
||||
ForgedTxs int `json:"forgedTransactions"`
|
||||
}
|
||||
type testBatchesResponse struct {
|
||||
Batches []testBatch `json:"batches"`
|
||||
@@ -73,6 +74,12 @@ func genTestBatches(
|
||||
for k, v := range cBatches[i].CollectedFees {
|
||||
collectedFees[k] = v.String()
|
||||
}
|
||||
forgedTxs := 0
|
||||
for _, tx := range txs {
|
||||
if tx.BatchNum != nil && *tx.BatchNum == cBatches[i].BatchNum {
|
||||
forgedTxs++
|
||||
}
|
||||
}
|
||||
tBatch := testBatch{
|
||||
BatchNum: cBatches[i].BatchNum,
|
||||
EthBlockNum: cBatches[i].EthBlockNum,
|
||||
@@ -86,6 +93,7 @@ func genTestBatches(
|
||||
ExitRoot: cBatches[i].ExitRoot.String(),
|
||||
ForgeL1TxsNum: cBatches[i].ForgeL1TxsNum,
|
||||
SlotNum: cBatches[i].SlotNum,
|
||||
ForgedTxs: forgedTxs,
|
||||
}
|
||||
tBatches = append(tBatches, tBatch)
|
||||
}
|
||||
|
||||
@@ -2113,6 +2113,10 @@ components:
|
||||
nullable: true
|
||||
slotNum:
|
||||
$ref: '#/components/schemas/SlotNum'
|
||||
forgedTransactions:
|
||||
type: integer
|
||||
description: Amount of forged transactions in this batch.
|
||||
example: 318
|
||||
additionalProperties: false
|
||||
required:
|
||||
- itemId
|
||||
@@ -2128,6 +2132,7 @@ components:
|
||||
- exitRoot
|
||||
- forgeL1TransactionsNum
|
||||
- slotNum
|
||||
- forgedTransactions
|
||||
FullBatch:
|
||||
type: object
|
||||
description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
|
||||
|
||||
Reference in New Issue
Block a user