@@ -62,7 +62,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
62
62
val mockValidators = new MockValidatorsFailOnSpecificBlockNumber (block1.header.number)
63
63
val newMining : TestMining = mining.withVM(vm).withValidators(mockValidators)
64
64
override lazy val blockValidation =
65
- new BlockValidation (newMining, blockchainReader, BlockQueue (blockchain, blockchainReader, syncConfig))
65
+ new BlockValidation (newMining, blockchainReader, BlockQueue (blockchainReader, syncConfig))
66
66
override lazy val blockExecution =
67
67
new BlockExecution (
68
68
blockchain,
@@ -104,7 +104,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
104
104
val mockValidators = new MockValidatorsFailOnSpecificBlockNumber (block2.header.number)
105
105
val newMining : TestMining = mining.withVM(mockVm).withValidators(mockValidators)
106
106
override lazy val blockValidation =
107
- new BlockValidation (newMining, blockchainReader, BlockQueue (blockchain, blockchainReader, syncConfig))
107
+ new BlockValidation (newMining, blockchainReader, BlockQueue (blockchainReader, syncConfig))
108
108
override lazy val blockExecution =
109
109
new BlockExecution (
110
110
blockchain,
@@ -139,7 +139,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
139
139
val mockValidators = new MockValidatorsFailOnSpecificBlockNumber (chain.last.number)
140
140
val newMining : TestMining = mining.withVM(mockVm).withValidators(mockValidators)
141
141
override lazy val blockValidation =
142
- new BlockValidation (newMining, blockchainReader, BlockQueue (blockchain, blockchainReader, syncConfig))
142
+ new BlockValidation (newMining, blockchainReader, BlockQueue (blockchainReader, syncConfig))
143
143
override lazy val blockExecution =
144
144
new BlockExecution (
145
145
blockchain,
@@ -170,7 +170,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
170
170
val mockValidators = MockValidatorsAlwaysSucceed
171
171
val newMining : TestMining = mining.withVM(vm).withValidators(mockValidators)
172
172
override lazy val blockValidation =
173
- new BlockValidation (newMining, blockchainReader, BlockQueue (blockchain, blockchainReader, syncConfig))
173
+ new BlockValidation (newMining, blockchainReader, BlockQueue (blockchainReader, syncConfig))
174
174
override lazy val blockExecution =
175
175
new BlockExecution (
176
176
blockchain,
@@ -237,7 +237,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
237
237
val newMining : TestMining = mining.withVM(mockVm)
238
238
239
239
override lazy val blockValidation =
240
- new BlockValidation (newMining, blockchainReader, BlockQueue (blockchain, blockchainReader, syncConfig))
240
+ new BlockValidation (newMining, blockchainReader, BlockQueue (blockchainReader, syncConfig))
241
241
override lazy val blockExecution =
242
242
new BlockExecution (
243
243
blockchain,
@@ -262,7 +262,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
262
262
originAddress -> UpdateBalance (- minerPaymentForTxs), // Origin payment for tx execution and nonce increase
263
263
minerAddress -> UpdateBalance (minerPaymentForTxs) // Miner reward for tx execution
264
264
)
265
- val expectedStateRoot : ByteString = applyChanges(validBlockParentHeader.stateRoot, blockchainStorages, changes)
265
+ val expectedStateRoot : ByteString = applyChanges(validBlockParentHeader.stateRoot, changes)
266
266
expectedStateRoot shouldBe InMemoryWorldStateProxy .persistState(resultingWorldState).stateRootHash
267
267
268
268
// Check valid gasUsed
@@ -315,7 +315,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
315
315
316
316
val newConsensus = mining.withValidators(mockValidators).withVM(mockVm)
317
317
val blockValidation =
318
- new BlockValidation (newConsensus, blockchainReader, BlockQueue (blockchain, blockchainReader, syncConfig))
318
+ new BlockValidation (newConsensus, blockchainReader, BlockQueue (blockchainReader, syncConfig))
319
319
val blockExecution =
320
320
new BlockExecution (
321
321
blockchain,
@@ -340,7 +340,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
340
340
originAddress -> UpdateBalance (- minerPaymentForTxs), // Origin payment for tx execution and nonce increase
341
341
minerAddress -> UpdateBalance (minerPaymentForTxs) // Miner reward for tx execution
342
342
) ++ addressesToDelete.map(address => address -> DeleteAccount ) // Delete all accounts to be deleted
343
- val expectedStateRoot = applyChanges(validBlockParentHeader.stateRoot, blockchainStorages, changes)
343
+ val expectedStateRoot = applyChanges(validBlockParentHeader.stateRoot, changes)
344
344
expectedStateRoot shouldBe InMemoryWorldStateProxy .persistState(resultingWorldState).stateRootHash
345
345
346
346
// Check valid gasUsed
@@ -421,7 +421,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
421
421
ommerAddress -> UpdateBalance (UInt256 (ommerReward))
422
422
}
423
423
424
- val expectedStateRoot = applyChanges(validBlockParentHeader.stateRoot, blockchainStorages, changes)
424
+ val expectedStateRoot = applyChanges(validBlockParentHeader.stateRoot, changes)
425
425
426
426
val blockHeader : BlockHeader = validBlockHeader.copy(stateRoot = expectedStateRoot)
427
427
val blockBodyWithOmmers = validBlockBodyWithNoTxs.copy(
@@ -476,7 +476,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
476
476
val changes = Seq (
477
477
minerAddress -> UpdateBalance (UInt256 (blockReward)) // Paying miner for block processing
478
478
)
479
- val expectedStateRoot : ByteString = applyChanges(validBlockParentHeader.stateRoot, blockchainStorages, changes)
479
+ val expectedStateRoot : ByteString = applyChanges(validBlockParentHeader.stateRoot, changes)
480
480
val blockHeader : BlockHeader = validBlockHeader.copy(stateRoot = expectedStateRoot)
481
481
val block = Block (blockHeader, validBlockBodyWithNoTxs)
482
482
@@ -517,7 +517,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
517
517
mining.blockPreparator.blockRewardCalculator.calculateMiningReward(validBlockHeader.number, 0 )
518
518
519
519
val changes = Seq (minerAddress -> UpdateBalance (UInt256 (blockReward))) // Paying miner for block processing
520
- val correctStateRoot : ByteString = applyChanges(validBlockParentHeader.stateRoot, blockchainStorages, changes)
520
+ val correctStateRoot : ByteString = applyChanges(validBlockParentHeader.stateRoot, changes)
521
521
522
522
val correctGasUsed : BigInt = 0
523
523
val incorrectStateRoot : ByteString =
@@ -605,7 +605,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
605
605
origin1Address -> UpdateBalance (- minerPaymentForTx1), // Origin payment for tx execution and nonce increase
606
606
minerAddress -> UpdateBalance (minerPaymentForTx1) // Miner reward for tx execution
607
607
)
608
- val expectedStateRootTx1 = applyChanges(validBlockParentHeader.stateRoot, blockchainStorages, changesTx1)
608
+ val expectedStateRootTx1 = applyChanges(validBlockParentHeader.stateRoot, changesTx1)
609
609
610
610
val Receipt (rootHashReceipt1, gasUsedReceipt1, logsBloomFilterReceipt1, logsReceipt1) = receipt1
611
611
rootHashReceipt1 shouldBe HashOutcome (expectedStateRootTx1)
@@ -620,7 +620,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
620
620
origin2Address -> UpdateBalance (- minerPaymentForTx2), // Origin payment for tx execution and nonce increase
621
621
minerAddress -> UpdateBalance (minerPaymentForTx2) // Miner reward for tx execution
622
622
)
623
- val expectedStateRootTx2 = applyChanges(expectedStateRootTx1, blockchainStorages, changesTx2)
623
+ val expectedStateRootTx2 = applyChanges(expectedStateRootTx1, changesTx2)
624
624
625
625
val Receipt (rootHashReceipt2, gasUsedReceipt2, logsBloomFilterReceipt2, logsReceipt2) = receipt2
626
626
rootHashReceipt2 shouldBe HashOutcome (expectedStateRootTx2)
@@ -636,7 +636,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
636
636
val changes = Seq (
637
637
minerAddress -> UpdateBalance (UInt256 (blockReward))
638
638
)
639
- val blockExpectedStateRoot = applyChanges(expectedStateRootTx2, blockchainStorages, changes)
639
+ val blockExpectedStateRoot = applyChanges(expectedStateRootTx2, changes)
640
640
641
641
val blockWithCorrectStateAndGasUsed = block.copy(
642
642
header = block.header.copy(stateRoot = blockExpectedStateRoot, gasUsed = gasUsedReceipt2)
@@ -685,7 +685,7 @@ class BlockExecutionSpec extends AnyWordSpec with Matchers with ScalaCheckProper
685
685
trait BlockExecutionTestSetup extends BlockchainSetup {
686
686
687
687
override lazy val blockValidation =
688
- new BlockValidation (mining, blockchainReader, BlockQueue (blockchain, blockchainReader, syncConfig))
688
+ new BlockValidation (mining, blockchainReader, BlockQueue (blockchainReader, syncConfig))
689
689
override lazy val blockExecution =
690
690
new BlockExecution (
691
691
blockchain,
0 commit comments