diff --git a/src/main/java/com/limechain/grandpa/state/GrandpaSetState.java b/src/main/java/com/limechain/grandpa/state/GrandpaSetState.java index 54fd5212..6e71a9fb 100644 --- a/src/main/java/com/limechain/grandpa/state/GrandpaSetState.java +++ b/src/main/java/com/limechain/grandpa/state/GrandpaSetState.java @@ -192,15 +192,9 @@ public void handleGrandpaConsensusMessage(GrandpaConsensusMessage consensusMessa currentBlockNumber )); //TODO: Implement later - case GRANDPA_ON_DISABLED -> { - log.log(Level.SEVERE, "'ON DISABLED' grandpa message not implemented"); - } - case GRANDPA_PAUSE -> { - log.log(Level.SEVERE, "'PAUSE' grandpa message not implemented"); - } - case GRANDPA_RESUME -> { - log.log(Level.SEVERE, "'RESUME' grandpa message not implemented"); - } + case GRANDPA_ON_DISABLED -> log.log(Level.SEVERE, "'ON DISABLED' grandpa message not implemented"); + case GRANDPA_PAUSE -> log.log(Level.SEVERE, "'PAUSE' grandpa message not implemented"); + case GRANDPA_RESUME -> log.log(Level.SEVERE, "'RESUME' grandpa message not implemented"); } log.fine(String.format("Updated grandpa set config: %s", consensusMessage.getFormat().toString())); diff --git a/src/test/java/com/limechain/grandpa/GrandpaServiceTest.java b/src/test/java/com/limechain/grandpa/GrandpaServiceTest.java index d536a60e..adf71493 100644 --- a/src/test/java/com/limechain/grandpa/GrandpaServiceTest.java +++ b/src/test/java/com/limechain/grandpa/GrandpaServiceTest.java @@ -13,10 +13,8 @@ import com.limechain.network.protocol.warp.dto.DigestType; import com.limechain.network.protocol.warp.dto.HeaderDigest; import com.limechain.storage.block.BlockState; -import com.limechain.utils.Ed25519Utils; import io.emeraldpay.polkaj.types.Hash256; import io.emeraldpay.polkaj.types.Hash512; -import io.libp2p.core.crypto.PubKey; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -366,10 +364,6 @@ void testGetDirectVotesForPrevotes() throws Exception { @Test void testGetDirectVotesWithMultipleVotesForSingleBlockForPrevotes() throws Exception { - // Prepare mock data - PubKey pubKey1 = Ed25519Utils.generateKeyPair().publicKey(); - PubKey pubKey2 = Ed25519Utils.generateKeyPair().publicKey(); - Vote firstVote = new Vote(new Hash256(ONES_ARRAY), BigInteger.valueOf(3)); Vote secondVote = new Vote(new Hash256(ONES_ARRAY), BigInteger.valueOf(3)); Hash256 firstVoteAuthorityHash = new Hash256(ONES_ARRAY); @@ -395,9 +389,6 @@ void testGetDirectVotesWithMultipleVotesForSingleBlockForPrevotes() throws Excep @Test void testGetVotes() throws Exception { - // Prepare mock data - Ed25519Utils.generateKeyPair().publicKey(); - Vote firstVote = new Vote(new Hash256(ONES_ARRAY), BigInteger.valueOf(3)); Hash256 firstVoteAuthorityHash = new Hash256(ONES_ARRAY); SignedVote firstSignedVote = new SignedVote(firstVote, Hash512.empty(), firstVoteAuthorityHash); @@ -419,7 +410,6 @@ void testGetVotes() throws Exception { @Test void testGetVotesWithMultipleVotes() throws Exception { - Vote firstVote = new Vote(new Hash256(ONES_ARRAY), BigInteger.valueOf(3)); Vote secondVote = new Vote(new Hash256(TWOS_ARRAY), BigInteger.valueOf(4)); Hash256 firstVoteAuthorityHash = new Hash256(ONES_ARRAY); diff --git a/src/test/java/com/limechain/grandpa/state/GrandpaSetStateTest.java b/src/test/java/com/limechain/grandpa/state/GrandpaSetStateTest.java index 2139444c..918bfd9c 100644 --- a/src/test/java/com/limechain/grandpa/state/GrandpaSetStateTest.java +++ b/src/test/java/com/limechain/grandpa/state/GrandpaSetStateTest.java @@ -63,17 +63,14 @@ void testDerivePrimary() { grandpaSetState.setRoundCache(roundCache); // 4 % voters.size = 1 -// grandpaSetState.setRoundNumber(); when(roundCache.getLatestRoundNumber(BigInteger.ONE)).thenReturn(BigInteger.valueOf(4)); assertEquals(BigInteger.ONE, grandpaSetState.derivePrimary()); // 5 % voters.size = 2 -// grandpaSetState.setRoundNumber(BigInteger.valueOf(5)); when(roundCache.getLatestRoundNumber(BigInteger.ONE)).thenReturn(BigInteger.valueOf(5)); assertEquals(BigInteger.TWO, grandpaSetState.derivePrimary()); // 6 % voters.size = 0 -// grandpaSetState.setRoundNumber(BigInteger.valueOf(6)); when(roundCache.getLatestRoundNumber(BigInteger.ONE)).thenReturn(BigInteger.valueOf(6)); assertEquals(BigInteger.ZERO, grandpaSetState.derivePrimary()); }