diff --git a/rskj-core/src/main/java/co/rsk/peg/BridgeUtils.java b/rskj-core/src/main/java/co/rsk/peg/BridgeUtils.java index 1f044e6850..0d3d7a86b3 100644 --- a/rskj-core/src/main/java/co/rsk/peg/BridgeUtils.java +++ b/rskj-core/src/main/java/co/rsk/peg/BridgeUtils.java @@ -17,6 +17,8 @@ */ package co.rsk.peg; +import static org.ethereum.config.blockchain.upgrades.ConsensusRule.*; + import co.rsk.bitcoinj.core.*; import co.rsk.bitcoinj.crypto.TransactionSignature; import co.rsk.bitcoinj.script.*; @@ -53,8 +55,6 @@ import java.util.List; import java.util.stream.Collectors; -import static org.ethereum.config.blockchain.upgrades.ConsensusRule.*; - /** * @author Oscar Guindzberg */ @@ -621,8 +621,7 @@ public static int calculatePegoutTxSize(ActivationConfig.ForBlock activations, F } public static Script getFederationMembersP2SHScript(ActivationConfig.ForBlock activations, Federation federation) { - // when the federation is a standard multisig, - // the members p2sh script is the p2sh script + // when the federation is a standard multisig, the members p2sh script is the p2sh script if (!activations.isActive(RSKIP377)) { return federation.getP2SHScript(); } @@ -630,8 +629,7 @@ public static Script getFederationMembersP2SHScript(ActivationConfig.ForBlock ac return federation.getP2SHScript(); } - // when the federation also has erp keys, - // the members p2sh script is the default p2sh script + // when the federation also has erp keys, the members p2sh script is the default p2sh script return ((ErpFederation) federation).getDefaultP2SHScript(); } } diff --git a/rskj-core/src/main/java/co/rsk/peg/federation/FederationSupportImpl.java b/rskj-core/src/main/java/co/rsk/peg/federation/FederationSupportImpl.java index 6c6e2ae82e..3371a8bc04 100644 --- a/rskj-core/src/main/java/co/rsk/peg/federation/FederationSupportImpl.java +++ b/rskj-core/src/main/java/co/rsk/peg/federation/FederationSupportImpl.java @@ -706,7 +706,7 @@ private FederationChangeResponseCode legacyCommitPendingFederation(PendingFedera public void commitProposedFederation() { Federation proposedFederation = provider.getProposedFederation(constants, activations) - .orElseThrow(IllegalStateException::new); + .orElseThrow(IllegalStateException::new); handoverToNewFederation(proposedFederation); clearProposedFederation(); diff --git a/rskj-core/src/test/java/co/rsk/peg/BridgeSupportSvpTest.java b/rskj-core/src/test/java/co/rsk/peg/BridgeSupportSvpTest.java index c4ef1bf58c..8230840aea 100644 --- a/rskj-core/src/test/java/co/rsk/peg/BridgeSupportSvpTest.java +++ b/rskj-core/src/test/java/co/rsk/peg/BridgeSupportSvpTest.java @@ -35,7 +35,6 @@ import java.io.IOException; import java.util.*; import java.util.stream.IntStream; - import co.rsk.test.builders.FederationSupportBuilder; import org.ethereum.config.blockchain.upgrades.ActivationConfig; import org.ethereum.config.blockchain.upgrades.ActivationConfigsForTest; diff --git a/rskj-core/src/test/java/co/rsk/peg/federation/VoteFederationChangeTest.java b/rskj-core/src/test/java/co/rsk/peg/federation/VoteFederationChangeTest.java index 8270e8499e..975524c54e 100644 --- a/rskj-core/src/test/java/co/rsk/peg/federation/VoteFederationChangeTest.java +++ b/rskj-core/src/test/java/co/rsk/peg/federation/VoteFederationChangeTest.java @@ -1,5 +1,11 @@ package co.rsk.peg.federation; +import static co.rsk.peg.BridgeUtils.getFederationMembersP2SHScript; +import static co.rsk.peg.bitcoin.BitcoinTestUtils.flatKeysAsByteArray; +import static co.rsk.peg.federation.FederationStorageIndexKey.NEW_FEDERATION_BTC_UTXOS_KEY; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.mock; + import co.rsk.bitcoinj.core.BtcECKey; import co.rsk.bitcoinj.core.UTXO; import co.rsk.bitcoinj.script.Script; @@ -29,18 +35,11 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; - import java.math.BigInteger; import java.time.Instant; import java.util.*; import java.util.stream.Stream; -import static co.rsk.peg.BridgeUtils.getFederationMembersP2SHScript; -import static co.rsk.peg.bitcoin.BitcoinTestUtils.flatKeysAsByteArray; -import static co.rsk.peg.federation.FederationStorageIndexKey.NEW_FEDERATION_BTC_UTXOS_KEY; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.mock; - class VoteFederationChangeTest { private static final FederationConstants federationMainnetConstants = FederationMainNetConstants.getInstance(); private static final BtcECKey federatorBtcKey = BtcECKey.fromPrivate(BigInteger.valueOf(100));