From 00b57eafdb9333364d027ee39c3aa1984b8f4a61 Mon Sep 17 00:00:00 2001 From: Marcos Date: Tue, 5 Mar 2024 16:05:25 -0300 Subject: [PATCH] Add missing imports --- .../java/co/rsk/peg/BridgeSupportFactory.java | 3 +- .../rsk/remasc/RemascFederationProvider.java | 2 +- .../src/test/java/co/rsk/peg/BridgeTest.java | 1 + .../peg/federation/P2shErpFederationTest.java | 41 +++++++++---------- .../remasc/RemascFederationProviderTest.java | 12 +++--- 5 files changed, 29 insertions(+), 30 deletions(-) diff --git a/rskj-core/src/main/java/co/rsk/peg/BridgeSupportFactory.java b/rskj-core/src/main/java/co/rsk/peg/BridgeSupportFactory.java index dcc9b9b8235..4c68f041258 100644 --- a/rskj-core/src/main/java/co/rsk/peg/BridgeSupportFactory.java +++ b/rskj-core/src/main/java/co/rsk/peg/BridgeSupportFactory.java @@ -25,9 +25,8 @@ import co.rsk.peg.pegininstructions.PeginInstructionsProvider; import co.rsk.peg.utils.BridgeEventLogger; import co.rsk.peg.utils.BridgeEventLoggerImpl; -import java.util.List; - import co.rsk.peg.utils.BrigeEventLoggerLegacyImpl; +import java.util.List; import org.ethereum.config.blockchain.upgrades.ActivationConfig; import org.ethereum.config.blockchain.upgrades.ConsensusRule; import org.ethereum.core.Block; diff --git a/rskj-core/src/main/java/co/rsk/remasc/RemascFederationProvider.java b/rskj-core/src/main/java/co/rsk/remasc/RemascFederationProvider.java index 2d76cc3198a..de2b294947d 100644 --- a/rskj-core/src/main/java/co/rsk/remasc/RemascFederationProvider.java +++ b/rskj-core/src/main/java/co/rsk/remasc/RemascFederationProvider.java @@ -18,8 +18,8 @@ package co.rsk.remasc; import co.rsk.core.RskAddress; -import co.rsk.peg.FederationMember; import co.rsk.peg.FederationSupport; +import co.rsk.peg.federation.FederationMember; import org.ethereum.config.blockchain.upgrades.ActivationConfig; import org.ethereum.config.blockchain.upgrades.ConsensusRule; import org.ethereum.crypto.ECKey; diff --git a/rskj-core/src/test/java/co/rsk/peg/BridgeTest.java b/rskj-core/src/test/java/co/rsk/peg/BridgeTest.java index 1877e27fe7c..6b5e92d3693 100644 --- a/rskj-core/src/test/java/co/rsk/peg/BridgeTest.java +++ b/rskj-core/src/test/java/co/rsk/peg/BridgeTest.java @@ -19,6 +19,7 @@ import co.rsk.peg.federation.Federation; import co.rsk.peg.federation.FederationArgs; import co.rsk.peg.federation.FederationFactory; +import co.rsk.peg.federation.FederationMember; import co.rsk.peg.federation.FederationMember.KeyType; import co.rsk.peg.federation.FederationTestUtils; import co.rsk.peg.flyover.FlyoverTxResponseCodes; diff --git a/rskj-core/src/test/java/co/rsk/peg/federation/P2shErpFederationTest.java b/rskj-core/src/test/java/co/rsk/peg/federation/P2shErpFederationTest.java index dbf05b20e5c..5fcace9599d 100644 --- a/rskj-core/src/test/java/co/rsk/peg/federation/P2shErpFederationTest.java +++ b/rskj-core/src/test/java/co/rsk/peg/federation/P2shErpFederationTest.java @@ -1,36 +1,28 @@ package co.rsk.peg.federation; import static co.rsk.bitcoinj.script.Script.MAX_SCRIPT_ELEMENT_SIZE; -import static co.rsk.peg.federation.ErpFederationCreationException.Reason.NULL_OR_EMPTY_EMERGENCY_KEYS; -import static co.rsk.peg.federation.ErpFederationCreationException.Reason.REDEEM_SCRIPT_CREATION_FAILED; import static co.rsk.peg.bitcoin.RedeemScriptCreationException.Reason.INVALID_CSV_VALUE; import static co.rsk.peg.bitcoin.ScriptCreationException.Reason.ABOVE_MAX_SCRIPT_ELEMENT_SIZE; +import static co.rsk.peg.federation.ErpFederationCreationException.Reason.NULL_OR_EMPTY_EMERGENCY_KEYS; +import static co.rsk.peg.federation.ErpFederationCreationException.Reason.REDEEM_SCRIPT_CREATION_FAILED; import static org.junit.jupiter.api.Assertions.*; import co.rsk.bitcoinj.core.*; -import co.rsk.bitcoinj.script.*; -import co.rsk.config.BridgeConstants; -import co.rsk.config.BridgeMainNetConstants; -import co.rsk.config.BridgeRegTestConstants; -import co.rsk.config.BridgeTestNetConstants; +import co.rsk.bitcoinj.script.Script; +import co.rsk.bitcoinj.script.ScriptOpCodes; +import co.rsk.config.*; import co.rsk.peg.bitcoin.*; - +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.time.Instant; import java.time.ZonedDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Optional; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.ObjectMapper; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; @@ -64,9 +56,16 @@ void setup() { BtcECKey federator8PublicKey = BtcECKey.fromPublicOnly(Hex.decode("031aabbeb9b27258f98c2bf21f36677ae7bae09eb2d8c958ef41a20a6e88626d26")); BtcECKey federator9PublicKey = BtcECKey.fromPublicOnly(Hex.decode("0245ef34f5ee218005c9c21227133e8568a4f3f11aeab919c66ff7b816ae1ffeea")); defaultKeys = Arrays.asList( - federator0PublicKey, federator1PublicKey, federator2PublicKey, - federator3PublicKey, federator4PublicKey, federator5PublicKey, - federator6PublicKey, federator7PublicKey, federator8PublicKey, federator9PublicKey + federator0PublicKey, + federator1PublicKey, + federator2PublicKey, + federator3PublicKey, + federator4PublicKey, + federator5PublicKey, + federator6PublicKey, + federator7PublicKey, + federator8PublicKey, + federator9PublicKey ); defaultThreshold = defaultKeys.size() / 2 + 1; emergencyKeys = bridgeConstants.getErpFedPubKeysList(); @@ -529,7 +528,7 @@ void spendFromP2shErpFed( @Test void getMemberByBtcPublicKey_passing_existing_btcPublicKey_should_return_found_member(){ - BtcECKey existingMemberBtcPublicKey = standardKeys.get(0); + BtcECKey existingMemberBtcPublicKey = defaultKeys.get(0); Optional foundMember = federation.getMemberByBtcPublicKey(existingMemberBtcPublicKey); Assertions.assertTrue(foundMember.isPresent()); Assertions.assertEquals(existingMemberBtcPublicKey, foundMember.get().getBtcPublicKey()); diff --git a/rskj-core/src/test/java/co/rsk/remasc/RemascFederationProviderTest.java b/rskj-core/src/test/java/co/rsk/remasc/RemascFederationProviderTest.java index c91db4385cb..ec8e4b6df22 100644 --- a/rskj-core/src/test/java/co/rsk/remasc/RemascFederationProviderTest.java +++ b/rskj-core/src/test/java/co/rsk/remasc/RemascFederationProviderTest.java @@ -1,22 +1,22 @@ package co.rsk.remasc; +import static org.mockito.Mockito.*; + import co.rsk.blockchain.utils.BlockGenerator; import co.rsk.config.BridgeMainNetConstants; import co.rsk.core.RskAddress; -import co.rsk.peg.*; +import co.rsk.peg.BridgeStorageProvider; +import co.rsk.peg.FederationSupport; +import co.rsk.peg.federation.FederationMember; import co.rsk.test.builders.BlockChainBuilder; import co.rsk.util.HexUtils; -import org.ethereum.config.blockchain.upgrades.ActivationConfig; -import org.ethereum.config.blockchain.upgrades.ActivationConfigsForTest; -import org.ethereum.config.blockchain.upgrades.ConsensusRule; +import org.ethereum.config.blockchain.upgrades.*; import org.ethereum.core.Blockchain; import org.ethereum.core.Genesis; import org.ethereum.vm.PrecompiledContracts; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import static org.mockito.Mockito.*; - /** * Created by ajlopez on 14/11/2017. */