Remove the test case that compares the vote of the block with the vote via getVotesByHeight.
vote via getVotesByHeight can be different in each node.
@@ -176,14 +176,14 @@ public class BtpApiTest {
byte []votesHash = (byte[])dBlkHeader.get(VOTESHASH_INDEX);
// get votes by hash of the votes
- Base64 votes1 = iconService.getDataByHash(new Bytes(votesHash)).execute();
- byte[] vote1Hash = Utils.getHash(votes1.decode());
- if (!Arrays.equals(votesHash, vote1Hash)) {
+ Base64 votes = iconService.getDataByHash(new Bytes(votesHash)).execute();
+ byte[] voteHash2 = Utils.getHash(votes.decode());
+ if (!Arrays.equals(votesHash, voteHash2)) {
LOG.info("blkHeight (" + resBlkHeight + ")");
LOG.info("headerBytes (" + Utils.byteArrayToHex(resHeaderBytes) + ")");
- LOG.info("votes (" + Utils.byteArrayToHex(votes1.decode()) + ")");
+ LOG.info("votes (" + Utils.byteArrayToHex(votes.decode()) + ")");
LOG.info("votesHash (" + Utils.byteArrayToHex(votesHash) + ")");
- LOG.info("vote1Hash (" + Utils.byteArrayToHex(vote1Hash) + ")");
+ LOG.info("vote1Hash (" + Utils.byteArrayToHex(voteHash2) + ")");
throw new Exception();
}
@@ -200,17 +200,6 @@ public class BtpApiTest {
throw new Exception();
}
- Base64 votes2 = iconService.getVotesByHeight(resBlkHeight.subtract(BigInteger.ONE)).execute();
- if (!Arrays.equals(votes1.decode(), votes2.decode())) {
- LOG.info("blkHeight (" + resBlkHeight + ")");
- LOG.info("headerBytes (" + Utils.byteArrayToHex(resHeaderBytes) + ")");
- LOG.info("votesHash (" + Utils.byteArrayToHex(votesHash) + ")");
- LOG.info("votes1 (" + Utils.byteArrayToHex(votes1.decode()) + ")");
- LOG.info("votes2 (" + Utils.byteArrayToHex(votes2.decode()) + ")");
- LOG.infoExiting();
- throw new Exception();
- }
-
// get block header by hash of the block
Base64 blkHeader2 = iconService.getDataByHash(result.getBlockHash()).execute();
if (!Arrays.equals(resHeaderBytes, blkHeader2.decode())) {
