(height int32, b *types.Block)
| 446 | } |
| 447 | |
| 448 | func (a *explorerAPI) formatBlock(height int32, b *types.Block) (res map[string]interface{}) { |
| 449 | queries := make([]string, 0, len(b.Acks)) |
| 450 | |
| 451 | for _, q := range b.Acks { |
| 452 | queries = append(queries, q.Hash().String()) |
| 453 | } |
| 454 | |
| 455 | return map[string]interface{}{ |
| 456 | "block": map[string]interface{}{ |
| 457 | "height": height, |
| 458 | "hash": b.BlockHash().String(), |
| 459 | "genesis_hash": b.GenesisHash().String(), |
| 460 | "timestamp": a.formatTime(b.Timestamp()), |
| 461 | "version": b.SignedHeader.Version, |
| 462 | "producer": b.Producer(), |
| 463 | "queries": queries, |
| 464 | }, |
| 465 | } |
| 466 | } |
| 467 | |
| 468 | func (a *explorerAPI) formatBlockV2(count, height int32, b *types.Block) (res map[string]interface{}) { |
| 469 | res = a.formatBlock(height, b) |
no test coverage detected