From 7a86a5d4001b9b12060b62d290da3bbd61cd4d7f Mon Sep 17 00:00:00 2001 From: Julian Len Date: Fri, 13 Dec 2024 17:19:44 -0300 Subject: [PATCH] fix: moved the method getRskExecutionBlock to BridgeSupoprtTestUtil --- .../java/co/rsk/peg/BridgeSupportTestUtil.java | 14 ++++++++++++++ .../java/co/rsk/peg/RegisterBtcTransactionIT.java | 10 ---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/rskj-core/src/test/java/co/rsk/peg/BridgeSupportTestUtil.java b/rskj-core/src/test/java/co/rsk/peg/BridgeSupportTestUtil.java index 1465821770..12f19b9f56 100644 --- a/rskj-core/src/test/java/co/rsk/peg/BridgeSupportTestUtil.java +++ b/rskj-core/src/test/java/co/rsk/peg/BridgeSupportTestUtil.java @@ -15,6 +15,10 @@ import java.math.BigInteger; import java.util.*; import org.bouncycastle.util.encoders.Hex; +import org.ethereum.config.blockchain.upgrades.ActivationConfig; +import org.ethereum.core.Block; +import org.ethereum.core.BlockHeader; +import org.ethereum.core.BlockHeaderBuilder; import org.ethereum.core.Repository; import org.ethereum.db.MutableRepository; @@ -90,4 +94,14 @@ public static FederationStorageProvider createFederationStorageProvider(Reposito StorageAccessor bridgeStorageAccessor = new BridgeStorageAccessorImpl(repository); return new FederationStorageProviderImpl(bridgeStorageAccessor); } + + public static Block getRskExecutionBlock() { + long rskExecutionBlockNumber = 1000L; + long rskExecutionBlockTimestamp = 10L; + BlockHeader blockHeader = new BlockHeaderBuilder(mock(ActivationConfig.class)) + .setNumber(rskExecutionBlockNumber) + .setTimestamp(rskExecutionBlockTimestamp) + .build(); + return Block.createBlockFromHeader(blockHeader, true); + } } diff --git a/rskj-core/src/test/java/co/rsk/peg/RegisterBtcTransactionIT.java b/rskj-core/src/test/java/co/rsk/peg/RegisterBtcTransactionIT.java index d6f2ad68b4..88bbf1407d 100644 --- a/rskj-core/src/test/java/co/rsk/peg/RegisterBtcTransactionIT.java +++ b/rskj-core/src/test/java/co/rsk/peg/RegisterBtcTransactionIT.java @@ -132,16 +132,6 @@ private static FeePerKbSupport getFeePerKbSupport(Repository repository, BridgeC ); } - private static Block getRskExecutionBlock() { - long rskExecutionBlockNumber = 1000L; - long rskExecutionBlockTimestamp = 10L; - BlockHeader blockHeader = new BlockHeaderBuilder(mock(ActivationConfig.class)) - .setNumber(rskExecutionBlockNumber) - .setTimestamp(rskExecutionBlockTimestamp) - .build(); - return Block.createBlockFromHeader(blockHeader, true); - } - private BridgeSupport getBridgeSupport(BridgeEventLoggerImpl bridgeEventLogger, BridgeStorageProvider bridgeStorageProvider, ActivationConfig.ForBlock activationsBeforeForks, FederationSupport federationSupport, FeePerKbSupport feePerKbSupport, Block rskExecutionBlock, BtcBlockStoreWithCache.Factory btcBlockStoreFactory, Repository repository, BtcLockSenderProvider btcLockSenderProvider) { return bridgeSupportBuilder .withBridgeConstants(bridgeConstants)