Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: Use correct CHAINID in EVM #947

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class ToyExecutionEnvironment {
Hash.fromHexStringLenient("0xdeadbeef123123666dead666dead666");

private final ToyWorld toyWorld;
private final EVM evm = MainnetEVMs.london(EvmConfiguration.DEFAULT);

@Builder.Default private BigInteger chainId = CHAIN_ID;
@Singular private final List<Transaction> transactions;

Expand Down Expand Up @@ -217,7 +217,9 @@ private void execute() {
}

private MainnetTransactionProcessor getMainnetTransactionProcessor() {

// Construct EVM for executing transactions.
final EVM evm = MainnetEVMs.london(this.chainId, EvmConfiguration.DEFAULT);
//
PrecompileContractRegistry precompileContractRegistry = new PrecompileContractRegistry();

MainnetPrecompiledContracts.populateForIstanbul(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ public class ToyExecutionEnvironmentV2 {
private static final long DEFAULT_TIME_STAMP = 1347310;
private static final Hash DEFAULT_HASH =
Hash.fromHexStringLenient("0xdeadbeef123123666dead666dead666");
private static final EVM evm = MainnetEVMs.london(EvmConfiguration.DEFAULT);
private static final FeeMarket feeMarket = FeeMarket.london(-1);

@Builder.Default private BigInteger chainId = CHAIN_ID;
private final ToyWorld toyWorld;
@Singular private final List<Transaction> transactions;

public void run() {
final EVM evm = MainnetEVMs.london(this.chainId, EvmConfiguration.DEFAULT);
GeneralStateReferenceTestTools.executeTest(
this.buildGeneralStateTestCaseSpec(), getMainnetTransactionProcessor(), feeMarket);
this.buildGeneralStateTestCaseSpec(evm), getMainnetTransactionProcessor(evm), feeMarket);
}

public GeneralStateTestCaseEipSpec buildGeneralStateTestCaseSpec() {
public GeneralStateTestCaseEipSpec buildGeneralStateTestCaseSpec(EVM evm) {
Map<String, ReferenceTestWorldState.AccountMock> accountMockMap =
toyWorld.getAddressAccountMap().entrySet().stream()
.collect(
Expand Down Expand Up @@ -113,8 +113,7 @@ public GeneralStateTestCaseEipSpec buildGeneralStateTestCaseSpec() {
/*expectException*/ null);
}

private MainnetTransactionProcessor getMainnetTransactionProcessor() {

private MainnetTransactionProcessor getMainnetTransactionProcessor(EVM evm) {
PrecompileContractRegistry precompileContractRegistry = new PrecompileContractRegistry();

MainnetPrecompiledContracts.populateForIstanbul(
Expand Down
Loading