From 68cdd578721767d0a51f8cc62b7a30a6e816e34f Mon Sep 17 00:00:00 2001 From: gconnect Date: Mon, 23 Sep 2024 04:42:39 +0100 Subject: [PATCH] Ran spotlessApply Signed-off-by: gconnect --- .../server/network/DatabaseNetwork.java | 12 +++---- .../server/network/DatabaseNetworkTest.java | 31 +++++++++---------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/storage/src/main/java/tech/pegasys/teku/storage/server/network/DatabaseNetwork.java b/storage/src/main/java/tech/pegasys/teku/storage/server/network/DatabaseNetwork.java index 18d7d2823b4..15f60570255 100644 --- a/storage/src/main/java/tech/pegasys/teku/storage/server/network/DatabaseNetwork.java +++ b/storage/src/main/java/tech/pegasys/teku/storage/server/network/DatabaseNetwork.java @@ -47,17 +47,15 @@ public class DatabaseNetwork { @JsonCreator DatabaseNetwork( - @JsonProperty("fork_version") final String forkVersion, - @JsonProperty("deposit_contract") final String depositContract, - @JsonProperty("deposit_chainId") final Long depositChainId) { + @JsonProperty("fork_version") final String forkVersion, + @JsonProperty("deposit_contract") final String depositContract, + @JsonProperty("deposit_chainId") final Long depositChainId) { this.forkVersion = forkVersion; this.depositContract = depositContract; this.depositChainId = depositChainId; } - DatabaseNetwork( - final String forkVersion, - final String depositContract) { + DatabaseNetwork(final String forkVersion, final String depositContract) { this(forkVersion, depositContract, null); } @@ -110,7 +108,7 @@ public boolean equals(final Object o) { final DatabaseNetwork that = (DatabaseNetwork) o; return Objects.equals(forkVersion, that.forkVersion) && Objects.equals(depositContract, that.depositContract) - && Objects.equals(depositChainId, that.depositChainId); + && Objects.equals(depositChainId, that.depositChainId); } @Override diff --git a/storage/src/test/java/tech/pegasys/teku/storage/server/network/DatabaseNetworkTest.java b/storage/src/test/java/tech/pegasys/teku/storage/server/network/DatabaseNetworkTest.java index 018620de314..8d8ea21bbd2 100644 --- a/storage/src/test/java/tech/pegasys/teku/storage/server/network/DatabaseNetworkTest.java +++ b/storage/src/test/java/tech/pegasys/teku/storage/server/network/DatabaseNetworkTest.java @@ -19,13 +19,11 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import java.io.File; import java.io.IOException; -import java.nio.file.Path; import java.util.Locale; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import tech.pegasys.teku.ethereum.execution.types.Eth1Address; @@ -90,20 +88,20 @@ public void shouldNotThrowIfForkAndContractMatch(@TempDir final File tempDir) th } @Test - void shouldWriteAndReadDatabaseNetworkWithChainId(@TempDir final File tempDir) throws IOException { + void shouldWriteAndReadDatabaseNetworkWithChainId(@TempDir final File tempDir) + throws IOException { final File networkFile = new File(tempDir, "network.yml"); final Bytes4 fork = dataStructureUtil.randomFork().getCurrentVersion(); final Eth1Address eth1Address = dataStructureUtil.randomEth1Address(); final Long depositId = dataStructureUtil.randomLong(); - DatabaseNetwork databaseNetwork = new DatabaseNetwork( - fork.toHexString(), - eth1Address.toHexString(), - depositId); + DatabaseNetwork databaseNetwork = + new DatabaseNetwork(fork.toHexString(), eth1Address.toHexString(), depositId); ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory()); objectMapper.writerFor(DatabaseNetwork.class).writeValue(networkFile, databaseNetwork); - DatabaseNetwork readDatabaseNetwork = objectMapper.readerFor(DatabaseNetwork.class).readValue(networkFile); + DatabaseNetwork readDatabaseNetwork = + objectMapper.readerFor(DatabaseNetwork.class).readValue(networkFile); assertEquals(fork.toHexString(), readDatabaseNetwork.forkVersion); assertEquals(eth1Address.toHexString(), readDatabaseNetwork.depositContract); @@ -111,23 +109,22 @@ void shouldWriteAndReadDatabaseNetworkWithChainId(@TempDir final File tempDir) t } @Test - void shouldWriteAndReadDatabaseNetworkWithoutChainId(@TempDir final File tempDir) throws IOException { + void shouldWriteAndReadDatabaseNetworkWithoutChainId(@TempDir final File tempDir) + throws IOException { final File networkFile = new File(tempDir, "network.yml"); final Bytes4 fork = dataStructureUtil.randomFork().getCurrentVersion(); final Eth1Address eth1Address = dataStructureUtil.randomEth1Address(); - DatabaseNetwork databaseNetwork = new DatabaseNetwork( - fork.toHexString(), - eth1Address.toHexString(), - null); + DatabaseNetwork databaseNetwork = + new DatabaseNetwork(fork.toHexString(), eth1Address.toHexString(), null); ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory()); objectMapper.writerFor(DatabaseNetwork.class).writeValue(networkFile, databaseNetwork); - DatabaseNetwork readDatabaseNetwork = objectMapper.readerFor(DatabaseNetwork.class).readValue(networkFile); + DatabaseNetwork readDatabaseNetwork = + objectMapper.readerFor(DatabaseNetwork.class).readValue(networkFile); assertEquals(fork.toHexString(), readDatabaseNetwork.forkVersion); assertEquals(eth1Address.toHexString(), readDatabaseNetwork.depositContract); assertNull(readDatabaseNetwork.depositChainId); } - }