MCPcopy Create free account
hub / github.com/chain/Core / dumpBlocks

Function dumpBlocks

core/txbuilder/finalize_test.go:266–284  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T, db pg.DB)

Source from the content-addressed store, hash-verified

264}
265
266func 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
286func BenchmarkGenerateBlock(b *testing.B) {
287 b.Skip() // b.N reaches 50000 which can eventually kill the process on macosx

Callers 2

TestConflictingTxsInPoolFunction · 0.85
TestTransferConfirmedFunction · 0.85

Calls 5

NextMethod · 0.80
QueryMethod · 0.65
CloseMethod · 0.45
ScanMethod · 0.45
ErrMethod · 0.45

Tested by

no test coverage detected