Search in sources :

Example 31 with PeerScoringManager

use of co.rsk.scoring.PeerScoringManager in project rskj by rsksmart.

the class Web3ImplScoringTest method addBannedAddressUsingIPV6.

@Test
public void addBannedAddressUsingIPV6() throws UnknownHostException {
    PeerScoringManager peerScoringManager = createPeerScoringManager();
    Web3Impl web3 = createWeb3(peerScoringManager);
    InetAddress address = generateIPAddressV6();
    Assert.assertTrue(peerScoringManager.hasGoodReputation(address));
    web3.sco_banAddress(address.getHostAddress());
    Assert.assertFalse(peerScoringManager.hasGoodReputation(address));
}
Also used : PeerScoringManager(co.rsk.scoring.PeerScoringManager) InetAddress(java.net.InetAddress) Test(org.junit.Test)

Aggregations

PeerScoringManager (co.rsk.scoring.PeerScoringManager)31 Test (org.junit.Test)26 InetAddress (java.net.InetAddress)11 PeerScoring (co.rsk.scoring.PeerScoring)10 SimpleBlockProcessor (co.rsk.net.simples.SimpleBlockProcessor)9 SimpleMessageChannel (co.rsk.net.simples.SimpleMessageChannel)9 ProofOfWorkRule (co.rsk.validators.ProofOfWorkRule)7 DummyBlockValidationRule (co.rsk.validators.DummyBlockValidationRule)4 SimpleChannelManager (org.ethereum.rpc.Simples.SimpleChannelManager)4 BlockGenerator (co.rsk.blockchain.utils.BlockGenerator)3 TxHandler (co.rsk.net.handler.TxHandler)3 SimpleTransactionPool (co.rsk.net.simples.SimpleTransactionPool)3 NodeID (co.rsk.net.NodeID)2 PeerScoringInformation (co.rsk.scoring.PeerScoringInformation)2 JsonRpcInvalidParamException (org.ethereum.rpc.exception.JsonRpcInvalidParamException)2 DifficultyCalculator (co.rsk.core.DifficultyCalculator)1 RepositoryImpl (co.rsk.db.RepositoryImpl)1 TxHandlerImpl (co.rsk.net.handler.TxHandlerImpl)1 PunishmentParameters (co.rsk.scoring.PunishmentParameters)1 World (co.rsk.test.World)1