fix tests for new block insertion

pull/4465/head
“GheisMohammadi” 1 year ago
parent 91034682c7
commit cfc94bb4e1
No known key found for this signature in database
GPG Key ID: 15073AED3829FE90
  1. 6
      hmy/downloader/adapter_test.go
  2. 2
      node/node_newblock_test.go

@ -60,7 +60,7 @@ func (bc *testBlockChain) currentBlockNumber() uint64 {
return bc.curBN
}
func (bc *testBlockChain) InsertChain(chain types.Blocks, verifyHeaders bool) (int, error) {
func (bc *testBlockChain) InsertChain(chain types.Blocks, verifyHeaders bool, blockExecution bool) (int, error) {
bc.lock.Lock()
defer bc.lock.Unlock()
@ -169,11 +169,11 @@ type testInsertHelper struct {
}
func (ch *testInsertHelper) verifyAndInsertBlock(block *types.Block) error {
_, err := ch.bc.InsertChain(types.Blocks{block}, true)
_, err := ch.bc.InsertChain(types.Blocks{block}, true, true)
return err
}
func (ch *testInsertHelper) verifyAndInsertBlocks(blocks types.Blocks) (int, error) {
return ch.bc.InsertChain(blocks, true)
return ch.bc.InsertChain(blocks, true, true)
}
const (

@ -78,7 +78,7 @@ func TestFinalizeNewBlockAsync(t *testing.T) {
t.Error("New block is not verified successfully:", err)
}
node.Blockchain().InsertChain(types.Blocks{block}, false)
node.Blockchain().InsertChain(types.Blocks{block}, false, true)
node.Worker.UpdateCurrent()

Loading…
Cancel
Save