mirror of
https://github.com/trezor/blockbook.git
synced 2026-02-19 16:31:19 +01:00
test(sync): update OnNewBlock callbacks to block arg
This commit is contained in:
@@ -32,11 +32,11 @@ func testConnectBlocks(t *testing.T, h *TestHandler) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
err = db.ConnectBlocks(sw, func(hash string, height uint32) {
|
||||
if hash == upperHash {
|
||||
close(ch)
|
||||
}
|
||||
}, true)
|
||||
err = db.ConnectBlocks(sw, func(block *bchain.Block) {
|
||||
if block != nil && block.Hash == upperHash {
|
||||
close(ch)
|
||||
}
|
||||
}, true)
|
||||
if err != nil && err != db.ErrOperationInterrupted {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -88,11 +88,11 @@ func testHandleFork(t *testing.T, h *TestHandler) {
|
||||
chain.returnFakes = false
|
||||
|
||||
upperHash := fakeBlocks[len(fakeBlocks)-1].Hash
|
||||
db.HandleFork(sw, rng.Upper, upperHash, func(hash string, height uint32) {
|
||||
if hash == upperHash {
|
||||
close(ch)
|
||||
}
|
||||
}, true)
|
||||
db.HandleFork(sw, rng.Upper, upperHash, func(block *bchain.Block) {
|
||||
if block != nil && block.Hash == upperHash {
|
||||
close(ch)
|
||||
}
|
||||
}, true)
|
||||
|
||||
realBlocks := getRealBlocks(h, rng)
|
||||
realTxs, err := getTxs(h, d, rng, realBlocks)
|
||||
|
||||
Reference in New Issue
Block a user