(ctx context.Context, t *testing.T, db pg.DB)
| 264 | } |
| 265 | |
| 266 | func dumpBlocks(ctx context.Context, t *testing.T, db pg.DB) { |
| 267 | rows, err := db.Query(ctx, `SELECT height, block_hash FROM blocks`) |
| 268 | if err != nil { |
| 269 | t.Fatal(err) |
| 270 | } |
| 271 | defer rows.Close() |
| 272 | for rows.Next() { |
| 273 | var height uint64 |
| 274 | var hash bc.Hash |
| 275 | err = rows.Scan(&height, &hash) |
| 276 | if err != nil { |
| 277 | t.Fatal(err) |
| 278 | } |
| 279 | t.Logf("height:%d hash:%v", height, hash) |
| 280 | } |
| 281 | if rows.Err() != nil { |
| 282 | t.Fatal(rows.Err()) |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | func BenchmarkGenerateBlock(b *testing.B) { |
| 287 | b.Skip() // b.N reaches 50000 which can eventually kill the process on macosx |
no test coverage detected