Fix test failures caused by switch to Adaptive Message IDs
This commit is contained in:
parent
5e8809487a
commit
d2c64b7996
|
@ -40,7 +40,7 @@ public class GetBlockHashesMessage extends EthMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parse() {
|
private void parse() {
|
||||||
RLPList paramsList = (RLPList) RLP.decode2(encoded).get(1);
|
RLPList paramsList = (RLPList) RLP.decode2(encoded).get(0);
|
||||||
|
|
||||||
this.bestHash = paramsList.get(1).getRLPData();
|
this.bestHash = paramsList.get(1).getRLPData();
|
||||||
byte[] maxBlocksBytes = paramsList.get(2).getRLPData();
|
byte[] maxBlocksBytes = paramsList.get(2).getRLPData();
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class BlockHashesMessageTest {
|
||||||
BlockHashesMessage blockHashesMessage = new BlockHashesMessage(blockHashes);
|
BlockHashesMessage blockHashesMessage = new BlockHashesMessage(blockHashes);
|
||||||
System.out.println(blockHashesMessage);
|
System.out.println(blockHashesMessage);
|
||||||
|
|
||||||
String expected = "f84314a04ee6424d776b3f59affc20bc2de59e67f36e22cc07897ff8df152242c921716ba07d2fe4df0dbbc9011da2b3bf177f0c6b7e71a11c509035c5d751efa5cf9b4817";
|
String expected = "f84304a04ee6424d776b3f59affc20bc2de59e67f36e22cc07897ff8df152242c921716ba07d2fe4df0dbbc9011da2b3bf177f0c6b7e71a11c509035c5d751efa5cf9b4817";
|
||||||
assertEquals(expected, Hex.toHexString(blockHashesMessage.getEncoded()));
|
assertEquals(expected, Hex.toHexString(blockHashesMessage.getEncoded()));
|
||||||
|
|
||||||
assertEquals(EthMessageCodes.BLOCK_HASHES, blockHashesMessage.getCommand());
|
assertEquals(EthMessageCodes.BLOCK_HASHES, blockHashesMessage.getCommand());
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class GetBlockHashesMessageTest {
|
||||||
GetBlockHashesMessage getBlockHashesMessage = new GetBlockHashesMessage(bestHash, 128);
|
GetBlockHashesMessage getBlockHashesMessage = new GetBlockHashesMessage(bestHash, 128);
|
||||||
System.out.println(getBlockHashesMessage);
|
System.out.println(getBlockHashesMessage);
|
||||||
|
|
||||||
String expected = "e413a0455408387e6c5b029b0d51f7d617a4d1dc4895fa6eda09455cc2ee62c08d907e8180";
|
String expected = "e403a0455408387e6c5b029b0d51f7d617a4d1dc4895fa6eda09455cc2ee62c08d907e8180";
|
||||||
assertEquals(expected, Hex.toHexString(getBlockHashesMessage.getEncoded()));
|
assertEquals(expected, Hex.toHexString(getBlockHashesMessage.getEncoded()));
|
||||||
|
|
||||||
assertEquals(EthMessageCodes.GET_BLOCK_HASHES, getBlockHashesMessage.getCommand());
|
assertEquals(EthMessageCodes.GET_BLOCK_HASHES, getBlockHashesMessage.getCommand());
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class GetBlocksMessageTest {
|
||||||
GetBlocksMessage getBlocksMessage = new GetBlocksMessage(hashList);
|
GetBlocksMessage getBlocksMessage = new GetBlocksMessage(hashList);
|
||||||
System.out.println(getBlocksMessage);
|
System.out.println(getBlocksMessage);
|
||||||
|
|
||||||
String expected = "f8a615a0497dcbd12fa99ced7b27cda6611f64eb13ab50e20260eec5ee6b7190e7206d54a00959bdfba5e54fcc9370e86b7996fbe32a277bab65c31a0102226f83c4d3e0f2a001a333c156485880776e929e84c26c9778c1e9b4dcb5cd3bff8ad0aeff385df0a0690e13595c9e8e4fa9a621dfed6ad828a6e8e591479af6897c979a83daf73084a0b20f253d2b62609e932c13f3bca59a22913ea5b1e532d8a707976997461ec143";
|
String expected = "f8a605a0497dcbd12fa99ced7b27cda6611f64eb13ab50e20260eec5ee6b7190e7206d54a00959bdfba5e54fcc9370e86b7996fbe32a277bab65c31a0102226f83c4d3e0f2a001a333c156485880776e929e84c26c9778c1e9b4dcb5cd3bff8ad0aeff385df0a0690e13595c9e8e4fa9a621dfed6ad828a6e8e591479af6897c979a83daf73084a0b20f253d2b62609e932c13f3bca59a22913ea5b1e532d8a707976997461ec143";
|
||||||
assertEquals(expected, Hex.toHexString(getBlocksMessage.getEncoded()));
|
assertEquals(expected, Hex.toHexString(getBlocksMessage.getEncoded()));
|
||||||
|
|
||||||
assertEquals(EthMessageCodes.GET_BLOCKS, getBlocksMessage.getCommand());
|
assertEquals(EthMessageCodes.GET_BLOCKS, getBlocksMessage.getCommand());
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class HelloMessageTest {
|
||||||
System.out.println(helloMessage);
|
System.out.println(helloMessage);
|
||||||
// rlp encoded hello message
|
// rlp encoded hello message
|
||||||
String expected = "F8778080A2457468657265756D284A292F302E362E312F6465762F5"
|
String expected = "F8778080A2457468657265756D284A292F302E362E312F6465762F5"
|
||||||
+ "7696E646F77732F4A617661CCC58365746823C5837368680182765FB840CAB0"
|
+ "7696E646F77732F4A617661CCC58365746824C5837368680182765FB840CAB0"
|
||||||
+ "D93EEE1F44EF1286367101F1553450E3DDCEEA45ABCAB0AC21E1EFB48A6610E"
|
+ "D93EEE1F44EF1286367101F1553450E3DDCEEA45ABCAB0AC21E1EFB48A6610E"
|
||||||
+ "BE88CE7317EB09229558311BA8B7250911D7E49562C3988CA3143329DA3EA";
|
+ "BE88CE7317EB09229558311BA8B7250911D7E49562C3988CA3143329DA3EA";
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ import org.ethereum.net.p2p.GetPeersMessage;
|
||||||
import org.ethereum.net.p2p.P2pMessageCodes;
|
import org.ethereum.net.p2p.P2pMessageCodes;
|
||||||
import org.ethereum.net.p2p.Peer;
|
import org.ethereum.net.p2p.Peer;
|
||||||
import org.ethereum.net.p2p.PeersMessage;
|
import org.ethereum.net.p2p.PeersMessage;
|
||||||
import org.ethereum.net.peerdiscovery.PeerInfo;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.spongycastle.util.encoders.Hex;
|
import org.spongycastle.util.encoders.Hex;
|
||||||
|
|
||||||
|
|
|
@ -167,7 +167,7 @@ public class TransactionsMessageTest {
|
||||||
@Test /* Transactions msg encode */
|
@Test /* Transactions msg encode */
|
||||||
public void test_3() throws Exception {
|
public void test_3() throws Exception {
|
||||||
|
|
||||||
String expected = "f87312f870808b00d3c21bcecceda10000009479b08ad8787060333663d19704909ee7b1903e588609184e72a000824255801ca00f410a70e42b2c9854a8421d32c87c370a2b9fff0a27f9f031bb4443681d73b5a018a7dc4c4f9dee9f3dc35cb96ca15859aa27e219a8e4a8547be6bd3206979858";
|
String expected = "f87302f870808b00d3c21bcecceda10000009479b08ad8787060333663d19704909ee7b1903e588609184e72a000824255801ca00f410a70e42b2c9854a8421d32c87c370a2b9fff0a27f9f031bb4443681d73b5a018a7dc4c4f9dee9f3dc35cb96ca15859aa27e219a8e4a8547be6bd3206979858";
|
||||||
|
|
||||||
BigInteger value = new BigInteger("1000000000000000000000000");
|
BigInteger value = new BigInteger("1000000000000000000000000");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue