Skip to content

Commit 7a66335

Browse files
OlivierBBBamkCha
authored andcommitted
feat: add runWithBesu field to MultiBlockExecutionEnvironement
1 parent 5b879ed commit 7a66335

File tree

1 file changed

+1
-40
lines changed

1 file changed

+1
-40
lines changed

testing/src/main/java/net/consensys/linea/testing/MultiBlockExecutionEnvironment.java

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ public MultiBlockExecutionEnvironmentBuilder addBlock(
120120
}
121121

122122
public void run() {
123-
<<<<<<< HEAD
124-
if (System.getenv().containsKey("RUN_WITH_BESU_NODE")) {
123+
if (runWithBesuNode || System.getenv().containsKey("RUN_WITH_BESU_NODE")) {
125124
List<Transaction> transactionsIncludingNullTransactionsForEmptyBlocks = new ArrayList<>();
126125
for (BlockSnapshot block : blocks) {
127126
if (block.txs().isEmpty()) {
@@ -132,17 +131,6 @@ public void run() {
132131
transactionsIncludingNullTransactionsForEmptyBlocks.add(txSnapshot.toTransaction());
133132
}
134133
}
135-
=======
136-
if (runWithBesuNode || System.getenv().containsKey("RUN_WITH_BESU_NODE")) {
137-
List<Transaction> transactionsIncludingNullTransactionsForEmptyBlocks = new ArrayList<>();
138-
for (BlockSnapshot block : blocks) {
139-
if (block.txs().isEmpty()) {
140-
// Add a null transaction to represent an empty block
141-
transactionsIncludingNullTransactionsForEmptyBlocks.add(null);
142-
} else {
143-
for (TransactionSnapshot txSnapshot : block.txs()) {
144-
transactionsIncludingNullTransactionsForEmptyBlocks.add(txSnapshot.toTransaction());
145-
>>>>>>> c2c824704 (feat: add runWithBesu field to MultiBlockExecutionEnvironement)
146134
}
147135
BesuExecutionTools besuExecTools =
148136
new BesuExecutionTools(
@@ -168,33 +156,6 @@ >>>>>>> c2c824704 (feat: add runWithBesu field to MultiBlockExecutionEnvironemen
168156
.build()
169157
.replay(testsChain, testInfo, conflationSnapshot);
170158
}
171-
<<<<<<< HEAD
172-
=======
173-
BesuExecutionTools besuExecTools =
174-
new BesuExecutionTools(
175-
Optional.of(testInfo),
176-
chainConfig,
177-
ToyExecutionEnvironmentV2.DEFAULT_COINBASE_ADDRESS,
178-
accounts,
179-
transactionsIncludingNullTransactionsForEmptyBlocks,
180-
true,
181-
null);
182-
besuExecTools.executeTest();
183-
return;
184-
}
185-
final ConflationSnapshot conflationSnapshot = buildConflationSnapshot();
186-
final Map<Long, Hash> historicalBlockhashes = conflationSnapshot.historicalBlockHashes();
187-
// Remove the last block number as it's not part of the historical blockhashes
188-
historicalBlockhashes.remove(conflationSnapshot.lastBlockNumber());
189-
tracer = new ZkTracer(chainConfig, historicalBlockhashes);
190-
ReplayExecutionEnvironment.builder()
191-
.zkTracer(tracer)
192-
.useCoinbaseAddressFromBlockHeader(true)
193-
.transactionProcessingResultValidator(transactionProcessingResultValidator)
194-
.systemContractDeployedPriorToConflation(systemContractDeployedPriorToConflation)
195-
.build()
196-
.replay(testsChain, testInfo, conflationSnapshot);
197-
>>>>>>> 68a7a6f97 (feat: configurable fork)
198159
}
199160

200161
public Hub getHub() {

0 commit comments

Comments
 (0)