Skip to content

Commit

Permalink
fix: moved the method getRskExecutionBlock to BridgeSupoprtTestUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlen committed Dec 13, 2024
1 parent d2f8a90 commit 7a86a5d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
14 changes: 14 additions & 0 deletions rskj-core/src/test/java/co/rsk/peg/BridgeSupportTestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
}
10 changes: 0 additions & 10 deletions rskj-core/src/test/java/co/rsk/peg/RegisterBtcTransactionIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7a86a5d

Please sign in to comment.