Skip to content

Commit

Permalink
fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
zilm13 committed Sep 24, 2024
1 parent 4dde1b9 commit 5657249
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import java.util.Collections;
import java.util.List;
import java.util.Optional;

import io.libp2p.core.crypto.PubKey;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.units.bigints.UInt256;
import org.hyperledger.besu.plugin.services.MetricsSystem;
Expand Down Expand Up @@ -146,8 +144,6 @@ public Eth2P2PNetwork build() {
// Setup eth2 handlers
final SubnetSubscriptionService attestationSubnetService = new SubnetSubscriptionService();
final SubnetSubscriptionService syncCommitteeSubnetService = new SubnetSubscriptionService();
final SubnetSubscriptionService dataColumnSidecarSubnetService =
new SubnetSubscriptionService();

// TODO a bit hacky solution, subject to be refactored
DiscoveryNodeIdExtractor discoveryNodeIdExtractor =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Copyright Consensys Software Inc., 2024
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/

package tech.pegasys.teku.networking.eth2.peers;

import org.apache.tuweni.units.bigints.UInt256;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package tech.pegasys.teku.networking.eth2.peers;

import java.util.Optional;

import org.hyperledger.besu.plugin.services.MetricsSystem;
import tech.pegasys.teku.infrastructure.time.TimeProvider;
import tech.pegasys.teku.kzg.KZG;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
public class NodeRecordConverter {
private static final Logger LOG = LogManager.getLogger();

public Bytes convertPublicKeyToNodeId(Bytes publicKey) {
public Bytes convertPublicKeyToNodeId(final Bytes publicKey) {
return new NodeRecordBuilder().publicKey(publicKey).build().getNodeId();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ public void shouldUseV4PortIfV6PortSpecifiedWithNoV6Ip() {
new EnrField(EnrField.TCP, 30303)))
.contains(
new DiscoveryPeer(
PUB_KEY, new InetSocketAddress("::1", 30303), ENR_FORK_ID, ATTNETS, SYNCNETS));
PUB_KEY,
NODE_ID,
new InetSocketAddress("::1", 30303),
ENR_FORK_ID,
ATTNETS,
SYNCNETS));
}

@Test
Expand Down Expand Up @@ -142,6 +147,7 @@ public void shouldConvertIpV4Record() {
.contains(
new DiscoveryPeer(
PUB_KEY,
NODE_ID,
new InetSocketAddress("129.24.31.22", 1234),
ENR_FORK_ID,
ATTNETS,
Expand All @@ -168,7 +174,12 @@ public void shouldConvertIpV6Record() {
assertThat(result)
.contains(
new DiscoveryPeer(
PUB_KEY, new InetSocketAddress("::1", 1234), ENR_FORK_ID, ATTNETS, SYNCNETS));
PUB_KEY,
NODE_ID,
new InetSocketAddress("::1", 1234),
ENR_FORK_ID,
ATTNETS,
SYNCNETS));
}

@Test
Expand All @@ -183,7 +194,12 @@ public void shouldConvertDualStackRecordIfIpV6IsNotSupported() {
assertThat(result)
.contains(
new DiscoveryPeer(
PUB_KEY, new InetSocketAddress("127.0.0.1", 1234), ENR_FORK_ID, ATTNETS, SYNCNETS));
PUB_KEY,
NODE_ID,
new InetSocketAddress("127.0.0.1", 1234),
ENR_FORK_ID,
ATTNETS,
SYNCNETS));
}

@Test
Expand Down Expand Up @@ -241,7 +257,12 @@ public void shouldConvertSyncnets() {
assertThat(result)
.contains(
new DiscoveryPeer(
PUB_KEY, NODE_ID, new InetSocketAddress("::1", 1234), ENR_FORK_ID, ATTNETS, syncnets));
PUB_KEY,
NODE_ID,
new InetSocketAddress("::1", 1234),
ENR_FORK_ID,
ATTNETS,
syncnets));
}

@Test
Expand All @@ -259,7 +280,12 @@ public void shouldUseEmptySyncnetsFieldValueIsInvalid() {
assertThat(result)
.contains(
new DiscoveryPeer(
PUB_KEY, NODE_ID, new InetSocketAddress("::1", 1234), ENR_FORK_ID, ATTNETS, SYNCNETS));
PUB_KEY,
NODE_ID,
new InetSocketAddress("::1", 1234),
ENR_FORK_ID,
ATTNETS,
SYNCNETS));
}

@Test
Expand Down Expand Up @@ -295,7 +321,12 @@ public void shouldNotHaveEnrForkIdWhenValueIsInvalid() {
assertThat(result)
.contains(
new DiscoveryPeer(
PUB_KEY, NODE_ID, new InetSocketAddress("::1", 1234), Optional.empty(), ATTNETS, SYNCNETS));
PUB_KEY,
NODE_ID,
new InetSocketAddress("::1", 1234),
Optional.empty(),
ATTNETS,
SYNCNETS));
}

private Optional<DiscoveryPeer> convertNodeRecordWithFields(
Expand Down

0 comments on commit 5657249

Please sign in to comment.