@@ -61,9 +61,9 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
61
61
62
62
val mockValidators = new MockValidatorsFailOnSpecificBlockNumber (block1.header.number)
63
63
val newMining : TestMining = mining.withVM(vm).withValidators(mockValidators)
64
- val blockValidation =
64
+ override lazy val blockValidation =
65
65
new BlockValidation (newMining, blockchainReader, BlockQueue (blockchain, blockchainReader, syncConfig))
66
- val blockExecution =
66
+ override lazy val blockExecution =
67
67
new BlockExecution (
68
68
blockchain,
69
69
blockchainReader,
@@ -103,9 +103,9 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
103
103
)
104
104
val mockValidators = new MockValidatorsFailOnSpecificBlockNumber (block2.header.number)
105
105
val newMining : TestMining = mining.withVM(mockVm).withValidators(mockValidators)
106
- val blockValidation =
106
+ override lazy val blockValidation =
107
107
new BlockValidation (newMining, blockchainReader, BlockQueue (blockchain, blockchainReader, syncConfig))
108
- val blockExecution =
108
+ override lazy val blockExecution =
109
109
new BlockExecution (
110
110
blockchain,
111
111
blockchainReader,
@@ -138,9 +138,9 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
138
138
)
139
139
val mockValidators = new MockValidatorsFailOnSpecificBlockNumber (chain.last.number)
140
140
val newMining : TestMining = mining.withVM(mockVm).withValidators(mockValidators)
141
- val blockValidation =
141
+ override lazy val blockValidation =
142
142
new BlockValidation (newMining, blockchainReader, BlockQueue (blockchain, blockchainReader, syncConfig))
143
- val blockExecution =
143
+ override lazy val blockExecution =
144
144
new BlockExecution (
145
145
blockchain,
146
146
blockchainReader,
@@ -169,9 +169,9 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
169
169
170
170
val mockValidators = MockValidatorsAlwaysSucceed
171
171
val newMining : TestMining = mining.withVM(vm).withValidators(mockValidators)
172
- val blockValidation =
172
+ override lazy val blockValidation =
173
173
new BlockValidation (newMining, blockchainReader, BlockQueue (blockchain, blockchainReader, syncConfig))
174
- val blockExecution =
174
+ override lazy val blockExecution =
175
175
new BlockExecution (
176
176
blockchain,
177
177
blockchainReader,
@@ -212,7 +212,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
212
212
213
213
txsExecResult.isRight shouldBe true
214
214
215
- val BlockResult (resultingWorldState , resultingGasUsed, resultingReceipts) = txsExecResult.toOption.get
215
+ val BlockResult (_ , resultingGasUsed, resultingReceipts) = txsExecResult.toOption.get
216
216
resultingGasUsed shouldBe 0
217
217
resultingReceipts shouldBe Nil
218
218
}
@@ -236,9 +236,9 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
236
236
237
237
val newMining : TestMining = mining.withVM(mockVm)
238
238
239
- val blockValidation =
239
+ override lazy val blockValidation =
240
240
new BlockValidation (newMining, blockchainReader, BlockQueue (blockchain, blockchainReader, syncConfig))
241
- val blockExecution =
241
+ override lazy val blockExecution =
242
242
new BlockExecution (
243
243
blockchain,
244
244
blockchainReader,
@@ -434,7 +434,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
434
434
)
435
435
val block = Block (blockHeader, blockBodyWithOmmers)
436
436
437
- val blockExecResult = blockImport. blockExecution.executeAndValidateBlock(block)
437
+ val blockExecResult = blockExecution.executeAndValidateBlock(block)
438
438
assert(blockExecResult.isRight)
439
439
}
440
440
}
@@ -481,7 +481,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
481
481
val block = Block (blockHeader, validBlockBodyWithNoTxs)
482
482
483
483
assert(seqFailingValidators.forall { _ =>
484
- val blockExecResult = blockImport. blockExecution.executeAndValidateBlock(block)
484
+ val blockExecResult = blockExecution.executeAndValidateBlock(block)
485
485
486
486
blockExecResult.left.forall {
487
487
case _ : BlockExecutionError .ValidationBeforeExecError => true
@@ -530,12 +530,12 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
530
530
)
531
531
532
532
forAll(table) { (stateRootHash, cumulativeGasUsedBlock, validators) =>
533
- val blockImport = mkBlockImport (validators = validators)
533
+ val blockExecution = mkBlockExecution (validators = validators)
534
534
val blockHeader : BlockHeader =
535
535
validBlockHeader.copy(gasUsed = cumulativeGasUsedBlock, stateRoot = stateRootHash)
536
536
val block = Block (blockHeader, validBlockBodyWithNoTxs)
537
537
538
- val blockExecResult = blockImport. blockExecution.executeAndValidateBlock(block)
538
+ val blockExecResult = blockExecution.executeAndValidateBlock(block)
539
539
540
540
assert(blockExecResult match {
541
541
case Left (_ : BlockExecutionError .ValidationAfterExecError ) => true
@@ -585,7 +585,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
585
585
val validBlockBodyWithTxs : BlockBody = validBlockBodyWithNoTxs.copy(transactionList = Seq (stx1.tx, stx2.tx))
586
586
val block = Block (validBlockHeader, validBlockBodyWithTxs)
587
587
588
- val txsExecResult = blockImport. blockExecution.executeBlockTransactions(block, initialWorld)
588
+ val txsExecResult = blockExecution.executeBlockTransactions(block, initialWorld)
589
589
590
590
assert(txsExecResult.isRight)
591
591
val BlockResult (resultingWorldState, resultingGasUsed, resultingReceipts) = txsExecResult.toOption.get
@@ -641,7 +641,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
641
641
val blockWithCorrectStateAndGasUsed = block.copy(
642
642
header = block.header.copy(stateRoot = blockExpectedStateRoot, gasUsed = gasUsedReceipt2)
643
643
)
644
- assert(blockImport. blockExecution.executeAndValidateBlock(blockWithCorrectStateAndGasUsed).isRight)
644
+ assert(blockExecution.executeAndValidateBlock(blockWithCorrectStateAndGasUsed).isRight)
645
645
}
646
646
}
647
647
@@ -662,7 +662,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
662
662
}
663
663
664
664
// We don't care about block txs in this test
665
- blockImport. blockExecution.executeBlockTransactions(
665
+ blockExecution.executeBlockTransactions(
666
666
proDaoBlock.copy(body = proDaoBlock.body.copy(transactionList = Seq .empty)),
667
667
initialWorld
668
668
)
@@ -675,7 +675,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
675
675
}
676
676
677
677
// We don't care about block txs in this test
678
- blockImport. blockExecution.executeBlockTransactions(
678
+ blockExecution.executeBlockTransactions(
679
679
proDaoBlock.copy(body = proDaoBlock.body.copy(transactionList = Seq .empty)),
680
680
initialWorld
681
681
)
@@ -684,9 +684,9 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
684
684
685
685
trait BlockExecutionTestSetup extends BlockchainSetup {
686
686
687
- val blockValidation =
687
+ override lazy val blockValidation =
688
688
new BlockValidation (mining, blockchainReader, BlockQueue (blockchain, blockchainReader, syncConfig))
689
- val blockExecution =
689
+ override lazy val blockExecution =
690
690
new BlockExecution (
691
691
blockchain,
692
692
blockchainReader,
0 commit comments