Skip to content

Commit

Permalink
refactor: only use a single traceStartBlock overload in modules (#338)
Browse files Browse the repository at this point in the history
Co-authored-by: Sally MacFarlane <[email protected]>
  • Loading branch information
delehef and macfarla authored Nov 8, 2023
1 parent 91b123d commit 8f0b5a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ default void traceEndConflation() {}

default void traceStartBlock(final ProcessableBlockHeader processableBlockHeader) {}

default void traceStartBlock(final BlockHeader blockHeader, final BlockBody blockBody) {}
default void traceStartBlock(final BlockHeader blockHeader, final BlockBody blockBody) {
// Keep this one for compatibility purpose, but redirect it to the other one.
this.traceStartBlock(blockHeader);
}

default void traceEndBlock(final BlockHeader blockHeader, final BlockBody blockBody) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@
import org.hyperledger.besu.evm.log.Log;
import org.hyperledger.besu.evm.operation.Operation;
import org.hyperledger.besu.evm.worldstate.WorldView;
import org.hyperledger.besu.plugin.data.BlockBody;
import org.hyperledger.besu.plugin.data.BlockHeader;
import org.hyperledger.besu.plugin.data.ProcessableBlockHeader;

@Slf4j
Expand Down Expand Up @@ -920,11 +918,6 @@ public void traceStartBlock(final ProcessableBlockHeader processableBlockHeader)
}
}

@Override
public void traceStartBlock(final BlockHeader blockHeader, final BlockBody blockBody) {
traceStartBlock(blockHeader);
}

@Override
public void traceStartConflation(long blockCount) {
this.conflation.update();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
import org.hyperledger.besu.evm.frame.MessageFrame;
import org.hyperledger.besu.evm.log.Log;
import org.hyperledger.besu.evm.worldstate.WorldView;
import org.hyperledger.besu.plugin.data.BlockBody;
import org.hyperledger.besu.plugin.data.BlockHeader;
import org.hyperledger.besu.plugin.data.ProcessableBlockHeader;

@RequiredArgsConstructor
Expand Down Expand Up @@ -78,11 +76,6 @@ public final void traceStartBlock(final ProcessableBlockHeader blockHeader) {
this.blocks.add(new BlockSnapshot(this.blocks.size() + 1, blockHeader));
}

@Override
public final void traceStartBlock(final BlockHeader blockHeader, final BlockBody blockBody) {
this.blocks.add(new BlockSnapshot(this.blocks.size() + 1, blockHeader));
}

@Override
public void traceStartTx(WorldView worldView, Transaction tx) {
int codeIdBeforeLex = 0;
Expand Down

0 comments on commit 8f0b5a1

Please sign in to comment.