Fix merge-conflict

This commit is contained in:
nicksavers 2014-10-13 16:07:46 +02:00
parent e386520856
commit e5ebef986f
2 changed files with 9 additions and 9 deletions

View File

@ -21,7 +21,7 @@ public class SystemProperties {
private static Logger logger = LoggerFactory.getLogger(SystemProperties.class);
private static int DEFAULT_TX_APPROVE_TIMEOUT = 10;
private static int DEFAULT_PROTOCOL_VERSION = 33;
private static byte DEFAULT_PROTOCOL_VERSION = 33;
private static String DEFAULT_DISCOVERY_PEER_LIST = "poc-6.ethdev.com:30303";
private static String DEFAULT_ACTIVE_PEER_IP = "poc-6.ethdev.com";
private static int DEFAULT_ACTIVE_PORT = 30303;
@ -82,9 +82,9 @@ public class SystemProperties {
}
}
public int protocolVersion() {
public byte protocolVersion() {
if (prop.isEmpty()) return DEFAULT_PROTOCOL_VERSION;
return Integer.parseInt(prop.getProperty("protocol.version"));
return Byte.parseByte(prop.getProperty("protocol.version"));
}
public boolean peerDiscovery() {

View File

@ -8,10 +8,10 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.ethereum.net.client.Peer;
import org.ethereum.net.message.Command;
import org.ethereum.net.message.GetPeersMessage;
import org.ethereum.net.message.PeersMessage;
import org.ethereum.net.peerdiscovery.PeerData;
import org.junit.Test;
import org.spongycastle.util.encoders.Hex;
@ -51,8 +51,8 @@ public class PeersMessageTest {
assertEquals(2, peersMessage.getPeers().size());
Iterator<Peer> it = peersMessage.getPeers().iterator(); it.next();
Peer peer = it.next();
Iterator<PeerData> it = peersMessage.getPeers().iterator(); it.next();
PeerData peer = it.next();
assertEquals(Command.PEERS, peersMessage.getCommand());
assertEquals("/81.99.225.18", peer.getAddress().toString());
@ -63,9 +63,9 @@ public class PeersMessageTest {
@Test /* PeersMessage 2 from constructor */
public void testPeers_2() throws UnknownHostException {
Set<Peer> peers = new HashSet<>();
peers.add(new Peer(InetAddress.getByName("82.217.72.169"), 30303, "585764a3c49a3838c69ad0855abfeb5672f71b072af62082b5679961781100814b8de88a8fbc1da7c73791f88159d73b5d2a13a5579535d603e045c3db5cbb75"));
peers.add(new Peer(InetAddress.getByName("192.168.1.193"), 30303, ""));
Set<PeerData> peers = new HashSet<>();
peers.add(new PeerData(InetAddress.getByName("82.217.72.169"), 30303, "585764a3c49a3838c69ad0855abfeb5672f71b072af62082b5679961781100814b8de88a8fbc1da7c73791f88159d73b5d2a13a5579535d603e045c3db5cbb75"));
peers.add(new PeerData(InetAddress.getByName("192.168.1.193"), 30303, ""));
PeersMessage peersMessage = new PeersMessage(peers);
System.out.println(peersMessage.toString());