Skip to content

Commit

Permalink
7311: Replace EthProtocolManagerTestUtil.create(Blockchain)
Browse files Browse the repository at this point in the history
Signed-off-by: Matilda Clerke <[email protected]>
  • Loading branch information
Matilda-Clerke committed Nov 28, 2024
1 parent 30ba106 commit c8b6e28
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.hyperledger.besu.ethereum.difficulty.fixed.FixedDifficultyProtocolSchedule;
import org.hyperledger.besu.ethereum.eth.manager.ChainState;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManagerTestBuilder;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManagerTestUtil;
import org.hyperledger.besu.ethereum.eth.manager.RespondingEthPeer;
import org.hyperledger.besu.ethereum.eth.manager.RespondingEthPeer.Responder;
Expand Down Expand Up @@ -76,7 +77,7 @@ public Stream<? extends Arguments> provideArguments(final ExtensionContext conte
public void setup(final DataStorageFormat storageFormat) {
blockchainSetupUtil = BlockchainSetupUtil.forTesting(storageFormat);
blockchain = blockchainSetupUtil.getBlockchain();
ethProtocolManager = EthProtocolManagerTestUtil.create(blockchain);
ethProtocolManager = EthProtocolManagerTestBuilder.builder().setBlockchain(blockchain).build();
respondingPeer =
RespondingEthPeer.builder()
.ethProtocolManager(ethProtocolManager)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.hyperledger.besu.ethereum.core.BlockchainSetupUtil;
import org.hyperledger.besu.ethereum.eth.manager.EthPeer;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManagerTestBuilder;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManagerTestUtil;
import org.hyperledger.besu.ethereum.eth.manager.RespondingEthPeer;
import org.hyperledger.besu.ethereum.eth.sync.range.RangeHeaders;
Expand Down Expand Up @@ -65,7 +66,7 @@ public static void setUpClass() {

@BeforeEach
public void setUp() {
ethProtocolManager = EthProtocolManagerTestUtil.create(blockchain);
ethProtocolManager = EthProtocolManagerTestBuilder.builder().setBlockchain(blockchain).build();
downloader =
new DownloadHeadersStep(
protocolSchedule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.hyperledger.besu.ethereum.eth.manager.EthPeer;
import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManagerTestBuilder;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManagerTestUtil;
import org.hyperledger.besu.ethereum.eth.manager.RespondingEthPeer;
import org.hyperledger.besu.ethereum.p2p.rlpx.wire.messages.DisconnectMessage.DisconnectReason;
Expand Down Expand Up @@ -90,7 +91,7 @@ public class SyncStateTest {

@BeforeEach
public void setUp() {
ethProtocolManager = EthProtocolManagerTestUtil.create(blockchain);
ethProtocolManager = EthProtocolManagerTestBuilder.builder().setBlockchain(blockchain).build();
ethPeers = spy(ethProtocolManager.ethContext().getEthPeers());
syncTargetPeer = createPeer(TARGET_DIFFICULTY, TARGET_CHAIN_HEIGHT);
otherPeer = createPeer(Difficulty.ZERO, 0);
Expand Down

0 comments on commit c8b6e28

Please sign in to comment.