Skip to content

Commit

Permalink
Fix data format returned by zkevm_getBatchDataByNumbers
Browse files Browse the repository at this point in the history
  • Loading branch information
cffls committed Sep 10, 2024
1 parent 57fb26b commit 2fb2345
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/rpcdaemon/commands/zkevm_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1450,15 +1450,19 @@ func populateBatchDataSlimDetails(batches []*types.BatchDataSlim) (json.RawMessa
jBatches := make([]map[string]interface{}, 0, len(batches))
for _, b := range batches {
jBatch := map[string]interface{}{}
jBatch["number"] = b.Number
jBatch["number"] = hexutil.EncodeUint64(b.Number)
jBatch["empty"] = b.Empty
if !b.Empty {
jBatch["batchL2Data"] = b.BatchL2Data
}
jBatches = append(jBatches, jBatch)
}

return json.Marshal(jBatches)
data := map[string]interface{}{
"data": jBatches,
}

return json.Marshal(data)
}

// GetProof
Expand Down

0 comments on commit 2fb2345

Please sign in to comment.