target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void processGetBlockHeaderMessageUsingBlockInBlockchain() throws UnknownHostException { final Blockchain blockchain = new BlockChainBuilder().ofSize(10); final Block block = blockchain.getBlockByNumber(5); final NetBlockStore store = new NetBlockStore(); BlockNodeInformation nodeInformation = new BlockNode...
@Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncConfiguration.getChunkSize()) { logger.trace("Hea...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
@Test public void processGetBlockMessageUsingBlockInStore() throws UnknownHostException { final Block block = new BlockGenerator().getBlock(3); final Keccak256 blockHash = block.getHash(); final NetBlockStore store = new NetBlockStore(); store.saveBlock(block); final Blockchain blockchain = new BlockChainBuilder().ofSi...
@Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if (block == null) { return; } nodeInformation.ad...
NodeBlockProcessor implements BlockProcessor { @Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if...
NodeBlockProcessor implements BlockProcessor { @Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if...
NodeBlockProcessor implements BlockProcessor { @Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if...
NodeBlockProcessor implements BlockProcessor { @Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if...
@Test public void processGetBlockMessageUsingEmptyStore() throws UnknownHostException { final Block block = new BlockGenerator().getBlock(3); final NetBlockStore store = new NetBlockStore(); final Blockchain blockchain = new BlockChainBuilder().ofSize(0); BlockNodeInformation nodeInformation = new BlockNodeInformation(...
@Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if (block == null) { return; } nodeInformation.ad...
NodeBlockProcessor implements BlockProcessor { @Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if...
NodeBlockProcessor implements BlockProcessor { @Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if...
NodeBlockProcessor implements BlockProcessor { @Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if...
NodeBlockProcessor implements BlockProcessor { @Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if...
@Test public void testECKey() { ECKey key = new ECKey(); assertTrue(key.isPubKeyCanonical()); assertNotNull(key.getPubKey()); assertNotNull(key.getPrivKeyBytes()); log.debug(ByteUtil.toHexString(key.getPrivKeyBytes()) + " :Generated privkey"); log.debug(ByteUtil.toHexString(key.getPubKey()) + " :Generated pubkey"); }
public ECKey() { this(secureRandom); }
ECKey { public ECKey() { this(secureRandom); } }
ECKey { public ECKey() { this(secureRandom); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); }
ECKey { public ECKey() { this(secureRandom); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static ECPoint decompressPoint(ECPoint compressed); static ECKey fromPrivate(BigInteger privKey); static ECKey fromPrivate(byte[]...
ECKey { public ECKey() { this(secureRandom); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static ECPoint decompressPoint(ECPoint compressed); static ECKey fromPrivate(BigInteger privKey); static ECKey fromPrivate(byte[]...
@Test public void processGetBlockMessageUsingBlockInBlockchain() throws UnknownHostException { final Blockchain blockchain = new BlockChainBuilder().ofSize(10); final Block block = blockchain.getBlockByNumber(5); final Keccak256 blockHash = block.getHash(); final NetBlockStore store = new NetBlockStore(); BlockNodeInfo...
@Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if (block == null) { return; } nodeInformation.ad...
NodeBlockProcessor implements BlockProcessor { @Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if...
NodeBlockProcessor implements BlockProcessor { @Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if...
NodeBlockProcessor implements BlockProcessor { @Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if...
NodeBlockProcessor implements BlockProcessor { @Override public void processGetBlock(@Nonnull final Peer sender, @Nonnull final byte[] hash) { logger.trace("Processing get block {} from {}", ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if...
@Test public void processBlockRequestMessageUsingBlockInStore() throws UnknownHostException { final Block block = new BlockGenerator().getBlock(3); final Keccak256 blockHash = block.getHash(); final NetBlockStore store = new NetBlockStore(); store.saveBlock(block); final Blockchain blockchain = new BlockChainBuilder()....
@Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if (blo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncServi...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncServi...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncServi...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncServi...
@Test public void processBodyRequestMessageUsingBlockInBlockchain() throws UnknownHostException { final Blockchain blockchain = new BlockChainBuilder().ofSize(10); final Block block = blockchain.getBlockByNumber(3); final NetBlockStore store = new NetBlockStore(); BlockNodeInformation nodeInformation = new BlockNodeInf...
@Override public void processBodyRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing body request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if (block == ...
NodeBlockProcessor implements BlockProcessor { @Override public void processBodyRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing body request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.get...
NodeBlockProcessor implements BlockProcessor { @Override public void processBodyRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing body request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.get...
NodeBlockProcessor implements BlockProcessor { @Override public void processBodyRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing body request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.get...
NodeBlockProcessor implements BlockProcessor { @Override public void processBodyRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing body request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.get...
@Test public void processBlockHashRequestMessageUsingEmptyStore() throws UnknownHostException { final Block block = new BlockGenerator().getBlock(3); final Keccak256 blockHash = block.getHash(); final NetBlockStore store = new NetBlockStore(); final Blockchain blockchain = new BlockChainBuilder().ofSize(0); BlockNodeIn...
@Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if (blo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncServi...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncServi...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncServi...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncServi...
@Test public void processBlockHashRequestMessageUsingBlockInBlockchain() throws UnknownHostException { final Blockchain blockchain = new BlockChainBuilder().ofSize(10); final Block block = blockchain.getBlockByNumber(5); final Keccak256 blockHash = block.getHash(); final NetBlockStore store = new NetBlockStore(); Block...
@Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash); if (blo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncServi...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncServi...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncServi...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash) { logger.trace("Processing get block by hash {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); final Block block = blockSyncServi...
@Test public void processBlockHashRequestMessageUsingOutOfBoundsHeight() throws UnknownHostException { final Blockchain blockchain = new BlockChainBuilder().ofSize(10); final NetBlockStore store = new NetBlockStore(); BlockNodeInformation nodeInformation = new BlockNodeInformation(); SyncConfiguration syncConfiguration...
@Override public void processBlockHashRequest(@Nonnull final Peer sender, long requestId, long height) { logger.trace("Processing block hash request {} {} from {}", requestId, height, sender.getPeerNodeID()); if (height == 0){ return; } final Block block = this.getBlockFromBlockchainStore(height); if (block == null) { ...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHashRequest(@Nonnull final Peer sender, long requestId, long height) { logger.trace("Processing block hash request {} {} from {}", requestId, height, sender.getPeerNodeID()); if (height == 0){ return; } final Block block = this.getBlockFro...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHashRequest(@Nonnull final Peer sender, long requestId, long height) { logger.trace("Processing block hash request {} {} from {}", requestId, height, sender.getPeerNodeID()); if (height == 0){ return; } final Block block = this.getBlockFro...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHashRequest(@Nonnull final Peer sender, long requestId, long height) { logger.trace("Processing block hash request {} {} from {}", requestId, height, sender.getPeerNodeID()); if (height == 0){ return; } final Block block = this.getBlockFro...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHashRequest(@Nonnull final Peer sender, long requestId, long height) { logger.trace("Processing block hash request {} {} from {}", requestId, height, sender.getPeerNodeID()); if (height == 0){ return; } final Block block = this.getBlockFro...
@Test public void processBlockHeadersRequestMessageUsingBlockInBlockchain() throws UnknownHostException { final Blockchain blockchain = new BlockChainBuilder().ofSize(100); final Block block = blockchain.getBlockByNumber(60); final NetBlockStore store = new NetBlockStore(); BlockNodeInformation nodeInformation = new Bl...
@Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncConfiguration.getChunkSize()) { logger.trace("Hea...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
@Test public void processBlockHeadersRequestMessageUsingUnknownHash() throws UnknownHostException { final Blockchain blockchain = new BlockChainBuilder().ofSize(100); final NetBlockStore store = new NetBlockStore(); BlockNodeInformation nodeInformation = new BlockNodeInformation(); SyncConfiguration syncConfiguration =...
@Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncConfiguration.getChunkSize()) { logger.trace("Hea...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
@Test public void processSkeletonRequestWithGenesisPlusBestBlockInSkeleton() throws UnknownHostException { int skeletonStep = 192; final Blockchain blockchain = new BlockChainBuilder().ofSize(skeletonStep / 2); final Block blockStart = blockchain.getBlockByNumber(5); final Block blockEnd = blockchain.getBlockByNumber(s...
@Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Block blockStart = this.getBlockFromBlockchainStore...
NodeBlockProcessor implements BlockProcessor { @Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Bloc...
NodeBlockProcessor implements BlockProcessor { @Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Bloc...
NodeBlockProcessor implements BlockProcessor { @Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Bloc...
NodeBlockProcessor implements BlockProcessor { @Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Bloc...
@Test public void processSkeletonRequestWithThreeResults() throws UnknownHostException { int skeletonStep = 192; final Blockchain blockchain = new BlockChainBuilder().ofSize(300); final NetBlockStore store = new NetBlockStore(); BlockNodeInformation nodeInformation = new BlockNodeInformation(); SyncConfiguration syncCo...
@Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Block blockStart = this.getBlockFromBlockchainStore...
NodeBlockProcessor implements BlockProcessor { @Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Bloc...
NodeBlockProcessor implements BlockProcessor { @Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Bloc...
NodeBlockProcessor implements BlockProcessor { @Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Bloc...
NodeBlockProcessor implements BlockProcessor { @Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Bloc...
@Test public void testIsPubKeyOnly() { ECKey key = ECKey.fromPublicOnly(pubKey); assertTrue(key.isPubKeyCanonical()); assertTrue(key.isPubKeyOnly()); assertArrayEquals(key.getPubKey(), pubKey); }
public boolean isPubKeyOnly() { return priv == null; }
ECKey { public boolean isPubKeyOnly() { return priv == null; } }
ECKey { public boolean isPubKeyOnly() { return priv == null; } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); }
ECKey { public boolean isPubKeyOnly() { return priv == null; } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static ECPoint decompressPoint(ECPoint compressed); static ECKey fromPrivate(BigInteger privKey); static ECKey fr...
ECKey { public boolean isPubKeyOnly() { return priv == null; } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static ECPoint decompressPoint(ECPoint compressed); static ECKey fromPrivate(BigInteger privKey); static ECKey fr...
@Test public void processSkeletonRequestNotIncludingGenesis() throws UnknownHostException { int skeletonStep = 192; final Blockchain blockchain = new BlockChainBuilder().ofSize(400); final NetBlockStore store = new NetBlockStore(); BlockNodeInformation nodeInformation = new BlockNodeInformation(); SyncConfiguration syn...
@Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Block blockStart = this.getBlockFromBlockchainStore...
NodeBlockProcessor implements BlockProcessor { @Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Bloc...
NodeBlockProcessor implements BlockProcessor { @Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Bloc...
NodeBlockProcessor implements BlockProcessor { @Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Bloc...
NodeBlockProcessor implements BlockProcessor { @Override public void processSkeletonRequest(@Nonnull final Peer sender, long requestId, long startNumber) { logger.trace("Processing skeleton request {} {} from {}", requestId, startNumber, sender.getPeerNodeID()); int skeletonStep = syncConfiguration.getChunkSize(); Bloc...
@Test public void failIfProcessBlockHeadersRequestCountHigher() { final Peer sender = mock(Peer.class); final Block block = new BlockGenerator().getBlock(3); final NetBlockStore store = new NetBlockStore(); store.saveBlock(block); final Blockchain blockchain = new BlockChainBuilder().ofSize(0); BlockNodeInformation nod...
@Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncConfiguration.getChunkSize()) { logger.trace("Hea...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
NodeBlockProcessor implements BlockProcessor { @Override public void processBlockHeadersRequest(@Nonnull final Peer sender, long requestId, @Nonnull final byte[] hash, int count) { logger.trace("Processing headers request {} {} from {}", requestId, ByteUtil.toHexString(hash), sender.getPeerNodeID()); if (count > syncCo...
@Test public void getUnknownBlockAsNull() { BlockCache store = getSubject(); assertThat(store.getBlockByHash(HASH_1), nullValue()); }
public Block getBlockByHash(byte[] hash) { return blockMap.get(new Keccak256(hash)); }
BlockCache { public Block getBlockByHash(byte[] hash) { return blockMap.get(new Keccak256(hash)); } }
BlockCache { public Block getBlockByHash(byte[] hash) { return blockMap.get(new Keccak256(hash)); } BlockCache(int cacheSize); }
BlockCache { public Block getBlockByHash(byte[] hash) { return blockMap.get(new Keccak256(hash)); } BlockCache(int cacheSize); void removeBlock(Block block); void addBlock(Block block); Block getBlockByHash(byte[] hash); }
BlockCache { public Block getBlockByHash(byte[] hash) { return blockMap.get(new Keccak256(hash)); } BlockCache(int cacheSize); void removeBlock(Block block); void addBlock(Block block); Block getBlockByHash(byte[] hash); }
@Test public void channelRead0_get_block_message() throws Exception { NodeStatistics.StatHandler statHandler = mock(NodeStatistics.StatHandler.class); NodeStatistics nodeStatistics = mock(NodeStatistics.class); when(channel.getNodeStatistics()).thenReturn(nodeStatistics); when(nodeStatistics.getEthInbound()).thenReturn...
@Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace("EthHandler invoke: [{}]", msg.getCommand()); } ethereumListener.trace(String.for...
RskWireProtocol extends SimpleChannelInboundHandler<EthMessage> implements Eth { @Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace(...
RskWireProtocol extends SimpleChannelInboundHandler<EthMessage> implements Eth { @Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace(...
RskWireProtocol extends SimpleChannelInboundHandler<EthMessage> implements Eth { @Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace(...
RskWireProtocol extends SimpleChannelInboundHandler<EthMessage> implements Eth { @Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace(...
@Test public void channelRead0_block_message() throws Exception { NodeStatistics.StatHandler statHandler = mock(NodeStatistics.StatHandler.class); NodeStatistics nodeStatistics = mock(NodeStatistics.class); when(channel.getNodeStatistics()).thenReturn(nodeStatistics); when(nodeStatistics.getEthInbound()).thenReturn(sta...
@Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace("EthHandler invoke: [{}]", msg.getCommand()); } ethereumListener.trace(String.for...
RskWireProtocol extends SimpleChannelInboundHandler<EthMessage> implements Eth { @Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace(...
RskWireProtocol extends SimpleChannelInboundHandler<EthMessage> implements Eth { @Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace(...
RskWireProtocol extends SimpleChannelInboundHandler<EthMessage> implements Eth { @Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace(...
RskWireProtocol extends SimpleChannelInboundHandler<EthMessage> implements Eth { @Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace(...
@Test public void channelRead0_status_message() throws Exception { NodeStatistics.StatHandler statHandler = mock(NodeStatistics.StatHandler.class); NodeStatistics nodeStatistics = mock(NodeStatistics.class); when(channel.getNodeStatistics()).thenReturn(nodeStatistics); when(nodeStatistics.getEthInbound()).thenReturn(st...
@Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace("EthHandler invoke: [{}]", msg.getCommand()); } ethereumListener.trace(String.for...
RskWireProtocol extends SimpleChannelInboundHandler<EthMessage> implements Eth { @Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace(...
RskWireProtocol extends SimpleChannelInboundHandler<EthMessage> implements Eth { @Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace(...
RskWireProtocol extends SimpleChannelInboundHandler<EthMessage> implements Eth { @Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace(...
RskWireProtocol extends SimpleChannelInboundHandler<EthMessage> implements Eth { @Override public void channelRead0(final ChannelHandlerContext ctx, EthMessage msg) throws InterruptedException { loggerNet.debug("Read message: {}", msg); if (EthMessageCodes.inRange(msg.getCommand().asByte(), version)) { loggerNet.trace(...
@Test public void remascTx() { TxValidatorNotRemascTxValidator validator = new TxValidatorNotRemascTxValidator(); Transaction tx1 = Mockito.mock(RemascTransaction.class); Mockito.when(tx1.getHash()).thenReturn(Keccak256.ZERO_HASH); Assert.assertFalse(validator.validate(tx1, null, null, null, 0, false).transactionIsVali...
@Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (!(tx instanceof RemascTransaction)) { return TransactionValidationResult.ok(); } return TransactionValidationResult.withError("tran...
TxValidatorNotRemascTxValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (!(tx instanceof RemascTransaction)) { return TransactionValidationResu...
TxValidatorNotRemascTxValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (!(tx instanceof RemascTransaction)) { return TransactionValidationResu...
TxValidatorNotRemascTxValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (!(tx instanceof RemascTransaction)) { return TransactionValidationResu...
TxValidatorNotRemascTxValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (!(tx instanceof RemascTransaction)) { return TransactionValidationResu...
@Test public void commonTx() { TxValidatorNotRemascTxValidator validator = new TxValidatorNotRemascTxValidator(); Assert.assertTrue(validator.validate(Mockito.mock(Transaction.class), null, null, null, 0, false).transactionIsValid()); }
@Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (!(tx instanceof RemascTransaction)) { return TransactionValidationResult.ok(); } return TransactionValidationResult.withError("tran...
TxValidatorNotRemascTxValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (!(tx instanceof RemascTransaction)) { return TransactionValidationResu...
TxValidatorNotRemascTxValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (!(tx instanceof RemascTransaction)) { return TransactionValidationResu...
TxValidatorNotRemascTxValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (!(tx instanceof RemascTransaction)) { return TransactionValidationResu...
TxValidatorNotRemascTxValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (!(tx instanceof RemascTransaction)) { return TransactionValidationResu...
@Test public void validIntrinsicGasPrice() { Transaction tx1 = new Transaction(BigInteger.ZERO.toByteArray(), BigInteger.ZERO.toByteArray(), BigInteger.valueOf(21000).toByteArray(), new ECKey().getAddress(), BigInteger.ZERO.toByteArray(), null, Constants.REGTEST_CHAIN_ID); tx1.sign(new ECKey().getPrivKeyBytes()); Trans...
@Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (BigInteger.valueOf(tx.transactionCost(constants, activationConfig.forBlock(bestBlockNumber))).compareTo(tx.getGasLimitAsInteger()) ...
TxValidatorIntrinsicGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (BigInteger.valueOf(tx.transactionCost(constants, activationConfi...
TxValidatorIntrinsicGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (BigInteger.valueOf(tx.transactionCost(constants, activationConfi...
TxValidatorIntrinsicGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (BigInteger.valueOf(tx.transactionCost(constants, activationConfi...
TxValidatorIntrinsicGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (BigInteger.valueOf(tx.transactionCost(constants, activationConfi...
@Test public void invalidIntrinsicGasPrice() { Transaction tx1 = new Transaction(BigInteger.ZERO.toByteArray(), BigInteger.ZERO.toByteArray(), BigInteger.valueOf(21071).toByteArray(), new ECKey().getAddress(), BigInteger.ZERO.toByteArray(), Hex.decode("0001"), Constants.REGTEST_CHAIN_ID); tx1.sign(new ECKey().getPrivKe...
@Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (BigInteger.valueOf(tx.transactionCost(constants, activationConfig.forBlock(bestBlockNumber))).compareTo(tx.getGasLimitAsInteger()) ...
TxValidatorIntrinsicGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (BigInteger.valueOf(tx.transactionCost(constants, activationConfi...
TxValidatorIntrinsicGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (BigInteger.valueOf(tx.transactionCost(constants, activationConfi...
TxValidatorIntrinsicGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (BigInteger.valueOf(tx.transactionCost(constants, activationConfi...
TxValidatorIntrinsicGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (BigInteger.valueOf(tx.transactionCost(constants, activationConfi...
@Test public void testPublicKeyFromPrivate() { byte[] pubFromPriv = ECKey.publicKeyFromPrivate(privateKey, false); assertArrayEquals(pubKey, pubFromPriv); }
public static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed) { ECPoint point = CURVE.getG().multiply(privKey); return point.getEncoded(compressed); }
ECKey { public static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed) { ECPoint point = CURVE.getG().multiply(privKey); return point.getEncoded(compressed); } }
ECKey { public static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed) { ECPoint point = CURVE.getG().multiply(privKey); return point.getEncoded(compressed); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); }
ECKey { public static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed) { ECPoint point = CURVE.getG().multiply(privKey); return point.getEncoded(compressed); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed...
ECKey { public static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed) { ECPoint point = CURVE.getG().multiply(privKey); return point.getEncoded(compressed); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed...
@Test public void validGasLimit() { Transaction tx1 = Mockito.mock(Transaction.class); Transaction tx2 = Mockito.mock(Transaction.class); Mockito.when(tx1.getGasLimitAsInteger()).thenReturn(BigInteger.valueOf(1)); Mockito.when(tx2.getGasLimitAsInteger()).thenReturn(BigInteger.valueOf(6)); BigInteger gl = BigInteger.val...
@Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger txGasLimit = tx.getGasLimitAsInteger(); if (txGasLimit.compareTo(gasLimit) <= 0 && txGasLimit.compareTo(Constants.getTransac...
TxValidatorGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger txGasLimit = tx.getGasLimitAsInteger(); if (txGasLimit.compareTo(g...
TxValidatorGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger txGasLimit = tx.getGasLimitAsInteger(); if (txGasLimit.compareTo(g...
TxValidatorGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger txGasLimit = tx.getGasLimitAsInteger(); if (txGasLimit.compareTo(g...
TxValidatorGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger txGasLimit = tx.getGasLimitAsInteger(); if (txGasLimit.compareTo(g...
@Test public void invalidGasLimit() { Transaction tx1 = Mockito.mock(Transaction.class); Mockito.when(tx1.getGasLimitAsInteger()).thenReturn(BigInteger.valueOf(6)); Mockito.when(tx1.getHash()).thenReturn(Keccak256.ZERO_HASH); BigInteger gl = BigInteger.valueOf(3); TxValidatorGasLimitValidator tvglv = new TxValidatorGas...
@Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger txGasLimit = tx.getGasLimitAsInteger(); if (txGasLimit.compareTo(gasLimit) <= 0 && txGasLimit.compareTo(Constants.getTransac...
TxValidatorGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger txGasLimit = tx.getGasLimitAsInteger(); if (txGasLimit.compareTo(g...
TxValidatorGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger txGasLimit = tx.getGasLimitAsInteger(); if (txGasLimit.compareTo(g...
TxValidatorGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger txGasLimit = tx.getGasLimitAsInteger(); if (txGasLimit.compareTo(g...
TxValidatorGasLimitValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger txGasLimit = tx.getGasLimitAsInteger(); if (txGasLimit.compareTo(g...
@Test public void validAccountState() { AccountState state = Mockito.mock(AccountState.class); Mockito.when(state.isDeleted()).thenReturn(false); TxValidatorAccountStateValidator tvasv = new TxValidatorAccountStateValidator(); Assert.assertTrue(tvasv.validate(null, state, null, null, Long.MAX_VALUE, false).transactionI...
@Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state == null) { return TransactionValidationResult.withError("the sende...
TxValidatorAccountStateValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state == n...
TxValidatorAccountStateValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state == n...
TxValidatorAccountStateValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state == n...
TxValidatorAccountStateValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state == n...
@Test public void invalidAccountState() { AccountState state = Mockito.mock(AccountState.class); Mockito.when(state.isDeleted()).thenReturn(true); TxValidatorAccountStateValidator tvasv = new TxValidatorAccountStateValidator(); Assert.assertFalse(tvasv.validate(null, state, null, null, Long.MAX_VALUE, false).transactio...
@Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state == null) { return TransactionValidationResult.withError("the sende...
TxValidatorAccountStateValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state == n...
TxValidatorAccountStateValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state == n...
TxValidatorAccountStateValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state == n...
TxValidatorAccountStateValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state == n...
@Test public void oneSlotRange() { Transaction tx1 = Mockito.mock(Transaction.class); Transaction tx2 = Mockito.mock(Transaction.class); Transaction tx3 = Mockito.mock(Transaction.class); AccountState as = Mockito.mock(AccountState.class); Mockito.when(tx1.getNonceAsInteger()).thenReturn(BigInteger.valueOf(0)); Mockito...
@Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger nonce = tx.getNonceAsInteger(); BigInteger stateNonce = state == null ? BigInteger.ZERO : state.getNonce(); if (stateNonce.c...
TxValidatorNonceRangeValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger nonce = tx.getNonceAsInteger(); BigInteger stateNonce = state ==...
TxValidatorNonceRangeValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger nonce = tx.getNonceAsInteger(); BigInteger stateNonce = state ==...
TxValidatorNonceRangeValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger nonce = tx.getNonceAsInteger(); BigInteger stateNonce = state ==...
TxValidatorNonceRangeValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger nonce = tx.getNonceAsInteger(); BigInteger stateNonce = state ==...
@Test public void fiveSlotsRange() { Transaction[] txs = new Transaction[7]; for (int i = 0; i < 7; i++) { txs[i] = Mockito.mock(Transaction.class); Mockito.when(txs[i].getNonceAsInteger()).thenReturn(BigInteger.valueOf(i)); } AccountState as = Mockito.mock(AccountState.class); Mockito.when(as.getNonce()).thenReturn(Bi...
@Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger nonce = tx.getNonceAsInteger(); BigInteger stateNonce = state == null ? BigInteger.ZERO : state.getNonce(); if (stateNonce.c...
TxValidatorNonceRangeValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger nonce = tx.getNonceAsInteger(); BigInteger stateNonce = state ==...
TxValidatorNonceRangeValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger nonce = tx.getNonceAsInteger(); BigInteger stateNonce = state ==...
TxValidatorNonceRangeValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger nonce = tx.getNonceAsInteger(); BigInteger stateNonce = state ==...
TxValidatorNonceRangeValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { BigInteger nonce = tx.getNonceAsInteger(); BigInteger stateNonce = state ==...
@Test public void validAccountBalance() { Transaction tx1 = Mockito.mock(Transaction.class); Transaction tx2 = Mockito.mock(Transaction.class); Transaction tx3 = Mockito.mock(Transaction.class); AccountState as = Mockito.mock(AccountState.class); Mockito.when(tx1.getGasLimitAsInteger()).thenReturn(BigInteger.valueOf(1)...
@Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state == null) { return TransactionValidationResult.withError("the sende...
TxValidatorAccountBalanceValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state ==...
TxValidatorAccountBalanceValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state ==...
TxValidatorAccountBalanceValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state ==...
TxValidatorAccountBalanceValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state ==...
@Test public void invalidAccountBalance() { Transaction tx1 = Mockito.mock(Transaction.class); Transaction tx2 = Mockito.mock(Transaction.class); AccountState as = Mockito.mock(AccountState.class); Mockito.when(tx1.getGasLimitAsInteger()).thenReturn(BigInteger.valueOf(1)); Mockito.when(tx2.getGasLimitAsInteger()).thenR...
@Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state == null) { return TransactionValidationResult.withError("the sende...
TxValidatorAccountBalanceValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state ==...
TxValidatorAccountBalanceValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state ==...
TxValidatorAccountBalanceValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state ==...
TxValidatorAccountBalanceValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state ==...
@Test public void balanceIsNotValidatedIfFreeTx() { Transaction tx = new Transaction(BigInteger.ZERO.toByteArray(), BigInteger.ONE.toByteArray(), BigInteger.valueOf(21071).toByteArray(), new ECKey().getAddress(), BigInteger.ZERO.toByteArray(), Hex.decode("0001"), Constants.REGTEST_CHAIN_ID); tx.sign(new ECKey().getPriv...
@Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state == null) { return TransactionValidationResult.withError("the sende...
TxValidatorAccountBalanceValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state ==...
TxValidatorAccountBalanceValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state ==...
TxValidatorAccountBalanceValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state ==...
TxValidatorAccountBalanceValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } if (state ==...
@Test public void containsNoTransactions() { TxsPerAccount txspa = new TxsPerAccount(); Assert.assertNotNull(txspa.getTransactions()); Assert.assertTrue(txspa.getTransactions().isEmpty()); }
public List<Transaction> getTransactions(){ return txs; }
TxsPerAccount { public List<Transaction> getTransactions(){ return txs; } }
TxsPerAccount { public List<Transaction> getTransactions(){ return txs; } }
TxsPerAccount { public List<Transaction> getTransactions(){ return txs; } List<Transaction> getTransactions(); void setTransactions(List<Transaction> txs); @VisibleForTesting BigInteger getNextNonce(); }
TxsPerAccount { public List<Transaction> getTransactions(){ return txs; } List<Transaction> getTransactions(); void setTransactions(List<Transaction> txs); @VisibleForTesting BigInteger getNextNonce(); }
@Test public void testPublicKeyFromPrivateCompressed() { byte[] pubFromPriv = ECKey.publicKeyFromPrivate(privateKey, true); assertArrayEquals(compressedPubKey, pubFromPriv); }
public static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed) { ECPoint point = CURVE.getG().multiply(privKey); return point.getEncoded(compressed); }
ECKey { public static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed) { ECPoint point = CURVE.getG().multiply(privKey); return point.getEncoded(compressed); } }
ECKey { public static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed) { ECPoint point = CURVE.getG().multiply(privKey); return point.getEncoded(compressed); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); }
ECKey { public static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed) { ECPoint point = CURVE.getG().multiply(privKey); return point.getEncoded(compressed); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed...
ECKey { public static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed) { ECPoint point = CURVE.getG().multiply(privKey); return point.getEncoded(compressed); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed...
@Test public void nextNonceIsNull() { TxsPerAccount txspa = new TxsPerAccount(); Assert.assertNull(txspa.getNextNonce()); }
@VisibleForTesting public BigInteger getNextNonce() { return this.nextNonce; }
TxsPerAccount { @VisibleForTesting public BigInteger getNextNonce() { return this.nextNonce; } }
TxsPerAccount { @VisibleForTesting public BigInteger getNextNonce() { return this.nextNonce; } }
TxsPerAccount { @VisibleForTesting public BigInteger getNextNonce() { return this.nextNonce; } List<Transaction> getTransactions(); void setTransactions(List<Transaction> txs); @VisibleForTesting BigInteger getNextNonce(); }
TxsPerAccount { @VisibleForTesting public BigInteger getNextNonce() { return this.nextNonce; } List<Transaction> getTransactions(); void setTransactions(List<Transaction> txs); @VisibleForTesting BigInteger getNextNonce(); }
@Test public void doesNotCointainNonce() { TxsPerAccount txspa = new TxsPerAccount(); Assert.assertFalse(txspa.containsNonce(BigInteger.ONE)); }
boolean containsNonce(BigInteger nonce) { for (Transaction tx : txs) { if (new BigInteger(1, tx.getNonce()).equals(nonce)) { return true; } } return false; }
TxsPerAccount { boolean containsNonce(BigInteger nonce) { for (Transaction tx : txs) { if (new BigInteger(1, tx.getNonce()).equals(nonce)) { return true; } } return false; } }
TxsPerAccount { boolean containsNonce(BigInteger nonce) { for (Transaction tx : txs) { if (new BigInteger(1, tx.getNonce()).equals(nonce)) { return true; } } return false; } }
TxsPerAccount { boolean containsNonce(BigInteger nonce) { for (Transaction tx : txs) { if (new BigInteger(1, tx.getNonce()).equals(nonce)) { return true; } } return false; } List<Transaction> getTransactions(); void setTransactions(List<Transaction> txs); @VisibleForTesting BigInteger getNextNonce(); }
TxsPerAccount { boolean containsNonce(BigInteger nonce) { for (Transaction tx : txs) { if (new BigInteger(1, tx.getNonce()).equals(nonce)) { return true; } } return false; } List<Transaction> getTransactions(); void setTransactions(List<Transaction> txs); @VisibleForTesting BigInteger getNextNonce(); }
@Test public void containsNonce() { TxsPerAccount txspa = new TxsPerAccount(); Transaction tx = buildTransaction(1); txspa.getTransactions().add(tx); Assert.assertTrue(txspa.containsNonce(BigInteger.ONE)); }
boolean containsNonce(BigInteger nonce) { for (Transaction tx : txs) { if (new BigInteger(1, tx.getNonce()).equals(nonce)) { return true; } } return false; }
TxsPerAccount { boolean containsNonce(BigInteger nonce) { for (Transaction tx : txs) { if (new BigInteger(1, tx.getNonce()).equals(nonce)) { return true; } } return false; } }
TxsPerAccount { boolean containsNonce(BigInteger nonce) { for (Transaction tx : txs) { if (new BigInteger(1, tx.getNonce()).equals(nonce)) { return true; } } return false; } }
TxsPerAccount { boolean containsNonce(BigInteger nonce) { for (Transaction tx : txs) { if (new BigInteger(1, tx.getNonce()).equals(nonce)) { return true; } } return false; } List<Transaction> getTransactions(); void setTransactions(List<Transaction> txs); @VisibleForTesting BigInteger getNextNonce(); }
TxsPerAccount { boolean containsNonce(BigInteger nonce) { for (Transaction tx : txs) { if (new BigInteger(1, tx.getNonce()).equals(nonce)) { return true; } } return false; } List<Transaction> getTransactions(); void setTransactions(List<Transaction> txs); @VisibleForTesting BigInteger getNextNonce(); }
@Test public void status() { Block bestBlock = mock(Block.class); Keccak256 blockHash = mock(Keccak256.class); byte[] hashBytes = new byte[]{0x00}; long blockNumber = 52; BlockDifficulty totalDifficulty = mock(BlockDifficulty.class); when(blockStore.getBestBlock()).thenReturn(bestBlock); when(bestBlock.getHash()).thenR...
public Status currentStatus() { Status status; if (blockStore.getMinNumber() != 0) { status = new Status( genesis.getNumber(), genesis.getHash().getBytes(), genesis.getParentHash().getBytes(), genesis.getCumulativeDifficulty()); } else { Block block = blockStore.getBestBlock(); BlockDifficulty totalDifficulty = blockSt...
StatusResolver { public Status currentStatus() { Status status; if (blockStore.getMinNumber() != 0) { status = new Status( genesis.getNumber(), genesis.getHash().getBytes(), genesis.getParentHash().getBytes(), genesis.getCumulativeDifficulty()); } else { Block block = blockStore.getBestBlock(); BlockDifficulty totalDif...
StatusResolver { public Status currentStatus() { Status status; if (blockStore.getMinNumber() != 0) { status = new Status( genesis.getNumber(), genesis.getHash().getBytes(), genesis.getParentHash().getBytes(), genesis.getCumulativeDifficulty()); } else { Block block = blockStore.getBestBlock(); BlockDifficulty totalDif...
StatusResolver { public Status currentStatus() { Status status; if (blockStore.getMinNumber() != 0) { status = new Status( genesis.getNumber(), genesis.getHash().getBytes(), genesis.getParentHash().getBytes(), genesis.getCumulativeDifficulty()); } else { Block block = blockStore.getBestBlock(); BlockDifficulty totalDif...
StatusResolver { public Status currentStatus() { Status status; if (blockStore.getMinNumber() != 0) { status = new Status( genesis.getNumber(), genesis.getHash().getBytes(), genesis.getParentHash().getBytes(), genesis.getCumulativeDifficulty()); } else { Block block = blockStore.getBestBlock(); BlockDifficulty totalDif...
@Test public void status_incompleteBlockchain() { when(blockStore.getMinNumber()).thenReturn(1L); Keccak256 genesisHash = new Keccak256("ee5c851e70650111887bb6c04e18ef4353391abe37846234c17895a9ca2b33d5"); Keccak256 parentHash = new Keccak256("133e83bb305ef21ea7fc86fcced355db2300887274961a136ca5e8c8763687d9"); when(gene...
public Status currentStatus() { Status status; if (blockStore.getMinNumber() != 0) { status = new Status( genesis.getNumber(), genesis.getHash().getBytes(), genesis.getParentHash().getBytes(), genesis.getCumulativeDifficulty()); } else { Block block = blockStore.getBestBlock(); BlockDifficulty totalDifficulty = blockSt...
StatusResolver { public Status currentStatus() { Status status; if (blockStore.getMinNumber() != 0) { status = new Status( genesis.getNumber(), genesis.getHash().getBytes(), genesis.getParentHash().getBytes(), genesis.getCumulativeDifficulty()); } else { Block block = blockStore.getBestBlock(); BlockDifficulty totalDif...
StatusResolver { public Status currentStatus() { Status status; if (blockStore.getMinNumber() != 0) { status = new Status( genesis.getNumber(), genesis.getHash().getBytes(), genesis.getParentHash().getBytes(), genesis.getCumulativeDifficulty()); } else { Block block = blockStore.getBestBlock(); BlockDifficulty totalDif...
StatusResolver { public Status currentStatus() { Status status; if (blockStore.getMinNumber() != 0) { status = new Status( genesis.getNumber(), genesis.getHash().getBytes(), genesis.getParentHash().getBytes(), genesis.getCumulativeDifficulty()); } else { Block block = blockStore.getBestBlock(); BlockDifficulty totalDif...
StatusResolver { public Status currentStatus() { Status status; if (blockStore.getMinNumber() != 0) { status = new Status( genesis.getNumber(), genesis.getHash().getBytes(), genesis.getParentHash().getBytes(), genesis.getCumulativeDifficulty()); } else { Block block = blockStore.getBestBlock(); BlockDifficulty totalDif...
@Test public void buildSimpleLogMessage() { String blockHash = "0x01020304"; Duration processingTime = Duration.ofNanos(123_000_000L); String result = BlockProcessResult.buildLogMessage(blockHash, processingTime, null); Assert.assertNotNull(result); Assert.assertEquals("[MESSAGE PROCESS] Block[0x01020304] After[0.12300...
@VisibleForTesting public static String buildLogMessage(String blockHash, Duration processingTime, Map<Keccak256, ImportResult> result) { StringBuilder sb = new StringBuilder("[MESSAGE PROCESS] Block[") .append(blockHash) .append("] After[") .append(FormatUtils.formatNanosecondsToSeconds(processingTime.toNanos())) .app...
BlockProcessResult { @VisibleForTesting public static String buildLogMessage(String blockHash, Duration processingTime, Map<Keccak256, ImportResult> result) { StringBuilder sb = new StringBuilder("[MESSAGE PROCESS] Block[") .append(blockHash) .append("] After[") .append(FormatUtils.formatNanosecondsToSeconds(processing...
BlockProcessResult { @VisibleForTesting public static String buildLogMessage(String blockHash, Duration processingTime, Map<Keccak256, ImportResult> result) { StringBuilder sb = new StringBuilder("[MESSAGE PROCESS] Block[") .append(blockHash) .append("] After[") .append(FormatUtils.formatNanosecondsToSeconds(processing...
BlockProcessResult { @VisibleForTesting public static String buildLogMessage(String blockHash, Duration processingTime, Map<Keccak256, ImportResult> result) { StringBuilder sb = new StringBuilder("[MESSAGE PROCESS] Block[") .append(blockHash) .append("] After[") .append(FormatUtils.formatNanosecondsToSeconds(processing...
BlockProcessResult { @VisibleForTesting public static String buildLogMessage(String blockHash, Duration processingTime, Map<Keccak256, ImportResult> result) { StringBuilder sb = new StringBuilder("[MESSAGE PROCESS] Block[") .append(blockHash) .append("] After[") .append(FormatUtils.formatNanosecondsToSeconds(processing...
@Test public void buildLogMessageWithConnections() { String blockHash = "0x01020304"; Duration processingTime = Duration.ofNanos(123_000_000L); Map<Keccak256, ImportResult> connections = new HashMap<>(); Random random = new Random(); byte[] bytes = new byte[32]; random.nextBytes(bytes); Keccak256 hash = new Keccak256(b...
@VisibleForTesting public static String buildLogMessage(String blockHash, Duration processingTime, Map<Keccak256, ImportResult> result) { StringBuilder sb = new StringBuilder("[MESSAGE PROCESS] Block[") .append(blockHash) .append("] After[") .append(FormatUtils.formatNanosecondsToSeconds(processingTime.toNanos())) .app...
BlockProcessResult { @VisibleForTesting public static String buildLogMessage(String blockHash, Duration processingTime, Map<Keccak256, ImportResult> result) { StringBuilder sb = new StringBuilder("[MESSAGE PROCESS] Block[") .append(blockHash) .append("] After[") .append(FormatUtils.formatNanosecondsToSeconds(processing...
BlockProcessResult { @VisibleForTesting public static String buildLogMessage(String blockHash, Duration processingTime, Map<Keccak256, ImportResult> result) { StringBuilder sb = new StringBuilder("[MESSAGE PROCESS] Block[") .append(blockHash) .append("] After[") .append(FormatUtils.formatNanosecondsToSeconds(processing...
BlockProcessResult { @VisibleForTesting public static String buildLogMessage(String blockHash, Duration processingTime, Map<Keccak256, ImportResult> result) { StringBuilder sb = new StringBuilder("[MESSAGE PROCESS] Block[") .append(blockHash) .append("] After[") .append(FormatUtils.formatNanosecondsToSeconds(processing...
BlockProcessResult { @VisibleForTesting public static String buildLogMessage(String blockHash, Duration processingTime, Map<Keccak256, ImportResult> result) { StringBuilder sb = new StringBuilder("[MESSAGE PROCESS] Block[") .append(blockHash) .append("] After[") .append(FormatUtils.formatNanosecondsToSeconds(processing...
@Test public void processBlockMessageUsingProcessor() { SimplePeer sender = new SimplePeer(); PeerScoringManager scoring = createPeerScoringManager(); SimpleBlockProcessor sbp = new SimpleBlockProcessor(); NodeMessageHandler processor = new NodeMessageHandler(config, sbp, null, null, null, scoring, mock(StatusResolver....
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void skipProcessGenesisBlock() throws UnknownHostException { SimplePeer sender = new SimplePeer(); PeerScoringManager scoring = createPeerScoringManager(); SimpleBlockProcessor sbp = new SimpleBlockProcessor(); NodeMessageHandler processor = new NodeMessageHandler(config, sbp, null, null, null, scoring, mo...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void skipAdvancedBlock() throws UnknownHostException { SimplePeer sender = new SimplePeer(); PeerScoringManager scoring = createPeerScoringManager(); SimpleBlockProcessor sbp = new SimpleBlockProcessor(); sbp.setBlockGap(100000); NodeMessageHandler processor = new NodeMessageHandler(config, sbp, null, null...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void testGetAddress() { ECKey key = ECKey.fromPublicOnly(pubKey); assertArrayEquals(Hex.decode(address), key.getAddress()); }
public byte[] getAddress() { if (pubKeyHash == null) { byte[] pubBytes = this.pub.getEncoded(false); pubKeyHash = HashUtil.keccak256Omit12(Arrays.copyOfRange(pubBytes, 1, pubBytes.length)); } return pubKeyHash; }
ECKey { public byte[] getAddress() { if (pubKeyHash == null) { byte[] pubBytes = this.pub.getEncoded(false); pubKeyHash = HashUtil.keccak256Omit12(Arrays.copyOfRange(pubBytes, 1, pubBytes.length)); } return pubKeyHash; } }
ECKey { public byte[] getAddress() { if (pubKeyHash == null) { byte[] pubBytes = this.pub.getEncoded(false); pubKeyHash = HashUtil.keccak256Omit12(Arrays.copyOfRange(pubBytes, 1, pubBytes.length)); } return pubKeyHash; } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); }
ECKey { public byte[] getAddress() { if (pubKeyHash == null) { byte[] pubBytes = this.pub.getEncoded(false); pubKeyHash = HashUtil.keccak256Omit12(Arrays.copyOfRange(pubBytes, 1, pubBytes.length)); } return pubKeyHash; } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ...
ECKey { public byte[] getAddress() { if (pubKeyHash == null) { byte[] pubBytes = this.pub.getEncoded(false); pubKeyHash = HashUtil.keccak256Omit12(Arrays.copyOfRange(pubBytes, 1, pubBytes.length)); } return pubKeyHash; } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ...
@Test public void postBlockMessageTwice() throws InterruptedException, UnknownHostException { Peer sender = new SimplePeer(); PeerScoringManager scoring = createPeerScoringManager(); SimpleBlockProcessor sbp = new SimpleBlockProcessor(); NodeMessageHandler processor = new NodeMessageHandler(config, sbp, null, null, nul...
@Override public void postMessage(Peer sender, Message message) { logger.trace("Start post message (queue size {}) (message type {})", this.queue.size(), message.getMessageType()); cleanExpiredMessages(); tryAddMessage(sender, message); logger.trace("End post message (queue size {})", this.queue.size()); }
NodeMessageHandler implements MessageHandler, InternalService, Runnable { @Override public void postMessage(Peer sender, Message message) { logger.trace("Start post message (queue size {}) (message type {})", this.queue.size(), message.getMessageType()); cleanExpiredMessages(); tryAddMessage(sender, message); logger.tr...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { @Override public void postMessage(Peer sender, Message message) { logger.trace("Start post message (queue size {}) (message type {})", this.queue.size(), message.getMessageType()); cleanExpiredMessages(); tryAddMessage(sender, message); logger.tr...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { @Override public void postMessage(Peer sender, Message message) { logger.trace("Start post message (queue size {}) (message type {})", this.queue.size(), message.getMessageType()); cleanExpiredMessages(); tryAddMessage(sender, message); logger.tr...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { @Override public void postMessage(Peer sender, Message message) { logger.trace("Start post message (queue size {}) (message type {})", this.queue.size(), message.getMessageType()); cleanExpiredMessages(); tryAddMessage(sender, message); logger.tr...
@Test public void processMissingPoWBlockMessageUsingProcessor() throws UnknownHostException { SimplePeer sender = new SimplePeer(); PeerScoringManager scoring = createPeerScoringManager(); SimpleBlockProcessor sbp = new SimpleBlockProcessor(); NodeMessageHandler processor = new NodeMessageHandler(config, sbp, null, nul...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void processFutureBlockMessageUsingProcessor() throws UnknownHostException { SimpleBlockProcessor sbp = new SimpleBlockProcessor(); NodeMessageHandler processor = new NodeMessageHandler(config, sbp, null, null, null, null, mock(StatusResolver.class)); Block block = new BlockGenerator().getGenesisBlock(); M...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test @Ignore("This should be reviewed with sync processor or deleted") public void processStatusMessageUsingNodeBlockProcessor() throws UnknownHostException { final World world = new World(); final Blockchain blockchain = world.getBlockChain(); final NetBlockStore store = new NetBlockStore(); BlockNodeInformation node...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test() public void processStatusMessageUsingSyncProcessor() { final SimplePeer sender = new SimplePeer(); final ChannelManager channelManager = mock(ChannelManager.class); when(channelManager.getActivePeers()).thenReturn(Collections.singletonList(sender)); final NodeMessageHandler handler = NodeMessageHandlerUtil.crea...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void processStatusMessageWithKnownBestBlock() { final World world = new World(); final Blockchain blockchain = world.getBlockChain(); final NetBlockStore store = new NetBlockStore(); BlockNodeInformation nodeInformation = new BlockNodeInformation(); SyncConfiguration syncConfiguration = SyncConfiguration.I...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void processGetBlockMessageUsingBlockInStore() throws UnknownHostException { final Block block = new BlockGenerator().getBlock(3); final World world = new World(); final Blockchain blockchain = world.getBlockChain(); final NetBlockStore store = new NetBlockStore(); store.saveBlock(block); BlockNodeInformat...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void processGetBlockMessageUsingBlockInBlockchain() throws UnknownHostException { final World world = new World(); final Blockchain blockchain = world.getBlockChain(); final NetBlockStore store = new NetBlockStore(); List<Block> blocks = new BlockGenerator().getBlockChain(blockchain.getBestBlock(), 10); fo...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void processGetBlockMessageUsingEmptyStore() throws UnknownHostException { final Block block = new BlockGenerator().getBlock(3); final World world = new World(); final Blockchain blockchain = world.getBlockChain(); final NetBlockStore store = new NetBlockStore(); BlockNodeInformation nodeInformation = new ...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void processBlockHeaderRequestMessageUsingBlockInStore() throws UnknownHostException { final Block block = new BlockGenerator().getBlock(3); final World world = new World(); final Blockchain blockchain = world.getBlockChain(); final NetBlockStore store = new NetBlockStore(); store.saveBlock(block); BlockNo...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void testToString() { ECKey key = ECKey.fromPrivate(BigInteger.TEN); assertEquals("pub:04a0434d9e47f3c86235477c7b1ae6ae5d3442d49b1943c2b752a68e2a47e247c7893aba425419bc27a3b6c7e693a24c696f794c2ed877a1593cbee53b037368d7", key.toString()); }
public String toString() { StringBuilder b = new StringBuilder(); b.append("pub:").append(ByteUtil.toHexString(pub.getEncoded(false))); return b.toString(); }
ECKey { public String toString() { StringBuilder b = new StringBuilder(); b.append("pub:").append(ByteUtil.toHexString(pub.getEncoded(false))); return b.toString(); } }
ECKey { public String toString() { StringBuilder b = new StringBuilder(); b.append("pub:").append(ByteUtil.toHexString(pub.getEncoded(false))); return b.toString(); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); }
ECKey { public String toString() { StringBuilder b = new StringBuilder(); b.append("pub:").append(ByteUtil.toHexString(pub.getEncoded(false))); return b.toString(); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static EC...
ECKey { public String toString() { StringBuilder b = new StringBuilder(); b.append("pub:").append(ByteUtil.toHexString(pub.getEncoded(false))); return b.toString(); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static EC...
@Test public void processBlockHeaderRequestMessageUsingBlockInBlockchain() throws UnknownHostException { final World world = new World(); final Blockchain blockchain = world.getBlockChain(); final NetBlockStore store = new NetBlockStore(); List<Block> blocks = new BlockGenerator().getBlockChain(blockchain.getBestBlock(...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void processNewBlockHashesMessage() throws UnknownHostException { final World world = new World(); final Blockchain blockchain = world.getBlockChain(); final NetBlockStore store = new NetBlockStore(); final List<Block> blocks = new BlockGenerator().getBlockChain(blockchain.getBestBlock(), 15); final List<B...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void processNewBlockHashesMessageDoesNothingBecauseNodeIsSyncing() { BlockProcessor blockProcessor = mock(BlockProcessor.class); Mockito.when(blockProcessor.hasBetterBlockToSync()).thenReturn(true); final NodeMessageHandler handler = new NodeMessageHandler(config, blockProcessor, null, null, null, null, mo...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void processTransactionsMessage() throws UnknownHostException { PeerScoringManager scoring = createPeerScoringManager(); TransactionGateway transactionGateway = mock(TransactionGateway.class); BlockProcessor blockProcessor = mock(BlockProcessor.class); Mockito.when(blockProcessor.hasBetterBlockToSync()).th...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void processRejectedTransactionsMessage() throws UnknownHostException { PeerScoringManager scoring = createPeerScoringManager(); final SimpleChannelManager channelManager = new SimpleChannelManager(); TransactionGateway transactionGateway = mock(TransactionGateway.class); BlockProcessor blockProcessor = mo...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void processTooMuchGasTransactionMessage() throws UnknownHostException { PeerScoringManager scoring = createPeerScoringManager(); final SimpleChannelManager channelManager = new SimpleChannelManager(); TransactionGateway transactionGateway = mock(TransactionGateway.class); BlockProcessor blockProcessor = m...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void processTransactionsMessageUsingTransactionPool() throws UnknownHostException { TransactionGateway transactionGateway = mock(TransactionGateway.class); BlockProcessor blockProcessor = mock(BlockProcessor.class); Mockito.when(blockProcessor.hasBetterBlockToSync()).thenReturn(false); final NodeMessageHan...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void processBlockByHashRequestMessageUsingProcessor() throws UnknownHostException { SimpleBlockProcessor sbp = new SimpleBlockProcessor(); NodeMessageHandler processor = new NodeMessageHandler(config, sbp, null, null, null, null, mock(StatusResolver.class)); Block block = new BlockChainBuilder().ofSize(1, ...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void processBlockHeadersRequestMessageUsingProcessor() throws UnknownHostException { byte[] hash = HashUtil.randomHash(); SimpleBlockProcessor sbp = new SimpleBlockProcessor(); NodeMessageHandler processor = new NodeMessageHandler(config, sbp, null, null, null, null, mock(StatusResolver.class)); Message me...
public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor mv = new MessageVisitor(config, blockProcessor, syncProcessor, transactio...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
NodeMessageHandler implements MessageHandler, InternalService, Runnable { public synchronized void processMessage(final Peer sender, @Nonnull final Message message) { long start = System.nanoTime(); MessageType messageType = message.getMessageType(); logger.trace("Process message type: {}", messageType); MessageVisitor...
@Test public void startsSyncingWith5Peers() { SyncConfiguration syncConfiguration = SyncConfiguration.DEFAULT; SimpleSyncEventsHandler syncEventsHandler = new SimpleSyncEventsHandler(); PeersInformation peersInformation = mock(PeersInformation.class); when(peersInformation.count()).thenReturn(1,2,3,4,5); BlockStore blo...
@Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } }
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } }
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } DecidingSyncState(SyncConfiguration syncConfiguration, SyncEventsHandler syncEventsHandler, ...
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } DecidingSyncState(SyncConfiguration syncConfiguration, SyncEventsHandler syncEventsHandler, ...
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } DecidingSyncState(SyncConfiguration syncConfiguration, SyncEventsHandler syncEventsHandler, ...
@Test public void testIsPubKeyCanonicalCorect() { byte[] canonicalPubkey1 = new byte[65]; canonicalPubkey1[0] = 0x04; assertTrue(ECKey.isPubKeyCanonical(canonicalPubkey1)); byte[] canonicalPubkey2 = new byte[33]; canonicalPubkey2[0] = 0x02; assertTrue(ECKey.isPubKeyCanonical(canonicalPubkey2)); byte[] canonicalPubkey3 ...
public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); }
ECKey { public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); } }
ECKey { public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); }
ECKey { public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static ECPoint decompressPoint(ECPoint compressed); static ECKey fromPrivate(Big...
ECKey { public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static ECPoint decompressPoint(ECPoint compressed); static ECKey fromPrivate(Big...
@Test public void doesntStartSyncingWithNoPeersAfter2Minutes() { SyncConfiguration syncConfiguration = SyncConfiguration.DEFAULT; SimpleSyncEventsHandler syncEventsHandler = new SimpleSyncEventsHandler(); PeersInformation knownPeers = mock(PeersInformation.class); when(knownPeers.count()).thenReturn(0); when(knownPeers...
@Override public void tick(Duration duration) { peersInformation.cleanExpired(); timeElapsed = timeElapsed.plus(duration); if (peersInformation.count() > 0 && timeElapsed.compareTo(syncConfiguration.getTimeoutWaitingPeers()) >= 0) { tryStartSyncing(); } }
DecidingSyncState extends BaseSyncState { @Override public void tick(Duration duration) { peersInformation.cleanExpired(); timeElapsed = timeElapsed.plus(duration); if (peersInformation.count() > 0 && timeElapsed.compareTo(syncConfiguration.getTimeoutWaitingPeers()) >= 0) { tryStartSyncing(); } } }
DecidingSyncState extends BaseSyncState { @Override public void tick(Duration duration) { peersInformation.cleanExpired(); timeElapsed = timeElapsed.plus(duration); if (peersInformation.count() > 0 && timeElapsed.compareTo(syncConfiguration.getTimeoutWaitingPeers()) >= 0) { tryStartSyncing(); } } DecidingSyncState(Sync...
DecidingSyncState extends BaseSyncState { @Override public void tick(Duration duration) { peersInformation.cleanExpired(); timeElapsed = timeElapsed.plus(duration); if (peersInformation.count() > 0 && timeElapsed.compareTo(syncConfiguration.getTimeoutWaitingPeers()) >= 0) { tryStartSyncing(); } } DecidingSyncState(Sync...
DecidingSyncState extends BaseSyncState { @Override public void tick(Duration duration) { peersInformation.cleanExpired(); timeElapsed = timeElapsed.plus(duration); if (peersInformation.count() > 0 && timeElapsed.compareTo(syncConfiguration.getTimeoutWaitingPeers()) >= 0) { tryStartSyncing(); } } DecidingSyncState(Sync...
@Test public void startsSyncingWith1PeerAfter2Minutes() { SyncConfiguration syncConfiguration = SyncConfiguration.DEFAULT; SyncEventsHandler syncEventsHandler = mock(SyncEventsHandler.class); PeersInformation peersInformation = mock(PeersInformation.class); when(peersInformation.count()).thenReturn(1); when(peersInform...
@Override public void tick(Duration duration) { peersInformation.cleanExpired(); timeElapsed = timeElapsed.plus(duration); if (peersInformation.count() > 0 && timeElapsed.compareTo(syncConfiguration.getTimeoutWaitingPeers()) >= 0) { tryStartSyncing(); } }
DecidingSyncState extends BaseSyncState { @Override public void tick(Duration duration) { peersInformation.cleanExpired(); timeElapsed = timeElapsed.plus(duration); if (peersInformation.count() > 0 && timeElapsed.compareTo(syncConfiguration.getTimeoutWaitingPeers()) >= 0) { tryStartSyncing(); } } }
DecidingSyncState extends BaseSyncState { @Override public void tick(Duration duration) { peersInformation.cleanExpired(); timeElapsed = timeElapsed.plus(duration); if (peersInformation.count() > 0 && timeElapsed.compareTo(syncConfiguration.getTimeoutWaitingPeers()) >= 0) { tryStartSyncing(); } } DecidingSyncState(Sync...
DecidingSyncState extends BaseSyncState { @Override public void tick(Duration duration) { peersInformation.cleanExpired(); timeElapsed = timeElapsed.plus(duration); if (peersInformation.count() > 0 && timeElapsed.compareTo(syncConfiguration.getTimeoutWaitingPeers()) >= 0) { tryStartSyncing(); } } DecidingSyncState(Sync...
DecidingSyncState extends BaseSyncState { @Override public void tick(Duration duration) { peersInformation.cleanExpired(); timeElapsed = timeElapsed.plus(duration); if (peersInformation.count() > 0 && timeElapsed.compareTo(syncConfiguration.getTimeoutWaitingPeers()) >= 0) { tryStartSyncing(); } } DecidingSyncState(Sync...
@Test public void backwardsSynchronization() { SyncConfiguration syncConfiguration = SyncConfiguration.DEFAULT; PeersInformation peersInformation = mock(PeersInformation.class); SyncEventsHandler syncEventsHandler = mock(SyncEventsHandler.class); BlockStore blockStore = mock(BlockStore.class); SyncState syncState = new...
@Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } }
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } }
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } DecidingSyncState(SyncConfiguration syncConfiguration, SyncEventsHandler syncEventsHandler, ...
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } DecidingSyncState(SyncConfiguration syncConfiguration, SyncEventsHandler syncEventsHandler, ...
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } DecidingSyncState(SyncConfiguration syncConfiguration, SyncEventsHandler syncEventsHandler, ...
@Test public void forwardsSynchronization_genesisIsConnected() { SyncConfiguration syncConfiguration = SyncConfiguration.DEFAULT; PeersInformation peersInformation = mock(PeersInformation.class); SyncEventsHandler syncEventsHandler = mock(SyncEventsHandler.class); BlockStore blockStore = mock(BlockStore.class); SyncSta...
@Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } }
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } }
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } DecidingSyncState(SyncConfiguration syncConfiguration, SyncEventsHandler syncEventsHandler, ...
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } DecidingSyncState(SyncConfiguration syncConfiguration, SyncEventsHandler syncEventsHandler, ...
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } DecidingSyncState(SyncConfiguration syncConfiguration, SyncEventsHandler syncEventsHandler, ...
@Test public void forwardsSynchronization() { SyncConfiguration syncConfiguration = SyncConfiguration.DEFAULT; PeersInformation peersInformation = mock(PeersInformation.class); SyncEventsHandler syncEventsHandler = mock(SyncEventsHandler.class); BlockStore blockStore = mock(BlockStore.class); SyncState syncState = new ...
@Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } }
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } }
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } DecidingSyncState(SyncConfiguration syncConfiguration, SyncEventsHandler syncEventsHandler, ...
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } DecidingSyncState(SyncConfiguration syncConfiguration, SyncEventsHandler syncEventsHandler, ...
DecidingSyncState extends BaseSyncState { @Override public void newPeerStatus() { if (peersInformation.count() >= syncConfiguration.getExpectedPeers()) { tryStartSyncing(); } } DecidingSyncState(SyncConfiguration syncConfiguration, SyncEventsHandler syncEventsHandler, ...
@Test(expected = IllegalStateException.class) public void onEnter_connectGenesis_genesisIsNotChildsParent() { List<BlockHeader> toRequest = new LinkedList<>(); DownloadingBackwardsBodiesSyncState target = new DownloadingBackwardsBodiesSyncState( syncConfiguration, syncEventsHandler, peersInformation, genesis, blockFact...
@Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransit.size() < syncConfiguration.getMaxRequestedBodies()) { Bloc...
DownloadingBackwardsBodiesSyncState extends BaseSyncState { @Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransi...
DownloadingBackwardsBodiesSyncState extends BaseSyncState { @Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransi...
DownloadingBackwardsBodiesSyncState extends BaseSyncState { @Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransi...
DownloadingBackwardsBodiesSyncState extends BaseSyncState { @Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransi...
@Test(expected = IllegalStateException.class) public void onEnter_connectGenesis_difficultyDoesNotMatch() { List<BlockHeader> toRequest = new LinkedList<>(); DownloadingBackwardsBodiesSyncState target = new DownloadingBackwardsBodiesSyncState( syncConfiguration, syncEventsHandler, peersInformation, genesis, blockFactor...
@Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransit.size() < syncConfiguration.getMaxRequestedBodies()) { Bloc...
DownloadingBackwardsBodiesSyncState extends BaseSyncState { @Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransi...
DownloadingBackwardsBodiesSyncState extends BaseSyncState { @Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransi...
DownloadingBackwardsBodiesSyncState extends BaseSyncState { @Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransi...
DownloadingBackwardsBodiesSyncState extends BaseSyncState { @Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransi...
@Test public void onEnter_connectGenesis() { List<BlockHeader> toRequest = new LinkedList<>(); DownloadingBackwardsBodiesSyncState target = new DownloadingBackwardsBodiesSyncState( syncConfiguration, syncEventsHandler, peersInformation, genesis, blockFactory, blockStore, child, toRequest, peer); Keccak256 childHash = n...
@Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransit.size() < syncConfiguration.getMaxRequestedBodies()) { Bloc...
DownloadingBackwardsBodiesSyncState extends BaseSyncState { @Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransi...
DownloadingBackwardsBodiesSyncState extends BaseSyncState { @Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransi...
DownloadingBackwardsBodiesSyncState extends BaseSyncState { @Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransi...
DownloadingBackwardsBodiesSyncState extends BaseSyncState { @Override public void onEnter() { if (child.getNumber() == 1L) { connectGenesis(child); blockStore.flush(); syncEventsHandler.stopSyncing(); return; } if (toRequest.isEmpty()) { syncEventsHandler.stopSyncing(); return; } while (!toRequest.isEmpty() && inTransi...
@Test public void onEnter() { when(blockStore.getMinNumber()).thenReturn(50L); Block child = mock(Block.class); Keccak256 hash = new Keccak256(new byte[32]); when(child.getHash()).thenReturn(hash); when(blockStore.getChainBlockByNumber(50L)).thenReturn(child); DownloadingBackwardsHeadersSyncState target = new Downloadi...
@Override public void onEnter() { Keccak256 hashToRequest = child.getHash(); ChunkDescriptor chunkDescriptor = new ChunkDescriptor( hashToRequest.getBytes(), syncConfiguration.getChunkSize()); syncEventsHandler.sendBlockHeadersRequest(selectedPeer, chunkDescriptor); }
DownloadingBackwardsHeadersSyncState extends BaseSyncState { @Override public void onEnter() { Keccak256 hashToRequest = child.getHash(); ChunkDescriptor chunkDescriptor = new ChunkDescriptor( hashToRequest.getBytes(), syncConfiguration.getChunkSize()); syncEventsHandler.sendBlockHeadersRequest(selectedPeer, chunkDescr...
DownloadingBackwardsHeadersSyncState extends BaseSyncState { @Override public void onEnter() { Keccak256 hashToRequest = child.getHash(); ChunkDescriptor chunkDescriptor = new ChunkDescriptor( hashToRequest.getBytes(), syncConfiguration.getChunkSize()); syncEventsHandler.sendBlockHeadersRequest(selectedPeer, chunkDescr...
DownloadingBackwardsHeadersSyncState extends BaseSyncState { @Override public void onEnter() { Keccak256 hashToRequest = child.getHash(); ChunkDescriptor chunkDescriptor = new ChunkDescriptor( hashToRequest.getBytes(), syncConfiguration.getChunkSize()); syncEventsHandler.sendBlockHeadersRequest(selectedPeer, chunkDescr...
DownloadingBackwardsHeadersSyncState extends BaseSyncState { @Override public void onEnter() { Keccak256 hashToRequest = child.getHash(); ChunkDescriptor chunkDescriptor = new ChunkDescriptor( hashToRequest.getBytes(), syncConfiguration.getChunkSize()); syncEventsHandler.sendBlockHeadersRequest(selectedPeer, chunkDescr...
@Test public void newHeaders() { when(blockStore.getMinNumber()).thenReturn(50L); Block child = mock(Block.class); Keccak256 hash = new Keccak256(new byte[32]); when(child.getHash()).thenReturn(hash); when(blockStore.getChainBlockByNumber(50L)).thenReturn(child); DownloadingBackwardsHeadersSyncState target = new Downlo...
@Override public void newBlockHeaders(List<BlockHeader> toRequest) { syncEventsHandler.backwardDownloadBodies( child, toRequest.stream().skip(1).collect(Collectors.toList()), selectedPeer ); }
DownloadingBackwardsHeadersSyncState extends BaseSyncState { @Override public void newBlockHeaders(List<BlockHeader> toRequest) { syncEventsHandler.backwardDownloadBodies( child, toRequest.stream().skip(1).collect(Collectors.toList()), selectedPeer ); } }
DownloadingBackwardsHeadersSyncState extends BaseSyncState { @Override public void newBlockHeaders(List<BlockHeader> toRequest) { syncEventsHandler.backwardDownloadBodies( child, toRequest.stream().skip(1).collect(Collectors.toList()), selectedPeer ); } DownloadingBackwardsHeadersSyncState( SyncConfiguratio...
DownloadingBackwardsHeadersSyncState extends BaseSyncState { @Override public void newBlockHeaders(List<BlockHeader> toRequest) { syncEventsHandler.backwardDownloadBodies( child, toRequest.stream().skip(1).collect(Collectors.toList()), selectedPeer ); } DownloadingBackwardsHeadersSyncState( SyncConfiguratio...
DownloadingBackwardsHeadersSyncState extends BaseSyncState { @Override public void newBlockHeaders(List<BlockHeader> toRequest) { syncEventsHandler.backwardDownloadBodies( child, toRequest.stream().skip(1).collect(Collectors.toList()), selectedPeer ); } DownloadingBackwardsHeadersSyncState( SyncConfiguratio...
@Test public void testIsPubKeyCanonicalWrongLength() { byte[] nonCanonicalPubkey1 = new byte[64]; nonCanonicalPubkey1[0] = 0x04; assertFalse(ECKey.isPubKeyCanonical(nonCanonicalPubkey1)); byte[] nonCanonicalPubkey2 = new byte[32]; nonCanonicalPubkey2[0] = 0x02; assertFalse(ECKey.isPubKeyCanonical(nonCanonicalPubkey2));...
public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); }
ECKey { public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); } }
ECKey { public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); }
ECKey { public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static ECPoint decompressPoint(ECPoint compressed); static ECKey fromPrivate(Big...
ECKey { public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static ECPoint decompressPoint(ECPoint compressed); static ECKey fromPrivate(Big...
@Test public void getIsEmptyIfNotPresent() { final BlockNodeInformation nodeInformation = new BlockNodeInformation(); Assert.assertTrue(nodeInformation.getNodesByBlock(createBlockHash(0)).size() == 0); Assert.assertTrue(nodeInformation.getNodesByBlock(createBlockHash(0)).size() == 0); }
@Nonnull public synchronized Set<NodeID> getNodesByBlock(@Nonnull final Keccak256 blockHash) { Set<NodeID> result = nodesByBlock.get(blockHash); if (result == null) { result = new HashSet<>(); } return new HashSet<>(result); }
BlockNodeInformation { @Nonnull public synchronized Set<NodeID> getNodesByBlock(@Nonnull final Keccak256 blockHash) { Set<NodeID> result = nodesByBlock.get(blockHash); if (result == null) { result = new HashSet<>(); } return new HashSet<>(result); } }
BlockNodeInformation { @Nonnull public synchronized Set<NodeID> getNodesByBlock(@Nonnull final Keccak256 blockHash) { Set<NodeID> result = nodesByBlock.get(blockHash); if (result == null) { result = new HashSet<>(); } return new HashSet<>(result); } BlockNodeInformation(final int maxBlocks); BlockNodeInformation(); }
BlockNodeInformation { @Nonnull public synchronized Set<NodeID> getNodesByBlock(@Nonnull final Keccak256 blockHash) { Set<NodeID> result = nodesByBlock.get(blockHash); if (result == null) { result = new HashSet<>(); } return new HashSet<>(result); } BlockNodeInformation(final int maxBlocks); BlockNodeInformation(); sy...
BlockNodeInformation { @Nonnull public synchronized Set<NodeID> getNodesByBlock(@Nonnull final Keccak256 blockHash) { Set<NodeID> result = nodesByBlock.get(blockHash); if (result == null) { result = new HashSet<>(); } return new HashSet<>(result); } BlockNodeInformation(final int maxBlocks); BlockNodeInformation(); sy...
@Test public void sendSkeletonRequest() { Blockchain blockchain = new BlockChainBuilder().ofSize(100); SimplePeer sender = new SimplePeer(new byte[] { 0x01 }); final ChannelManager channelManager = mock(ChannelManager.class); Peer channel = mock(Peer.class); when(channel.getPeerNodeID()).thenReturn(sender.getPeerNodeID...
@Override public void sendSkeletonRequest(Peer peer, long height) { logger.debug("Send skeleton request to node {} height {}", peer.getPeerNodeID(), height); MessageWithId message = new SkeletonRequestMessage(++lastRequestId, height); sendMessage(peer, message); }
SyncProcessor implements SyncEventsHandler { @Override public void sendSkeletonRequest(Peer peer, long height) { logger.debug("Send skeleton request to node {} height {}", peer.getPeerNodeID(), height); MessageWithId message = new SkeletonRequestMessage(++lastRequestId, height); sendMessage(peer, message); } }
SyncProcessor implements SyncEventsHandler { @Override public void sendSkeletonRequest(Peer peer, long height) { logger.debug("Send skeleton request to node {} height {}", peer.getPeerNodeID(), height); MessageWithId message = new SkeletonRequestMessage(++lastRequestId, height); sendMessage(peer, message); } SyncProces...
SyncProcessor implements SyncEventsHandler { @Override public void sendSkeletonRequest(Peer peer, long height) { logger.debug("Send skeleton request to node {} height {}", peer.getPeerNodeID(), height); MessageWithId message = new SkeletonRequestMessage(++lastRequestId, height); sendMessage(peer, message); } SyncProces...
SyncProcessor implements SyncEventsHandler { @Override public void sendSkeletonRequest(Peer peer, long height) { logger.debug("Send skeleton request to node {} height {}", peer.getPeerNodeID(), height); MessageWithId message = new SkeletonRequestMessage(++lastRequestId, height); sendMessage(peer, message); } SyncProces...
@Test public void sendBlockHashRequest() { Blockchain blockchain = new BlockChainBuilder().ofSize(0); SimplePeer sender = new SimplePeer(new byte[] { 0x01 }); final ChannelManager channelManager = mock(ChannelManager.class); Peer channel = mock(Peer.class); when(channel.getPeerNodeID()).thenReturn(sender.getPeerNodeID(...
@Override public void sendBlockHashRequest(Peer peer, long height) { logger.debug("Send hash request to node {} height {}", peer.getPeerNodeID(), height); BlockHashRequestMessage message = new BlockHashRequestMessage(++lastRequestId, height); sendMessage(peer, message); }
SyncProcessor implements SyncEventsHandler { @Override public void sendBlockHashRequest(Peer peer, long height) { logger.debug("Send hash request to node {} height {}", peer.getPeerNodeID(), height); BlockHashRequestMessage message = new BlockHashRequestMessage(++lastRequestId, height); sendMessage(peer, message); } }
SyncProcessor implements SyncEventsHandler { @Override public void sendBlockHashRequest(Peer peer, long height) { logger.debug("Send hash request to node {} height {}", peer.getPeerNodeID(), height); BlockHashRequestMessage message = new BlockHashRequestMessage(++lastRequestId, height); sendMessage(peer, message); } Sy...
SyncProcessor implements SyncEventsHandler { @Override public void sendBlockHashRequest(Peer peer, long height) { logger.debug("Send hash request to node {} height {}", peer.getPeerNodeID(), height); BlockHashRequestMessage message = new BlockHashRequestMessage(++lastRequestId, height); sendMessage(peer, message); } Sy...
SyncProcessor implements SyncEventsHandler { @Override public void sendBlockHashRequest(Peer peer, long height) { logger.debug("Send hash request to node {} height {}", peer.getPeerNodeID(), height); BlockHashRequestMessage message = new BlockHashRequestMessage(++lastRequestId, height); sendMessage(peer, message); } Sy...
@Test(expected = Exception.class) public void processBlockHashResponseWithUnknownHash() { Blockchain blockchain = new BlockChainBuilder().ofSize(0); SimplePeer sender = new SimplePeer(new byte[] { 0x01 }); SyncProcessor processor = new SyncProcessor( blockchain, mock(org.ethereum.db.BlockStore.class), mock(ConsensusVal...
public void processStatus(Peer sender, Status status) { logger.debug("Receiving syncState from node {} block {} {}", sender.getPeerNodeID(), status.getBestBlockNumber(), HashUtil.toPrintableHash(status.getBestBlockHash())); peersInformation.registerPeer(sender).setStatus(status); syncState.newPeerStatus(); }
SyncProcessor implements SyncEventsHandler { public void processStatus(Peer sender, Status status) { logger.debug("Receiving syncState from node {} block {} {}", sender.getPeerNodeID(), status.getBestBlockNumber(), HashUtil.toPrintableHash(status.getBestBlockHash())); peersInformation.registerPeer(sender).setStatus(sta...
SyncProcessor implements SyncEventsHandler { public void processStatus(Peer sender, Status status) { logger.debug("Receiving syncState from node {} block {} {}", sender.getPeerNodeID(), status.getBestBlockNumber(), HashUtil.toPrintableHash(status.getBestBlockHash())); peersInformation.registerPeer(sender).setStatus(sta...
SyncProcessor implements SyncEventsHandler { public void processStatus(Peer sender, Status status) { logger.debug("Receiving syncState from node {} block {} {}", sender.getPeerNodeID(), status.getBestBlockNumber(), HashUtil.toPrintableHash(status.getBestBlockHash())); peersInformation.registerPeer(sender).setStatus(sta...
SyncProcessor implements SyncEventsHandler { public void processStatus(Peer sender, Status status) { logger.debug("Receiving syncState from node {} block {} {}", sender.getPeerNodeID(), status.getBestBlockNumber(), HashUtil.toPrintableHash(status.getBestBlockHash())); peersInformation.registerPeer(sender).setStatus(sta...
@Test public void emptyVotesConstructor() { ABICallElection electionBis = new ABICallElection(authorizer); Assert.assertEquals(0, electionBis.getVotes().size()); }
public Map<ABICallSpec, List<RskAddress>> getVotes() { return votes; }
ABICallElection { public Map<ABICallSpec, List<RskAddress>> getVotes() { return votes; } }
ABICallElection { public Map<ABICallSpec, List<RskAddress>> getVotes() { return votes; } ABICallElection(AddressBasedAuthorizer authorizer, Map<ABICallSpec, List<RskAddress>> votes); ABICallElection(AddressBasedAuthorizer authorizer); }
ABICallElection { public Map<ABICallSpec, List<RskAddress>> getVotes() { return votes; } ABICallElection(AddressBasedAuthorizer authorizer, Map<ABICallSpec, List<RskAddress>> votes); ABICallElection(AddressBasedAuthorizer authorizer); Map<ABICallSpec, List<RskAddress>> getVotes(); void clear(); boolean vote(ABICallSpe...
ABICallElection { public Map<ABICallSpec, List<RskAddress>> getVotes() { return votes; } ABICallElection(AddressBasedAuthorizer authorizer, Map<ABICallSpec, List<RskAddress>> votes); ABICallElection(AddressBasedAuthorizer authorizer); Map<ABICallSpec, List<RskAddress>> getVotes(); void clear(); boolean vote(ABICallSpe...
@Test public void getVotes() { Assert.assertSame(votes, election.getVotes()); }
public Map<ABICallSpec, List<RskAddress>> getVotes() { return votes; }
ABICallElection { public Map<ABICallSpec, List<RskAddress>> getVotes() { return votes; } }
ABICallElection { public Map<ABICallSpec, List<RskAddress>> getVotes() { return votes; } ABICallElection(AddressBasedAuthorizer authorizer, Map<ABICallSpec, List<RskAddress>> votes); ABICallElection(AddressBasedAuthorizer authorizer); }
ABICallElection { public Map<ABICallSpec, List<RskAddress>> getVotes() { return votes; } ABICallElection(AddressBasedAuthorizer authorizer, Map<ABICallSpec, List<RskAddress>> votes); ABICallElection(AddressBasedAuthorizer authorizer); Map<ABICallSpec, List<RskAddress>> getVotes(); void clear(); boolean vote(ABICallSpe...
ABICallElection { public Map<ABICallSpec, List<RskAddress>> getVotes() { return votes; } ABICallElection(AddressBasedAuthorizer authorizer, Map<ABICallSpec, List<RskAddress>> votes); ABICallElection(AddressBasedAuthorizer authorizer); Map<ABICallSpec, List<RskAddress>> getVotes(); void clear(); boolean vote(ABICallSpe...
@Test public void clear() { election.clear(); Assert.assertEquals(0, election.getVotes().size()); }
public void clear() { this.votes = new HashMap<>(); }
ABICallElection { public void clear() { this.votes = new HashMap<>(); } }
ABICallElection { public void clear() { this.votes = new HashMap<>(); } ABICallElection(AddressBasedAuthorizer authorizer, Map<ABICallSpec, List<RskAddress>> votes); ABICallElection(AddressBasedAuthorizer authorizer); }
ABICallElection { public void clear() { this.votes = new HashMap<>(); } ABICallElection(AddressBasedAuthorizer authorizer, Map<ABICallSpec, List<RskAddress>> votes); ABICallElection(AddressBasedAuthorizer authorizer); Map<ABICallSpec, List<RskAddress>> getVotes(); void clear(); boolean vote(ABICallSpec callSpec, RskAd...
ABICallElection { public void clear() { this.votes = new HashMap<>(); } ABICallElection(AddressBasedAuthorizer authorizer, Map<ABICallSpec, List<RskAddress>> votes); ABICallElection(AddressBasedAuthorizer authorizer); Map<ABICallSpec, List<RskAddress>> getVotes(); void clear(); boolean vote(ABICallSpec callSpec, RskAd...
@Test public void getFunction() { ABICallSpec spec = new ABICallSpec("a-function", new byte[][]{}); Assert.assertEquals("a-function", spec.getFunction()); }
public String getFunction() { return function; }
ABICallSpec { public String getFunction() { return function; } }
ABICallSpec { public String getFunction() { return function; } ABICallSpec(String function, byte[][] arguments); }
ABICallSpec { public String getFunction() { return function; } ABICallSpec(String function, byte[][] arguments); String getFunction(); byte[][] getArguments(); byte[] getEncoded(); @Override String toString(); @Override boolean equals(Object other); @Override int hashCode(); }
ABICallSpec { public String getFunction() { return function; } ABICallSpec(String function, byte[][] arguments); String getFunction(); byte[][] getArguments(); byte[] getEncoded(); @Override String toString(); @Override boolean equals(Object other); @Override int hashCode(); static final Comparator<ABICallSpec> byBytes...
@Test public void getEncoded() { ABICallSpec spec = new ABICallSpec("a-function", new byte[][]{ Hex.decode("1122"), Hex.decode("334455"), }); StringBuilder expectedBuilder = new StringBuilder(); expectedBuilder.append(ByteUtil.toHexString("a-function".getBytes(StandardCharsets.UTF_8))); expectedBuilder.append("11223344...
public byte[] getEncoded() { byte[] functionBytes = function.getBytes(StandardCharsets.UTF_8); int totalLength = functionBytes.length; for (int i = 0; i < arguments.length; i++) { totalLength += arguments[i].length; } byte[] result = new byte[totalLength]; System.arraycopy(functionBytes, 0, result, 0, functionBytes.len...
ABICallSpec { public byte[] getEncoded() { byte[] functionBytes = function.getBytes(StandardCharsets.UTF_8); int totalLength = functionBytes.length; for (int i = 0; i < arguments.length; i++) { totalLength += arguments[i].length; } byte[] result = new byte[totalLength]; System.arraycopy(functionBytes, 0, result, 0, fun...
ABICallSpec { public byte[] getEncoded() { byte[] functionBytes = function.getBytes(StandardCharsets.UTF_8); int totalLength = functionBytes.length; for (int i = 0; i < arguments.length; i++) { totalLength += arguments[i].length; } byte[] result = new byte[totalLength]; System.arraycopy(functionBytes, 0, result, 0, fun...
ABICallSpec { public byte[] getEncoded() { byte[] functionBytes = function.getBytes(StandardCharsets.UTF_8); int totalLength = functionBytes.length; for (int i = 0; i < arguments.length; i++) { totalLength += arguments[i].length; } byte[] result = new byte[totalLength]; System.arraycopy(functionBytes, 0, result, 0, fun...
ABICallSpec { public byte[] getEncoded() { byte[] functionBytes = function.getBytes(StandardCharsets.UTF_8); int totalLength = functionBytes.length; for (int i = 0; i < arguments.length; i++) { totalLength += arguments[i].length; } byte[] result = new byte[totalLength]; System.arraycopy(functionBytes, 0, result, 0, fun...
@Test public void testEquals() { ABICallSpec specA = new ABICallSpec("function-a", new byte[][]{ Hex.decode("aabb"), Hex.decode("ccddee") }); ABICallSpec specB = new ABICallSpec("function-b", new byte[][]{ Hex.decode("aabb"), Hex.decode("ccddee") }); ABICallSpec specC = new ABICallSpec("function-a", new byte[][]{ Hex.d...
@Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } ABICallSpec otherSpec = ((ABICallSpec) other); return otherSpec.getFunction().equals(getFunction()) && areEqual(arguments, otherSpec.arguments); }
ABICallSpec { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } ABICallSpec otherSpec = ((ABICallSpec) other); return otherSpec.getFunction().equals(getFunction()) && areEqual(arguments, otherSpec.arguments); }...
ABICallSpec { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } ABICallSpec otherSpec = ((ABICallSpec) other); return otherSpec.getFunction().equals(getFunction()) && areEqual(arguments, otherSpec.arguments); }...
ABICallSpec { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } ABICallSpec otherSpec = ((ABICallSpec) other); return otherSpec.getFunction().equals(getFunction()) && areEqual(arguments, otherSpec.arguments); }...
ABICallSpec { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } ABICallSpec otherSpec = ((ABICallSpec) other); return otherSpec.getFunction().equals(getFunction()) && areEqual(arguments, otherSpec.arguments); }...
@Test public void testIsPubKeyCanonicalWrongPrefix() { byte[] nonCanonicalPubkey4 = new byte[65]; assertFalse(ECKey.isPubKeyCanonical(nonCanonicalPubkey4)); byte[] nonCanonicalPubkey5 = new byte[33]; assertFalse(ECKey.isPubKeyCanonical(nonCanonicalPubkey5)); byte[] nonCanonicalPubkey6 = new byte[33]; assertFalse(ECKey....
public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); }
ECKey { public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); } }
ECKey { public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); }
ECKey { public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static ECPoint decompressPoint(ECPoint compressed); static ECKey fromPrivate(Big...
ECKey { public boolean isPubKeyCanonical() { return isPubKeyCanonical(pub.getEncoded(false)); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static ECPoint decompressPoint(ECPoint compressed); static ECKey fromPrivate(Big...
@Test public void getDataWhenValueIsEmpty() throws Exception { Web3.CallArguments args = new Web3.CallArguments(); args.data = ""; CallArgumentsToByteArray byteArrayArgs = new CallArgumentsToByteArray(args); Assert.assertNull(byteArrayArgs.getData()); }
public byte[] getData() { byte[] data = null; if (args.data != null && args.data.length() != 0) { data = stringHexToByteArray(args.data); } return data; }
CallArgumentsToByteArray { public byte[] getData() { byte[] data = null; if (args.data != null && args.data.length() != 0) { data = stringHexToByteArray(args.data); } return data; } }
CallArgumentsToByteArray { public byte[] getData() { byte[] data = null; if (args.data != null && args.data.length() != 0) { data = stringHexToByteArray(args.data); } return data; } CallArgumentsToByteArray(Web3.CallArguments args); }
CallArgumentsToByteArray { public byte[] getData() { byte[] data = null; if (args.data != null && args.data.length() != 0) { data = stringHexToByteArray(args.data); } return data; } CallArgumentsToByteArray(Web3.CallArguments args); byte[] getGasPrice(); byte[] getGasLimit(); byte[] getToAddress(); byte[] getValue(); b...
CallArgumentsToByteArray { public byte[] getData() { byte[] data = null; if (args.data != null && args.data.length() != 0) { data = stringHexToByteArray(args.data); } return data; } CallArgumentsToByteArray(Web3.CallArguments args); byte[] getGasPrice(); byte[] getGasLimit(); byte[] getToAddress(); byte[] getValue(); b...
@Test public void membersImmutable() { boolean exception = false; try { pendingFederation.getMembers().add(new FederationMember(new BtcECKey(), new ECKey(), new ECKey())); } catch (Exception e) { exception = true; } Assert.assertTrue(exception); exception = false; try { pendingFederation.getMembers().remove(0); } catch...
public List<FederationMember> getMembers() { return members; }
PendingFederation { public List<FederationMember> getMembers() { return members; } }
PendingFederation { public List<FederationMember> getMembers() { return members; } PendingFederation(List<FederationMember> members); }
PendingFederation { public List<FederationMember> getMembers() { return members; } PendingFederation(List<FederationMember> members); List<FederationMember> getMembers(); List<BtcECKey> getBtcPublicKeys(); boolean isComplete(); PendingFederation addMember(FederationMember member); Federation buildFederation(Instant cre...
PendingFederation { public List<FederationMember> getMembers() { return members; } PendingFederation(List<FederationMember> members); List<FederationMember> getMembers(); List<BtcECKey> getBtcPublicKeys(); boolean isComplete(); PendingFederation addMember(FederationMember member); Federation buildFederation(Instant cre...
@Test public void isComplete() { Assert.assertTrue(pendingFederation.isComplete()); }
public boolean isComplete() { return this.members.size() >= MIN_MEMBERS_REQUIRED; }
PendingFederation { public boolean isComplete() { return this.members.size() >= MIN_MEMBERS_REQUIRED; } }
PendingFederation { public boolean isComplete() { return this.members.size() >= MIN_MEMBERS_REQUIRED; } PendingFederation(List<FederationMember> members); }
PendingFederation { public boolean isComplete() { return this.members.size() >= MIN_MEMBERS_REQUIRED; } PendingFederation(List<FederationMember> members); List<FederationMember> getMembers(); List<BtcECKey> getBtcPublicKeys(); boolean isComplete(); PendingFederation addMember(FederationMember member); Federation buildF...
PendingFederation { public boolean isComplete() { return this.members.size() >= MIN_MEMBERS_REQUIRED; } PendingFederation(List<FederationMember> members); List<FederationMember> getMembers(); List<BtcECKey> getBtcPublicKeys(); boolean isComplete(); PendingFederation addMember(FederationMember member); Federation buildF...
@Test public void isComplete_not() { PendingFederation otherPendingFederation = new PendingFederation(FederationTestUtils.getFederationMembersFromPks(200)); Assert.assertFalse(otherPendingFederation.isComplete()); }
public boolean isComplete() { return this.members.size() >= MIN_MEMBERS_REQUIRED; }
PendingFederation { public boolean isComplete() { return this.members.size() >= MIN_MEMBERS_REQUIRED; } }
PendingFederation { public boolean isComplete() { return this.members.size() >= MIN_MEMBERS_REQUIRED; } PendingFederation(List<FederationMember> members); }
PendingFederation { public boolean isComplete() { return this.members.size() >= MIN_MEMBERS_REQUIRED; } PendingFederation(List<FederationMember> members); List<FederationMember> getMembers(); List<BtcECKey> getBtcPublicKeys(); boolean isComplete(); PendingFederation addMember(FederationMember member); Federation buildF...
PendingFederation { public boolean isComplete() { return this.members.size() >= MIN_MEMBERS_REQUIRED; } PendingFederation(List<FederationMember> members); List<FederationMember> getMembers(); List<BtcECKey> getBtcPublicKeys(); boolean isComplete(); PendingFederation addMember(FederationMember member); Federation buildF...
@Test public void testEquals_basic() { Assert.assertTrue(pendingFederation.equals(pendingFederation)); Assert.assertFalse(pendingFederation.equals(null)); Assert.assertFalse(pendingFederation.equals(new Object())); Assert.assertFalse(pendingFederation.equals("something else")); }
@Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); }
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } }
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } PendingFederation(List<FederationMember> members); }
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } PendingFederation(List<FederationMember> members); List<FederationMember>...
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } PendingFederation(List<FederationMember> members); List<FederationMember>...
@Test public void testEquals_differentNumberOfMembers() { PendingFederation otherPendingFederation = new PendingFederation(FederationTestUtils.getFederationMembersFromPks(100, 200, 300, 400, 500, 600, 700)); Assert.assertFalse(pendingFederation.equals(otherPendingFederation)); }
@Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); }
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } }
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } PendingFederation(List<FederationMember> members); }
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } PendingFederation(List<FederationMember> members); List<FederationMember>...
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } PendingFederation(List<FederationMember> members); List<FederationMember>...
@Test public void testEquals_differentMembers() { List<FederationMember> members = FederationTestUtils.getFederationMembersFromPks(100, 200, 300, 400, 500); members.add(new FederationMember(BtcECKey.fromPrivate(BigInteger.valueOf(610)), ECKey.fromPrivate(BigInteger.valueOf(600)), ECKey.fromPrivate(BigInteger.valueOf(62...
@Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); }
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } }
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } PendingFederation(List<FederationMember> members); }
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } PendingFederation(List<FederationMember> members); List<FederationMember>...
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } PendingFederation(List<FederationMember> members); List<FederationMember>...
@Test public void testEquals_same() { PendingFederation otherPendingFederation = new PendingFederation(FederationTestUtils.getFederationMembersFromPks(100, 200, 300, 400, 500, 600)); Assert.assertTrue(pendingFederation.equals(otherPendingFederation)); }
@Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); }
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } }
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } PendingFederation(List<FederationMember> members); }
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } PendingFederation(List<FederationMember> members); List<FederationMember>...
PendingFederation { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } return this.members.equals(((PendingFederation) other).members); } PendingFederation(List<FederationMember> members); List<FederationMember>...