use of co.rsk.net.NodeID in project rskj by rsksmart.
the class PeerScoringManagerTest method invalidTransactionGivesNoBadReputationToNode.
@Test
public void invalidTransactionGivesNoBadReputationToNode() throws UnknownHostException {
NodeID id = generateNodeID();
PeerScoringManager manager = createPeerScoringManager();
manager.recordEvent(id, null, EventType.INVALID_TRANSACTION);
Assert.assertTrue(manager.hasGoodReputation(id));
Assert.assertEquals(0, manager.getPeerScoring(id).getTimeLostGoodReputation());
}
use of co.rsk.net.NodeID in project rskj by rsksmart.
the class PeerScoringManagerTest method invalidBlockGivesBadReputationToNode.
@Test
public void invalidBlockGivesBadReputationToNode() throws UnknownHostException {
NodeID id = generateNodeID();
PeerScoringManager manager = createPeerScoringManager();
manager.recordEvent(id, null, EventType.INVALID_BLOCK);
Assert.assertFalse(manager.hasGoodReputation(id));
Assert.assertNotEquals(0, manager.getPeerScoring(id).getTimeLostGoodReputation());
}
Aggregations