Skip to content

Commit

Permalink
Move global variables to local method to fix sonar complain
Browse files Browse the repository at this point in the history
  • Loading branch information
julia-zack committed Sep 13, 2024
1 parent b8e2ad6 commit 744f3f7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions rskj-core/src/test/java/co/rsk/peg/BridgeSupportTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,6 @@ class SvpTests {
private Repository repository;
private BridgeStorageProvider bridgeStorageProvider;

private BtcBlockStoreWithCache.Factory btcBlockStoreFactory;
private BtcBlockStoreWithCache btcBlockStoreWithCache;
private PartialMerkleTree pmtWithTransactions;
private int btcBlockWithPmtHeight;

Expand Down Expand Up @@ -977,8 +975,8 @@ private void saveSvpFundTransactionHashUnsigned(Sha256Hash svpFundTransactionHas

private void setUpForTransactionRegistration(BtcTransaction transaction) throws BlockStoreException {
// recreate a valid chain that has the tx, so it passes the previous checks in registerBtcTransaction
btcBlockStoreFactory = new RepositoryBtcBlockStoreWithCache.Factory(btcMainnetParams, 100, 100);
btcBlockStoreWithCache = btcBlockStoreFactory.newInstance(repository, bridgeMainNetConstants, bridgeStorageProvider, activationsAfterForks);
BtcBlockStoreWithCache.Factory btcBlockStoreFactory = new RepositoryBtcBlockStoreWithCache.Factory(btcMainnetParams, 100, 100);
BtcBlockStoreWithCache btcBlockStoreWithCache = btcBlockStoreFactory.newInstance(repository, bridgeMainNetConstants, bridgeStorageProvider, activationsAfterForks);

pmtWithTransactions = createValidPmtForTransactions(Collections.singletonList(transaction.getHash()), btcMainnetParams);
btcBlockWithPmtHeight = bridgeMainNetConstants.getBtcHeightWhenPegoutTxIndexActivates() + bridgeMainNetConstants.getPegoutTxIndexGracePeriodInBtcBlocks(); // we want pegout tx index to be activated
Expand Down

0 comments on commit 744f3f7

Please sign in to comment.