[MINOR] Suicides mixing coinbase (#110)

* naive solution

* cleaning it up

* restrict to only suicide tests

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
S. Matthew English 6 years ago committed by GitHub
parent 4a9587ac75
commit 4954482614
  1. 17
      ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/vm/GeneralStateReferenceTestTools.java

@ -86,14 +86,6 @@ public class GeneralStateReferenceTestTools {
// Consumes a huge amount of memory // Consumes a huge amount of memory
params.blacklist("static_Call1MB1024Calldepth-(Byzantium|Constantinople)"); params.blacklist("static_Call1MB1024Calldepth-(Byzantium|Constantinople)");
// Needs investigation (tests pass in other clients)
params.blacklist("suicideCoinbase-Frontier");
params.blacklist("suicideCoinbase-Homestead");
params.blacklist("SuicidesMixingCoinbase-Frontier\\[0\\]");
params.blacklist("SuicidesMixingCoinbase-Frontier\\[1\\]");
params.blacklist("SuicidesMixingCoinbase-Homestead\\[0\\]");
params.blacklist("SuicidesMixingCoinbase-Homestead\\[1\\]");
// Constantinople failures to investigate // Constantinople failures to investigate
params.blacklist("RevertInCreateInInitCreate2-Constantinople"); params.blacklist("RevertInCreateInInitCreate2-Constantinople");
params.blacklist("RevertInCreateInInit-Constantinople"); params.blacklist("RevertInCreateInInit-Constantinople");
@ -128,12 +120,9 @@ public class GeneralStateReferenceTestTools {
transaction, transaction,
blockHeader.getCoinbase(), blockHeader.getCoinbase(),
new BlockHashLookup(blockHeader, blockchain)); new BlockHashLookup(blockHeader, blockchain));
final Account coinbase = worldStateUpdater.getOrCreate(spec.blockHeader().getCoinbase());
if (result.isInvalid()) { if (coinbase != null && coinbase.isEmpty() && shouldClearEmptyAccounts(spec.eip())) {
final Account coinbase = worldStateUpdater.getOrCreate(spec.blockHeader().getCoinbase()); worldStateUpdater.deleteAccount(coinbase.getAddress());
if (coinbase != null && coinbase.isEmpty() && shouldClearEmptyAccounts(spec.eip())) {
worldStateUpdater.deleteAccount(coinbase.getAddress());
}
} }
worldStateUpdater.commit(); worldStateUpdater.commit();

Loading…
Cancel
Save