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 parseIPv6() { InetSocketAddress result = IpUtils.parseAddress(IPV6_WITH_PORT); Assert.assertNotNull(result); }
public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { return pars...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
@Test public void parseIPv6NoPort() { InetSocketAddress result = IpUtils.parseAddress(IPV6_NO_PORT); Assert.assertNull(result); }
public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { return pars...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
@Test public void parseIPv6InvalidFormat() { InetSocketAddress result = IpUtils.parseAddress(IPV6_INVALID); Assert.assertNull(result); }
public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { return pars...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
@Test public void oneTransactionAndEvents() { PendingTransactionFilter filter = new PendingTransactionFilter(); Account sender = new AccountBuilder().name("sender").build(); Account receiver = new AccountBuilder().name("receiver").build(); Transaction tx = new TransactionBuilder() .sender(sender) .receiver(receiver) .v...
@Override public void newPendingTx(Transaction tx) { add(new PendingTransactionFilterEvent(tx)); }
PendingTransactionFilter extends Filter { @Override public void newPendingTx(Transaction tx) { add(new PendingTransactionFilterEvent(tx)); } }
PendingTransactionFilter extends Filter { @Override public void newPendingTx(Transaction tx) { add(new PendingTransactionFilterEvent(tx)); } }
PendingTransactionFilter extends Filter { @Override public void newPendingTx(Transaction tx) { add(new PendingTransactionFilterEvent(tx)); } @Override void newPendingTx(Transaction tx); }
PendingTransactionFilter extends Filter { @Override public void newPendingTx(Transaction tx) { add(new PendingTransactionFilterEvent(tx)); } @Override void newPendingTx(Transaction tx); }
@Test public void parseIPv4() { InetSocketAddress result = IpUtils.parseAddress(IPV4_WITH_PORT); Assert.assertNotNull(result); }
public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { return pars...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
@Test public void parseIPv4NoPort() { InetSocketAddress result = IpUtils.parseAddress(IPV4_NO_PORT); Assert.assertNull(result); }
public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { return pars...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
@Test public void parseHostnameWithPort() { InetSocketAddress result = IpUtils.parseAddress(HOSTNAME_WITH_PORT); Assert.assertNotNull(result); }
public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { return pars...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
IpUtils { public static InetSocketAddress parseAddress(String address) { if(StringUtils.isBlank(address)) { return null; } Matcher matcher = ipv6Pattern.matcher(address); if(matcher.matches()) { return parseMatch(matcher); } matcher = ipv4Pattern.matcher(address); if (matcher.matches() && matcher.groupCount() == 2) { r...
@Test public void parseAddresses() { List<String> addresses = new ArrayList<>(); addresses.add(IPV6_WITH_PORT); addresses.add(IPV6_NO_PORT); addresses.add(IPV6_INVALID); addresses.add(IPV4_WITH_PORT); addresses.add(IPV4_NO_PORT); List<InetSocketAddress> result = IpUtils.parseAddresses(addresses); Assert.assertFalse(res...
public static List<InetSocketAddress> parseAddresses(List<String> addresses) { List<InetSocketAddress> result = new ArrayList<>(); for(String a : addresses) { InetSocketAddress res = parseAddress(a); if (res != null) { result.add(res); } } return result; }
IpUtils { public static List<InetSocketAddress> parseAddresses(List<String> addresses) { List<InetSocketAddress> result = new ArrayList<>(); for(String a : addresses) { InetSocketAddress res = parseAddress(a); if (res != null) { result.add(res); } } return result; } }
IpUtils { public static List<InetSocketAddress> parseAddresses(List<String> addresses) { List<InetSocketAddress> result = new ArrayList<>(); for(String a : addresses) { InetSocketAddress res = parseAddress(a); if (res != null) { result.add(res); } } return result; } }
IpUtils { public static List<InetSocketAddress> parseAddresses(List<String> addresses) { List<InetSocketAddress> result = new ArrayList<>(); for(String a : addresses) { InetSocketAddress res = parseAddress(a); if (res != null) { result.add(res); } } return result; } static InetSocketAddress parseAddress(String address...
IpUtils { public static List<InetSocketAddress> parseAddresses(List<String> addresses) { List<InetSocketAddress> result = new ArrayList<>(); for(String a : addresses) { InetSocketAddress res = parseAddress(a); if (res != null) { result.add(res); } } return result; } static InetSocketAddress parseAddress(String address...
@Test public void formatNanosecondsToSeconds() { Assert.assertEquals("1.234568", FormatUtils.formatNanosecondsToSeconds(1_234_567_890L)); Assert.assertEquals("1234.567890", FormatUtils.formatNanosecondsToSeconds(1_234_567_890_123L)); Assert.assertEquals("1234567.890123", FormatUtils.formatNanosecondsToSeconds(1_234_567...
public static String formatNanosecondsToSeconds(long nanoseconds) { return String.format("%.6f", nanoseconds / 1_000_000_000.0); }
FormatUtils { public static String formatNanosecondsToSeconds(long nanoseconds) { return String.format("%.6f", nanoseconds / 1_000_000_000.0); } }
FormatUtils { public static String formatNanosecondsToSeconds(long nanoseconds) { return String.format("%.6f", nanoseconds / 1_000_000_000.0); } private FormatUtils(); }
FormatUtils { public static String formatNanosecondsToSeconds(long nanoseconds) { return String.format("%.6f", nanoseconds / 1_000_000_000.0); } private FormatUtils(); static String formatNanosecondsToSeconds(long nanoseconds); }
FormatUtils { public static String formatNanosecondsToSeconds(long nanoseconds) { return String.format("%.6f", nanoseconds / 1_000_000_000.0); } private FormatUtils(); static String formatNanosecondsToSeconds(long nanoseconds); }
@Test public void callingRunStartsInternalServices() { runner.run(); for (InternalService internalService : internalServices) { verify(internalService).start(); } }
@Override public void run() { logger.info("Starting RSK"); logger.info( "Running {}, core version: {}-{}", rskSystemProperties.genesisInfo(), rskSystemProperties.projectVersion(), rskSystemProperties.projectVersionModifier() ); buildInfo.printInfo(logger); for (InternalService internalService : internalServices) { inte...
FullNodeRunner implements NodeRunner { @Override public void run() { logger.info("Starting RSK"); logger.info( "Running {}, core version: {}-{}", rskSystemProperties.genesisInfo(), rskSystemProperties.projectVersion(), rskSystemProperties.projectVersionModifier() ); buildInfo.printInfo(logger); for (InternalService int...
FullNodeRunner implements NodeRunner { @Override public void run() { logger.info("Starting RSK"); logger.info( "Running {}, core version: {}-{}", rskSystemProperties.genesisInfo(), rskSystemProperties.projectVersion(), rskSystemProperties.projectVersionModifier() ); buildInfo.printInfo(logger); for (InternalService int...
FullNodeRunner implements NodeRunner { @Override public void run() { logger.info("Starting RSK"); logger.info( "Running {}, core version: {}-{}", rskSystemProperties.genesisInfo(), rskSystemProperties.projectVersion(), rskSystemProperties.projectVersionModifier() ); buildInfo.printInfo(logger); for (InternalService int...
FullNodeRunner implements NodeRunner { @Override public void run() { logger.info("Starting RSK"); logger.info( "Running {}, core version: {}-{}", rskSystemProperties.genesisInfo(), rskSystemProperties.projectVersion(), rskSystemProperties.projectVersionModifier() ); buildInfo.printInfo(logger); for (InternalService int...
@Test public void callingStopStopsInternalServices() { runner.stop(); for (InternalService internalService : internalServices) { verify(internalService).stop(); } }
@Override public void stop() { logger.info("Shutting down RSK node"); for (int i = internalServices.size() - 1; i >= 0; i--) { internalServices.get(i).stop(); } logger.info("RSK node Shut down"); }
FullNodeRunner implements NodeRunner { @Override public void stop() { logger.info("Shutting down RSK node"); for (int i = internalServices.size() - 1; i >= 0; i--) { internalServices.get(i).stop(); } logger.info("RSK node Shut down"); } }
FullNodeRunner implements NodeRunner { @Override public void stop() { logger.info("Shutting down RSK node"); for (int i = internalServices.size() - 1; i >= 0; i--) { internalServices.get(i).stop(); } logger.info("RSK node Shut down"); } FullNodeRunner( List<InternalService> internalServices, Rsk...
FullNodeRunner implements NodeRunner { @Override public void stop() { logger.info("Shutting down RSK node"); for (int i = internalServices.size() - 1; i >= 0; i--) { internalServices.get(i).stop(); } logger.info("RSK node Shut down"); } FullNodeRunner( List<InternalService> internalServices, Rsk...
FullNodeRunner implements NodeRunner { @Override public void stop() { logger.info("Shutting down RSK node"); for (int i = internalServices.size() - 1; i >= 0; i--) { internalServices.get(i).stop(); } logger.info("RSK node Shut down"); } FullNodeRunner( List<InternalService> internalServices, Rsk...
@Test public void rejectBlockWithSiblingUncle() { BlockGenerator blockGenerator = new BlockGenerator(); Block genesis = blockGenerator.getGenesisBlock(); Block block1 = blockGenerator.createChildBlock(genesis); Block uncle = blockGenerator.createChildBlock(block1); List<BlockHeader> uncles = new ArrayList<>(); uncles.a...
@Override public boolean isValid(Block block) { if (!blockValidationRule.isValid(block)) { return false; } List<BlockHeader> uncles = block.getUncleList(); if (!uncles.isEmpty() && !validateUncleList(block.getNumber(), uncles, FamilyUtils.getAncestors(blockStore, block, uncleGenerationLimit), FamilyUtils.getUsedUncles(...
BlockUnclesValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { if (!blockValidationRule.isValid(block)) { return false; } List<BlockHeader> uncles = block.getUncleList(); if (!uncles.isEmpty() && !validateUncleList(block.getNumber(), uncles, FamilyUtils.getAncestors(blockStor...
BlockUnclesValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { if (!blockValidationRule.isValid(block)) { return false; } List<BlockHeader> uncles = block.getUncleList(); if (!uncles.isEmpty() && !validateUncleList(block.getNumber(), uncles, FamilyUtils.getAncestors(blockStor...
BlockUnclesValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { if (!blockValidationRule.isValid(block)) { return false; } List<BlockHeader> uncles = block.getUncleList(); if (!uncles.isEmpty() && !validateUncleList(block.getNumber(), uncles, FamilyUtils.getAncestors(blockStor...
BlockUnclesValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { if (!blockValidationRule.isValid(block)) { return false; } List<BlockHeader> uncles = block.getUncleList(); if (!uncles.isEmpty() && !validateUncleList(block.getNumber(), uncles, FamilyUtils.getAncestors(blockStor...
@Test public void rejectBlockWithUncleHavingHigherNumber() { BlockGenerator blockGenerator = new BlockGenerator(); Block genesis = blockGenerator.getGenesisBlock(); Block block1 = blockGenerator.createChildBlock(genesis); Block uncle1 = blockGenerator.createChildBlock(block1); Block uncle2 = blockGenerator.createChildB...
@Override public boolean isValid(Block block) { if (!blockValidationRule.isValid(block)) { return false; } List<BlockHeader> uncles = block.getUncleList(); if (!uncles.isEmpty() && !validateUncleList(block.getNumber(), uncles, FamilyUtils.getAncestors(blockStore, block, uncleGenerationLimit), FamilyUtils.getUsedUncles(...
BlockUnclesValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { if (!blockValidationRule.isValid(block)) { return false; } List<BlockHeader> uncles = block.getUncleList(); if (!uncles.isEmpty() && !validateUncleList(block.getNumber(), uncles, FamilyUtils.getAncestors(blockStor...
BlockUnclesValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { if (!blockValidationRule.isValid(block)) { return false; } List<BlockHeader> uncles = block.getUncleList(); if (!uncles.isEmpty() && !validateUncleList(block.getNumber(), uncles, FamilyUtils.getAncestors(blockStor...
BlockUnclesValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { if (!blockValidationRule.isValid(block)) { return false; } List<BlockHeader> uncles = block.getUncleList(); if (!uncles.isEmpty() && !validateUncleList(block.getNumber(), uncles, FamilyUtils.getAncestors(blockStor...
BlockUnclesValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { if (!blockValidationRule.isValid(block)) { return false; } List<BlockHeader> uncles = block.getUncleList(); if (!uncles.isEmpty() && !validateUncleList(block.getNumber(), uncles, FamilyUtils.getAncestors(blockStor...
@Test public void validWhenCalculatedDifficultyMatches() { whenCalculatedDifficulty(452); whenBlockDifficulty(452); Assert.assertTrue(rule.isValid(block, parent)); }
@Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockDifficultyRule - block or parent are null"); return false; } BlockDifficulty calcDifficulty = difficultyCalculator.calcDifficulty(header, parent.getHeader()); BlockDifficulty difficulty = heade...
BlockDifficultyRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockDifficultyRule - block or parent are null"); return false; } BlockDifficulty calcDi...
BlockDifficultyRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockDifficultyRule - block or parent are null"); return false; } BlockDifficulty calcDi...
BlockDifficultyRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockDifficultyRule - block or parent are null"); return false; } BlockDifficulty calcDi...
BlockDifficultyRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockDifficultyRule - block or parent are null"); return false; } BlockDifficulty calcDi...
@Test public void twoTransactionsAndEvents() { PendingTransactionFilter filter = new PendingTransactionFilter(); Account sender = new AccountBuilder().name("sender").build(); Account receiver = new AccountBuilder().name("receiver").build(); Transaction tx1 = new TransactionBuilder() .sender(sender) .receiver(receiver) ...
@Override public void newPendingTx(Transaction tx) { add(new PendingTransactionFilterEvent(tx)); }
PendingTransactionFilter extends Filter { @Override public void newPendingTx(Transaction tx) { add(new PendingTransactionFilterEvent(tx)); } }
PendingTransactionFilter extends Filter { @Override public void newPendingTx(Transaction tx) { add(new PendingTransactionFilterEvent(tx)); } }
PendingTransactionFilter extends Filter { @Override public void newPendingTx(Transaction tx) { add(new PendingTransactionFilterEvent(tx)); } @Override void newPendingTx(Transaction tx); }
PendingTransactionFilter extends Filter { @Override public void newPendingTx(Transaction tx) { add(new PendingTransactionFilterEvent(tx)); } @Override void newPendingTx(Transaction tx); }
@Test public void invalidWhenCalculatedDifficultyDoesntMatch() { whenCalculatedDifficulty(452); whenBlockDifficulty(999); Assert.assertFalse(rule.isValid(block, parent)); }
@Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockDifficultyRule - block or parent are null"); return false; } BlockDifficulty calcDifficulty = difficultyCalculator.calcDifficulty(header, parent.getHeader()); BlockDifficulty difficulty = heade...
BlockDifficultyRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockDifficultyRule - block or parent are null"); return false; } BlockDifficulty calcDi...
BlockDifficultyRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockDifficultyRule - block or parent are null"); return false; } BlockDifficulty calcDi...
BlockDifficultyRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockDifficultyRule - block or parent are null"); return false; } BlockDifficulty calcDi...
BlockDifficultyRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockDifficultyRule - block or parent are null"); return false; } BlockDifficulty calcDi...
@Test public void validForBlocksBeforeRskip110UsingMethodThatReceivesBlockAsParameter() { long blockNumber = 4242; ForkDetectionDataRule rule = new ForkDetectionDataRule( activationConfig, mock(ConsensusValidationMainchainView.class), mock(ForkDetectionDataCalculator.class), 449 ); BlockHeader header = mock(BlockHeader...
@Override public boolean isValid(Block block) { return isValid(block.getHeader()); }
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } }
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
@Test public void validForBlocksBeforeRskip110() { long blockNumber = 4242; ForkDetectionDataRule rule = new ForkDetectionDataRule( activationConfig, mock(ConsensusValidationMainchainView.class), mock(ForkDetectionDataCalculator.class), 449 ); BlockHeader header = mock(BlockHeader.class); when(header.getNumber()).thenR...
@Override public boolean isValid(Block block) { return isValid(block.getHeader()); }
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } }
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
@Test public void invalidForRskip110ActiveButForkDetectionData() { long blockNumber = 42; enableRulesAt(blockNumber, ConsensusRule.RSKIP110); ForkDetectionDataRule rule = new ForkDetectionDataRule( activationConfig, mock(ConsensusValidationMainchainView.class), mock(ForkDetectionDataCalculator.class), 449 ); BlockHeade...
@Override public boolean isValid(Block block) { return isValid(block.getHeader()); }
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } }
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
@Test public void validForRskip110ActiveButNoForkDetectionDataBecauseNoEnoughBlocksToCalculateIt() { long blockNumber = 42; enableRulesAt(blockNumber, ConsensusRule.RSKIP110); ForkDetectionDataRule rule = new ForkDetectionDataRule( activationConfig, mock(ConsensusValidationMainchainView.class), mock(ForkDetectionDataCa...
@Override public boolean isValid(Block block) { return isValid(block.getHeader()); }
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } }
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
@Test public void invalidForRskip110ActiveAndForkDetectionDataButMissingBlocksForCalculation() { long blockNumber = 4242; enableRulesAt(blockNumber, ConsensusRule.RSKIP110); Keccak256 parentBlockHash = new Keccak256(getRandomHash()); int requiredBlocksForForkDataCalculation = 449; ConsensusValidationMainchainView mainc...
@Override public boolean isValid(Block block) { return isValid(block.getHeader()); }
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } }
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
@Test public void validForRskip110ActiveAndForkDetectionData() { long blockNumber = 4242; enableRulesAt(blockNumber, ConsensusRule.RSKIP110); Keccak256 parentBlockHash = new Keccak256(getRandomHash()); int requiredBlocksForForkDataCalculation = 449; List<BlockHeader> previousBlocks = IntStream .range(0, requiredBlocksF...
@Override public boolean isValid(Block block) { return isValid(block.getHeader()); }
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } }
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
@Test public void invalidForRskip110ActiveAndForkDetectionDataBecauseDataDoesNotMatch() { long blockNumber = 4242; enableRulesAt(blockNumber, ConsensusRule.RSKIP110); Keccak256 parentBlockHash = new Keccak256(getRandomHash()); int requiredBlocksForForkDataCalculation = 449; List<BlockHeader> previousBlocks = IntStream ...
@Override public boolean isValid(Block block) { return isValid(block.getHeader()); }
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } }
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
ForkDetectionDataRule implements BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } ForkDetectionDataRule( ActivationConfig activationConfig, ConsensusValidationMainchainView mainchainView, ForkDetecti...
@Test public void validNonceSame() { RskAddress sender = TestUtils.randomAddress(); initialNonce(sender, 42); Block block = block(transaction(sender, 42)); Assert.assertTrue(rule.isValid(block, parent)); }
@Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpty()) { return true; } RepositorySnapshot parentRepo = repositoryLocator...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
@Test public void invalidNonceLower() { RskAddress sender = TestUtils.randomAddress(); initialNonce(sender, 42); Block block = block(transaction(sender, 41)); Assert.assertFalse(rule.isValid(block, parent)); }
@Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpty()) { return true; } RepositorySnapshot parentRepo = repositoryLocator...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
@Test public void matchAddress() { Account account = new AccountBuilder().name("account").build(); RskAddress address = account.getAddress(); AddressesTopicsFilter filter = new AddressesTopicsFilter(new RskAddress[] { address }, null); Assert.assertTrue(filter.matchesContractAddress(address)); Assert.assertFalse(filter...
boolean matchesContractAddress(RskAddress toAddr) { for (RskAddress address : addresses) { if (address.equals(toAddr)) { return true; } } return addresses.length == 0; }
AddressesTopicsFilter { boolean matchesContractAddress(RskAddress toAddr) { for (RskAddress address : addresses) { if (address.equals(toAddr)) { return true; } } return addresses.length == 0; } }
AddressesTopicsFilter { boolean matchesContractAddress(RskAddress toAddr) { for (RskAddress address : addresses) { if (address.equals(toAddr)) { return true; } } return addresses.length == 0; } AddressesTopicsFilter(RskAddress[] addresses, Topic[][] topics); }
AddressesTopicsFilter { boolean matchesContractAddress(RskAddress toAddr) { for (RskAddress address : addresses) { if (address.equals(toAddr)) { return true; } } return addresses.length == 0; } AddressesTopicsFilter(RskAddress[] addresses, Topic[][] topics); boolean matchBloom(Bloom blockBloom); boolean matchesExactly(...
AddressesTopicsFilter { boolean matchesContractAddress(RskAddress toAddr) { for (RskAddress address : addresses) { if (address.equals(toAddr)) { return true; } } return addresses.length == 0; } AddressesTopicsFilter(RskAddress[] addresses, Topic[][] topics); boolean matchBloom(Bloom blockBloom); boolean matchesExactly(...
@Test public void invalidNonceHigher() { RskAddress sender = TestUtils.randomAddress(); initialNonce(sender, 42); Block block = block(transaction(sender, 43)); Assert.assertFalse(rule.isValid(block, parent)); }
@Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpty()) { return true; } RepositorySnapshot parentRepo = repositoryLocator...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
@Test public void validTransactionsWithSameNonceAndDifferentSenders() { RskAddress sender1 = TestUtils.randomAddress(); initialNonce(sender1, 64); RskAddress sender2 = TestUtils.randomAddress(); initialNonce(sender2, 64); Block block = block(transaction(sender1, 64), transaction(sender2, 64)); Assert.assertTrue(rule.is...
@Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpty()) { return true; } RepositorySnapshot parentRepo = repositoryLocator...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
@Test public void validConsecutiveTransactionsFromSameSender() { RskAddress sender = TestUtils.randomAddress(); initialNonce(sender, 42); Block block = block(transaction(sender, 42), transaction(sender, 43)); Assert.assertTrue(rule.isValid(block, parent)); }
@Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpty()) { return true; } RepositorySnapshot parentRepo = repositoryLocator...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
@Test public void invalidTransactionsFromSameSenderWithSkippedNonce() { RskAddress sender = TestUtils.randomAddress(); initialNonce(sender, 42); Block block = block(transaction(sender, 42), transaction(sender, 44)); Assert.assertFalse(rule.isValid(block, parent)); }
@Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpty()) { return true; } RepositorySnapshot parentRepo = repositoryLocator...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
@Test public void invalidTransactionsWithSameNonceAndSameSender() { RskAddress sender = TestUtils.randomAddress(); initialNonce(sender, 42); Block block = block(transaction(sender, 42), transaction(sender, 42)); Assert.assertFalse(rule.isValid(block, parent)); }
@Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpty()) { return true; } RepositorySnapshot parentRepo = repositoryLocator...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
BlockTxsValidationRule implements BlockParentDependantValidationRule { @Override public boolean isValid(Block block, Block parent) { if(block == null || parent == null) { logger.warn("BlockTxsValidationRule - block or parent are null"); return false; } List<Transaction> txs = block.getTransactionsList(); if (txs.isEmpt...
@Test public void validWhenGasIsTheSame() { whenGasLimitBoundDivisor(10); whenGasLimit(parentHeader, 1000); whenGasLimit(blockHeader, 1000); Assert.assertTrue(rule.isValid(block, parent)); }
@Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader parentHeader = parent.getHeader(); BigInteger headerGasLimit = new BigInteger(1, header.getGasLimit()); BigInteger p...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
@Test public void validWhenGasIsOnLeftLimit() { whenGasLimitBoundDivisor(10); whenGasLimit(parentHeader, 1000); whenGasLimit(blockHeader, 900); Assert.assertTrue(rule.isValid(block, parent)); }
@Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader parentHeader = parent.getHeader(); BigInteger headerGasLimit = new BigInteger(1, header.getGasLimit()); BigInteger p...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
@Test public void validWhenGasIsOnRightLimit() { whenGasLimitBoundDivisor(20); whenGasLimit(parentHeader, 1000); whenGasLimit(blockHeader, 1050); Assert.assertTrue(rule.isValid(block, parent)); }
@Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader parentHeader = parent.getHeader(); BigInteger headerGasLimit = new BigInteger(1, header.getGasLimit()); BigInteger p...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
@Test public void invalidWhenGasIsOnLeftLimit() { whenGasLimitBoundDivisor(10); whenGasLimit(parentHeader, 1000); whenGasLimit(blockHeader, 899); Assert.assertFalse(rule.isValid(block, parent)); }
@Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader parentHeader = parent.getHeader(); BigInteger headerGasLimit = new BigInteger(1, header.getGasLimit()); BigInteger p...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
@Test public void invalidWhenGasIsOnRightLimit() { whenGasLimitBoundDivisor(20); whenGasLimit(parentHeader, 1000); whenGasLimit(blockHeader, 1051); Assert.assertFalse(rule.isValid(block, parent)); }
@Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader parentHeader = parent.getHeader(); BigInteger headerGasLimit = new BigInteger(1, header.getGasLimit()); BigInteger p...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
BlockParentGasLimitRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentGasLimitRule - block or parent are null"); return false; } BlockHeader pa...
@Test public void matchEmptyBloomWithAllFilter() { AddressesTopicsFilter filter = new AddressesTopicsFilter(new RskAddress[0], null); Assert.assertTrue(filter.matchBloom(new Bloom())); }
public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; }
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } }
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
@Test public void blockInThePast() { int validPeriod = 540; BlockTimeStampValidationRule validationRule = new BlockTimeStampValidationRule(validPeriod); BlockHeader header = Mockito.mock(BlockHeader.class); Block block = Mockito.mock(Block.class); Mockito.when(block.getHeader()).thenReturn(header); Mockito.when(header....
@Override public boolean isValid(Block block) { return isValid(block.getHeader()); }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); @Override boole...
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); @Override boole...
@Test public void blockInTheFutureLimit() { int validPeriod = 540; BlockTimeStampValidationRule validationRule = new BlockTimeStampValidationRule(validPeriod); BlockHeader header = Mockito.mock(BlockHeader.class); Block block = Mockito.mock(Block.class); Mockito.when(block.getHeader()).thenReturn(header); Mockito.when(...
@Override public boolean isValid(Block block) { return isValid(block.getHeader()); }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); @Override boole...
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); @Override boole...
@Test public void blockInTheFuture() { int validPeriod = 540; BlockTimeStampValidationRule validationRule = new BlockTimeStampValidationRule(validPeriod); BlockHeader header = Mockito.mock(BlockHeader.class); Block block = Mockito.mock(Block.class); Mockito.when(block.getHeader()).thenReturn(header); Mockito.when(heade...
@Override public boolean isValid(Block block) { return isValid(block.getHeader()); }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); @Override boole...
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); @Override boole...
@Test public void blockTimeLowerThanParentTime() { int validPeriod = 540; BlockTimeStampValidationRule validationRule = new BlockTimeStampValidationRule(validPeriod); BlockHeader header = Mockito.mock(BlockHeader.class); Block block = Mockito.mock(Block.class); Mockito.when(block.getHeader()).thenReturn(header); Block ...
@Override public boolean isValid(Block block) { return isValid(block.getHeader()); }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); @Override boole...
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); @Override boole...
@Test public void blockTimeGreaterThanParentTime() { int validPeriod = 540; BlockTimeStampValidationRule validationRule = new BlockTimeStampValidationRule(validPeriod); BlockHeader header = Mockito.mock(BlockHeader.class); Block block = Mockito.mock(Block.class); Mockito.when(block.getHeader()).thenReturn(header); Bloc...
@Override public boolean isValid(Block block) { return isValid(block.getHeader()); }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); @Override boole...
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); @Override boole...
@Test public void blockTimeEqualsParentTime() { int validPeriod = 540; BlockTimeStampValidationRule validationRule = new BlockTimeStampValidationRule(validPeriod); BlockHeader header = Mockito.mock(BlockHeader.class); Block block = Mockito.mock(Block.class); Mockito.when(block.getHeader()).thenReturn(header); Block par...
@Override public boolean isValid(Block block) { return isValid(block.getHeader()); }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); }
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); @Override boole...
BlockTimeStampValidationRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule, BlockValidationRule, BlockHeaderValidationRule { @Override public boolean isValid(Block block) { return isValid(block.getHeader()); } BlockTimeStampValidationRule(int validPeriodLength); @Override boole...
@Test public void noTxInTheBlock() { Block b = Mockito.mock(Block.class); RemascValidationRule rule = new RemascValidationRule(); Assert.assertFalse(rule.isValid(b)); }
@Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.panic("invalidremasctx", "Remasc tx not found in block")...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
@Test public void noRemascTxInTheBlock() { Block b = Mockito.mock(Block.class); List<Transaction> tx = new ArrayList<>(); tx.add(new Transaction("0000000000000000000000000000000000000001", BigInteger.ZERO, BigInteger.ZERO, BigInteger.ONE, BigInteger.TEN, Constants.REGTEST_CHAIN_ID)); Mockito.when(b.getTransactionsList(...
@Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.panic("invalidremasctx", "Remasc tx not found in block")...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
@Test public void remascTxIsNotTheLastOne() { Block b = Mockito.mock(Block.class); List<Transaction> tx = new ArrayList<>(); tx.add(new RemascTransaction(1L)); tx.add(new Transaction("0000000000000000000000000000000000000001", BigInteger.ZERO, BigInteger.ZERO, BigInteger.ONE, BigInteger.TEN, Constants.REGTEST_CHAIN_ID)...
@Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.panic("invalidremasctx", "Remasc tx not found in block")...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
@Test public void remascTxInBlock() { Block b = Mockito.mock(Block.class); List<Transaction> tx = new ArrayList<>(); tx.add(new Transaction("0000000000000000000000000000000000000001", BigInteger.ZERO, BigInteger.ZERO, BigInteger.ONE, BigInteger.TEN, Constants.REGTEST_CHAIN_ID)); tx.add(new RemascTransaction(1L)); Mocki...
@Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.panic("invalidremasctx", "Remasc tx not found in block")...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
RemascValidationRule implements BlockValidationRule { @Override public boolean isValid(Block block) { List<Transaction> txs = block.getTransactionsList(); boolean result = !txs.isEmpty() && (txs.get(txs.size()-1) instanceof RemascTransaction); if(!result) { logger.warn("Remasc tx not found in block"); panicProcessor.pa...
@Test public void noMatchEmptyBloomWithFilterWithAccount() { Account account = new AccountBuilder().name("account").build(); RskAddress address = account.getAddress(); AddressesTopicsFilter filter = new AddressesTopicsFilter(new RskAddress[] { address }, null); Assert.assertFalse(filter.matchBloom(new Bloom())); }
public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; }
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } }
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
@Test public void validWhenNumberIsOneMore() { whenBlockNumber(parentHeader, 451); whenBlockNumber(blockHeader, 452); Assert.assertTrue(rule.isValid(block, parent)); }
@Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parentHeader = parent.getHeader(); if (header.getNumber() != (parentHeader.getNumber() + 1)) { logger.warn("#{}: block...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
@Test public void invalidWhenNumberIsTheSame() { whenBlockNumber(parentHeader, 451); whenBlockNumber(blockHeader, 451); Assert.assertFalse(rule.isValid(block, parent)); }
@Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parentHeader = parent.getHeader(); if (header.getNumber() != (parentHeader.getNumber() + 1)) { logger.warn("#{}: block...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
@Test public void invalidWhenNumberIsLess() { whenBlockNumber(parentHeader, 451); whenBlockNumber(blockHeader, 450); Assert.assertFalse(rule.isValid(block, parent)); }
@Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parentHeader = parent.getHeader(); if (header.getNumber() != (parentHeader.getNumber() + 1)) { logger.warn("#{}: block...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
@Test public void invalidWhenNumberIsMoreThanOne() { whenBlockNumber(parentHeader, 451); whenBlockNumber(blockHeader, 999); Assert.assertFalse(rule.isValid(block, parent)); }
@Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parentHeader = parent.getHeader(); if (header.getNumber() != (parentHeader.getNumber() + 1)) { logger.warn("#{}: block...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
BlockParentNumberRule implements BlockParentDependantValidationRule, BlockHeaderParentDependantValidationRule { @Override public boolean isValid(BlockHeader header, Block parent) { if (header == null || parent == null) { logger.warn("BlockParentNumberRule - block or parent are null"); return false; } BlockHeader parent...
@Test public void getsSnapshotFromTranslatedStateRoot() { BlockHeader header = mock(BlockHeader.class); Keccak256 stateRoot = TestUtils.randomHash(); when(stateRootHandler.translate(header)).thenReturn(stateRoot); Trie underlyingTrie = mock(Trie.class); when(underlyingTrie.getHash()).thenReturn(TestUtils.randomHash());...
public RepositorySnapshot snapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header) .map(MutableRepository::new) .orElseThrow(() -> trieNotFoundException(header)); }
RepositoryLocator { public RepositorySnapshot snapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header) .map(MutableRepository::new) .orElseThrow(() -> trieNotFoundException(header)); } }
RepositoryLocator { public RepositorySnapshot snapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header) .map(MutableRepository::new) .orElseThrow(() -> trieNotFoundException(header)); } RepositoryLocator(TrieStore store, StateRootHandler stateRootHandler); }
RepositoryLocator { public RepositorySnapshot snapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header) .map(MutableRepository::new) .orElseThrow(() -> trieNotFoundException(header)); } RepositoryLocator(TrieStore store, StateRootHandler stateRootHandler); Optional<RepositorySnapshot> findSnapshotAt(BlockHe...
RepositoryLocator { public RepositorySnapshot snapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header) .map(MutableRepository::new) .orElseThrow(() -> trieNotFoundException(header)); } RepositoryLocator(TrieStore store, StateRootHandler stateRootHandler); Optional<RepositorySnapshot> findSnapshotAt(BlockHe...
@Test public void findSnapshotAt_notFound() { BlockHeader header = mock(BlockHeader.class); Keccak256 stateRoot = TestUtils.randomHash(); when(stateRootHandler.translate(header)).thenReturn(stateRoot); Trie underlyingTrie = mock(Trie.class); when(underlyingTrie.getHash()).thenReturn(TestUtils.randomHash()); when(trieSt...
public Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header).map(MutableRepository::new); }
RepositoryLocator { public Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header).map(MutableRepository::new); } }
RepositoryLocator { public Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header).map(MutableRepository::new); } RepositoryLocator(TrieStore store, StateRootHandler stateRootHandler); }
RepositoryLocator { public Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header).map(MutableRepository::new); } RepositoryLocator(TrieStore store, StateRootHandler stateRootHandler); Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header); RepositorySnapshot snap...
RepositoryLocator { public Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header).map(MutableRepository::new); } RepositoryLocator(TrieStore store, StateRootHandler stateRootHandler); Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header); RepositorySnapshot snap...
@Test public void findSnapshotAt_found() { BlockHeader header = mock(BlockHeader.class); Keccak256 stateRoot = TestUtils.randomHash(); when(stateRootHandler.translate(header)).thenReturn(stateRoot); Trie underlyingTrie = mock(Trie.class); when(underlyingTrie.getHash()).thenReturn(TestUtils.randomHash()); when(trieStore...
public Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header).map(MutableRepository::new); }
RepositoryLocator { public Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header).map(MutableRepository::new); } }
RepositoryLocator { public Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header).map(MutableRepository::new); } RepositoryLocator(TrieStore store, StateRootHandler stateRootHandler); }
RepositoryLocator { public Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header).map(MutableRepository::new); } RepositoryLocator(TrieStore store, StateRootHandler stateRootHandler); Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header); RepositorySnapshot snap...
RepositoryLocator { public Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header).map(MutableRepository::new); } RepositoryLocator(TrieStore store, StateRootHandler stateRootHandler); Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header); RepositorySnapshot snap...
@Test public void testStorageKeysMixOneLevel() { MutableTrieImpl baseMutableTrie = new MutableTrieImpl(null, new Trie()); MutableTrieCache mtCache = new MutableTrieCache(baseMutableTrie); MutableTrieCache otherCache = new MutableTrieCache(mtCache); MutableRepository baseRepository = new MutableRepository(baseMutableTri...
public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecursiveLog.contains(accountWrapper); Map<Byt...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
@Test public void testStorageKeysNoCache() { MutableTrieImpl baseMutableTrie = new MutableTrieImpl(null, new Trie()); MutableTrieCache mtCache = new MutableTrieCache(baseMutableTrie); MutableRepository baseRepository = new MutableRepository(baseMutableTrie); RskAddress addr = new RskAddress("b86ca7db8c7ae687ac8d0987899...
public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecursiveLog.contains(accountWrapper); Map<Byt...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
@Test public void testStorageKeysNoTrie() { MutableTrieImpl baseMutableTrie = new MutableTrieImpl(null, new Trie()); MutableTrieCache mtCache = new MutableTrieCache(baseMutableTrie); MutableRepository cacheRepository = new MutableRepository(mtCache); RskAddress addr = new RskAddress("b86ca7db8c7ae687ac8d098789987eee123...
public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecursiveLog.contains(accountWrapper); Map<Byt...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
@Test public void noMatchEmptyBloomWithFilterWithTopic() { Topic topic = createTopic(); AddressesTopicsFilter filter = new AddressesTopicsFilter(new RskAddress[0], new Topic[][] {{ topic }}); Assert.assertFalse(filter.matchBloom(new Bloom())); }
public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; }
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } }
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
@Test public void testStorageKeysDeletedAccount() { MutableTrieImpl baseMutableTrie = new MutableTrieImpl(null, new Trie()); MutableTrieCache mtCache = new MutableTrieCache(baseMutableTrie); MutableRepository cacheRepository = new MutableRepository(mtCache); MutableRepository baseRepository = new MutableRepository(base...
public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecursiveLog.contains(accountWrapper); Map<Byt...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
MutableTrieCache implements MutableTrie { public Iterator<DataWord> getStorageKeys(RskAddress addr) { byte[] accountStoragePrefixKey = trieKeyMapper.getAccountStoragePrefixKey(addr); ByteArrayWrapper accountWrapper = getAccountWrapper(new ByteArrayWrapper(accountStoragePrefixKey)); boolean isDeletedAccount = deleteRecu...
@Test public void testGetValueNotStoredAndGetSize() { MutableTrieImpl baseMutableTrie = new MutableTrieImpl(null, new Trie()); byte[] wrongKey = toBytes("BOB"); Uint24 valueLength = baseMutableTrie.getValueLength(wrongKey); assertEquals(Uint24.ZERO, valueLength); MutableTrieCache mtCache = new MutableTrieCache(baseMuta...
@Override public Uint24 getValueLength(byte[] key) { return internalGet(key, trie::getValueLength, cachedBytes -> new Uint24(cachedBytes.length)).orElse(Uint24.ZERO); }
MutableTrieCache implements MutableTrie { @Override public Uint24 getValueLength(byte[] key) { return internalGet(key, trie::getValueLength, cachedBytes -> new Uint24(cachedBytes.length)).orElse(Uint24.ZERO); } }
MutableTrieCache implements MutableTrie { @Override public Uint24 getValueLength(byte[] key) { return internalGet(key, trie::getValueLength, cachedBytes -> new Uint24(cachedBytes.length)).orElse(Uint24.ZERO); } MutableTrieCache(MutableTrie parentTrie); }
MutableTrieCache implements MutableTrie { @Override public Uint24 getValueLength(byte[] key) { return internalGet(key, trie::getValueLength, cachedBytes -> new Uint24(cachedBytes.length)).orElse(Uint24.ZERO); } MutableTrieCache(MutableTrie parentTrie); @Override Trie getTrie(); @Override Keccak256 getHash(); @Override ...
MutableTrieCache implements MutableTrie { @Override public Uint24 getValueLength(byte[] key) { return internalGet(key, trie::getValueLength, cachedBytes -> new Uint24(cachedBytes.length)).orElse(Uint24.ZERO); } MutableTrieCache(MutableTrie parentTrie); @Override Trie getTrie(); @Override Keccak256 getHash(); @Override ...
@Test public void testStoreValueOnTrieAndGetHash() { MutableTrieImpl baseMutableTrie = new MutableTrieImpl(null, new Trie()); MutableTrieCache mtCache = new MutableTrieCache(baseMutableTrie); byte[] value = toBytes("11111111112222222222333333333344"); byte[] key = toBytes("ALICE"); byte[] keyForCache = toBytes("ALICE2"...
@Override public void put(byte[] key, byte[] value) { put(new ByteArrayWrapper(key), value); }
MutableTrieCache implements MutableTrie { @Override public void put(byte[] key, byte[] value) { put(new ByteArrayWrapper(key), value); } }
MutableTrieCache implements MutableTrie { @Override public void put(byte[] key, byte[] value) { put(new ByteArrayWrapper(key), value); } MutableTrieCache(MutableTrie parentTrie); }
MutableTrieCache implements MutableTrie { @Override public void put(byte[] key, byte[] value) { put(new ByteArrayWrapper(key), value); } MutableTrieCache(MutableTrie parentTrie); @Override Trie getTrie(); @Override Keccak256 getHash(); @Override byte[] get(byte[] key); Iterator<DataWord> getStorageKeys(RskAddress addr)...
MutableTrieCache implements MutableTrie { @Override public void put(byte[] key, byte[] value) { put(new ByteArrayWrapper(key), value); } MutableTrieCache(MutableTrie parentTrie); @Override Trie getTrie(); @Override Keccak256 getHash(); @Override byte[] get(byte[] key); Iterator<DataWord> getStorageKeys(RskAddress addr)...
@Test public void testStoreEmptyValueOnTrieAndGetHash() { MutableTrieImpl baseMutableTrie = new MutableTrieImpl(null, new Trie()); MutableTrieCache mtCache = new MutableTrieCache(baseMutableTrie); byte[] emptyValue = new byte[0]; byte[] key = toBytes("ALICE"); byte[] keyForCache = toBytes("ALICE2"); Keccak256 emptyHash...
@Override public void put(byte[] key, byte[] value) { put(new ByteArrayWrapper(key), value); }
MutableTrieCache implements MutableTrie { @Override public void put(byte[] key, byte[] value) { put(new ByteArrayWrapper(key), value); } }
MutableTrieCache implements MutableTrie { @Override public void put(byte[] key, byte[] value) { put(new ByteArrayWrapper(key), value); } MutableTrieCache(MutableTrie parentTrie); }
MutableTrieCache implements MutableTrie { @Override public void put(byte[] key, byte[] value) { put(new ByteArrayWrapper(key), value); } MutableTrieCache(MutableTrie parentTrie); @Override Trie getTrie(); @Override Keccak256 getHash(); @Override byte[] get(byte[] key); Iterator<DataWord> getStorageKeys(RskAddress addr)...
MutableTrieCache implements MutableTrie { @Override public void put(byte[] key, byte[] value) { put(new ByteArrayWrapper(key), value); } MutableTrieCache(MutableTrie parentTrie); @Override Trie getTrie(); @Override Keccak256 getHash(); @Override byte[] get(byte[] key); Iterator<DataWord> getStorageKeys(RskAddress addr)...
@Test public void verifyFileEmpty() { BootstrapDataVerifier bootstrapDataVerifier = new BootstrapDataVerifier(); assertEquals(0, bootstrapDataVerifier.verifyEntries(new HashMap<>())); }
public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDataEntry> entry : selecte...
BootstrapDataVerifier { public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDa...
BootstrapDataVerifier { public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDa...
BootstrapDataVerifier { public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDa...
BootstrapDataVerifier { public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDa...
@Test public void verifyFileMany() { BootstrapDataVerifier bootstrapDataVerifier = new BootstrapDataVerifier(); HashMap<String, BootstrapDataEntry> entries = new HashMap<>(); List<String> keys = new ArrayList<>(); keys.add("04330037e82c177d7108077c80440821e13c1c62105f85e030214b48d7b5dff0b8e7c158b171546a71139e4de56c8535...
public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDataEntry> entry : selecte...
BootstrapDataVerifier { public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDa...
BootstrapDataVerifier { public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDa...
BootstrapDataVerifier { public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDa...
BootstrapDataVerifier { public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDa...
@Test(expected = BootstrapImportException.class) public void doNotVerifyForDifferentHashes() { BootstrapDataVerifier bootstrapDataVerifier = new BootstrapDataVerifier(); HashMap<String, BootstrapDataEntry> entries = new HashMap<>(); List<String> keys = new ArrayList<>(); keys.add("04330037e82c177d7108077c80440821e13c1c...
public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDataEntry> entry : selecte...
BootstrapDataVerifier { public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDa...
BootstrapDataVerifier { public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDa...
BootstrapDataVerifier { public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDa...
BootstrapDataVerifier { public int verifyEntries(Map<String, BootstrapDataEntry> selectedEntries) { int verifications = 0; if (selectedEntries.isEmpty()) { return 0; } String hashToVerify = selectedEntries.values().iterator().next().getHash(); byte[] dbHash = Hex.decode(hashToVerify); for (Map.Entry<String, BootstrapDa...
@Test(expected = BootstrapImportException.class) public void retrieveDataInsufficientsSources() { BootstrapDataVerifier bootstrapDataVerifier = mock(BootstrapDataVerifier.class); when(bootstrapDataVerifier.verifyEntries(any())).thenReturn(1); BootstrapFileHandler bootstrapFileHandler = mock(BootstrapFileHandler.class);...
public void retrieveData() { BootstrapIndexCandidateSelector.HeightCandidate heightCandidate = bootstrapIndexCandidateSelector.getHeightData(getIndices()); Map<String, BootstrapDataEntry> selectedEntries = heightCandidate.getEntries(); verify(heightCandidate); height = heightCandidate.getHeight(); bootstrapFileHandler....
BootstrapDataProvider { public void retrieveData() { BootstrapIndexCandidateSelector.HeightCandidate heightCandidate = bootstrapIndexCandidateSelector.getHeightData(getIndices()); Map<String, BootstrapDataEntry> selectedEntries = heightCandidate.getEntries(); verify(heightCandidate); height = heightCandidate.getHeight(...
BootstrapDataProvider { public void retrieveData() { BootstrapIndexCandidateSelector.HeightCandidate heightCandidate = bootstrapIndexCandidateSelector.getHeightData(getIndices()); Map<String, BootstrapDataEntry> selectedEntries = heightCandidate.getEntries(); verify(heightCandidate); height = heightCandidate.getHeight(...
BootstrapDataProvider { public void retrieveData() { BootstrapIndexCandidateSelector.HeightCandidate heightCandidate = bootstrapIndexCandidateSelector.getHeightData(getIndices()); Map<String, BootstrapDataEntry> selectedEntries = heightCandidate.getEntries(); verify(heightCandidate); height = heightCandidate.getHeight(...
BootstrapDataProvider { public void retrieveData() { BootstrapIndexCandidateSelector.HeightCandidate heightCandidate = bootstrapIndexCandidateSelector.getHeightData(getIndices()); Map<String, BootstrapDataEntry> selectedEntries = heightCandidate.getEntries(); verify(heightCandidate); height = heightCandidate.getHeight(...
@Test public void retrieveData() { BootstrapDataVerifier bootstrapDataVerifier = mock(BootstrapDataVerifier.class); when(bootstrapDataVerifier.verifyEntries(any())).thenReturn(2); BootstrapFileHandler bootstrapFileHandler = mock(BootstrapFileHandler.class); BootstrapIndexCandidateSelector bootstrapIndexCandidateSelecto...
public void retrieveData() { BootstrapIndexCandidateSelector.HeightCandidate heightCandidate = bootstrapIndexCandidateSelector.getHeightData(getIndices()); Map<String, BootstrapDataEntry> selectedEntries = heightCandidate.getEntries(); verify(heightCandidate); height = heightCandidate.getHeight(); bootstrapFileHandler....
BootstrapDataProvider { public void retrieveData() { BootstrapIndexCandidateSelector.HeightCandidate heightCandidate = bootstrapIndexCandidateSelector.getHeightData(getIndices()); Map<String, BootstrapDataEntry> selectedEntries = heightCandidate.getEntries(); verify(heightCandidate); height = heightCandidate.getHeight(...
BootstrapDataProvider { public void retrieveData() { BootstrapIndexCandidateSelector.HeightCandidate heightCandidate = bootstrapIndexCandidateSelector.getHeightData(getIndices()); Map<String, BootstrapDataEntry> selectedEntries = heightCandidate.getEntries(); verify(heightCandidate); height = heightCandidate.getHeight(...
BootstrapDataProvider { public void retrieveData() { BootstrapIndexCandidateSelector.HeightCandidate heightCandidate = bootstrapIndexCandidateSelector.getHeightData(getIndices()); Map<String, BootstrapDataEntry> selectedEntries = heightCandidate.getEntries(); verify(heightCandidate); height = heightCandidate.getHeight(...
BootstrapDataProvider { public void retrieveData() { BootstrapIndexCandidateSelector.HeightCandidate heightCandidate = bootstrapIndexCandidateSelector.getHeightData(getIndices()); Map<String, BootstrapDataEntry> selectedEntries = heightCandidate.getEntries(); verify(heightCandidate); height = heightCandidate.getHeight(...
@Test(expected= BootstrapImportException.class) public void getMaximumCommonHeightDataEmpty() { List<String> keys = Arrays.asList("key1", "key2"); BootstrapIndexCandidateSelector indexMCH = new BootstrapIndexCandidateSelector(keys, 2); List<BootstrapDataIndex> indexes = new ArrayList<>(); indexMCH.getHeightData(indexes...
public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); }
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } }
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
@Test public void matchAllBloomWithFilterWithTopic() { Topic topic = createTopic(); AddressesTopicsFilter filter = new AddressesTopicsFilter(new RskAddress[0], new Topic[][] {{ topic }}); Assert.assertTrue(filter.matchBloom(getAllBloom())); }
public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; }
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } }
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
@Test public void getValueWhenValueIsEmpty() throws Exception { Web3.CallArguments args = new Web3.CallArguments(); args.value = ""; CallArgumentsToByteArray byteArrayArgs = new CallArgumentsToByteArray(args); Assert.assertArrayEquals(new byte[] {0}, byteArrayArgs.getValue()); }
public byte[] getValue() { byte[] value = new byte[] { 0 }; if (args.value != null && args.value.length() != 0) { value = stringHexToByteArray(args.value); } return value; }
CallArgumentsToByteArray { public byte[] getValue() { byte[] value = new byte[] { 0 }; if (args.value != null && args.value.length() != 0) { value = stringHexToByteArray(args.value); } return value; } }
CallArgumentsToByteArray { public byte[] getValue() { byte[] value = new byte[] { 0 }; if (args.value != null && args.value.length() != 0) { value = stringHexToByteArray(args.value); } return value; } CallArgumentsToByteArray(Web3.CallArguments args); }
CallArgumentsToByteArray { public byte[] getValue() { byte[] value = new byte[] { 0 }; if (args.value != null && args.value.length() != 0) { value = stringHexToByteArray(args.value); } return value; } CallArgumentsToByteArray(Web3.CallArguments args); byte[] getGasPrice(); byte[] getGasLimit(); byte[] getToAddress(); b...
CallArgumentsToByteArray { public byte[] getValue() { byte[] value = new byte[] { 0 }; if (args.value != null && args.value.length() != 0) { value = stringHexToByteArray(args.value); } return value; } CallArgumentsToByteArray(Web3.CallArguments args); byte[] getGasPrice(); byte[] getGasLimit(); byte[] getToAddress(); b...
@Test(expected=BootstrapImportException.class) public void getMaximumCommonHeightDataOneEntry() { List<String> keys = Arrays.asList("key1", "key2"); BootstrapIndexCandidateSelector indexMCH = new BootstrapIndexCandidateSelector(keys, 2); List<BootstrapDataIndex> indexes = new ArrayList<>(); ArrayList<BootstrapDataEntry...
public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); }
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } }
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
@Test(expected=BootstrapImportException.class) public void getMaximumCommonHeightDataDuplicatedEntries() { List<String> keys = Arrays.asList("key1", "key2"); BootstrapIndexCandidateSelector indexMCH = new BootstrapIndexCandidateSelector(keys, 2); List<BootstrapDataIndex> indexes = new ArrayList<>(); ArrayList<Bootstrap...
public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); }
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } }
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
@Test public void getMaximumCommonHeightDataTwoEntries() { List<String> keys = Arrays.asList("key1", "key2"); BootstrapIndexCandidateSelector indexMCH = new BootstrapIndexCandidateSelector(keys, 2); List<BootstrapDataIndex> indexes = new ArrayList<>(); ArrayList<BootstrapDataEntry> entries = new ArrayList<>(); ArrayLis...
public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); }
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } }
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
@Test public void getMaximumCommonHeightDataThreeEntries() { List<String> keys = Arrays.asList("key1", "key2"); BootstrapIndexCandidateSelector indexMCH = new BootstrapIndexCandidateSelector(keys, 2); List<BootstrapDataIndex> indexes = new ArrayList<>(); ArrayList<BootstrapDataEntry> entries = new ArrayList<>(); ArrayL...
public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); }
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } }
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
@Test public void getMaximumCommonHeightDataManyEntries() { List<String> keys = Arrays.asList("key1", "key2", "keys3"); BootstrapIndexCandidateSelector indexMCH = new BootstrapIndexCandidateSelector(keys, 2); List<BootstrapDataIndex> indexes = new ArrayList<>(); ArrayList<BootstrapDataEntry> entries = new ArrayList<>()...
public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); }
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } }
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
BootstrapIndexCandidateSelector { public HeightCandidate getHeightData(List<BootstrapDataIndex> indexes) { Map<Long, Map<String, BootstrapDataEntry>> entriesPerHeight = getEntriesPerHeight(indexes); return getHeightCandidate(entriesPerHeight); } BootstrapIndexCandidateSelector(List<String> publicKeys, int minimumRequir...
@Test public void retrieveEmpty() { BootstrapIndexRetriever bootstrapIndexRetriever = new BootstrapIndexRetriever( new ArrayList<>(), mock(BootstrapURLProvider.class), mock(ObjectMapper.class) ); List<BootstrapDataIndex> indices = bootstrapIndexRetriever.retrieve(); Assert.assertTrue(indices.isEmpty()); }
public List<BootstrapDataIndex> retrieve() { List<BootstrapDataIndex> indices = new ArrayList<>(); for (String pk : publicKeys) { String indexSuffix = pk +"/" + INDEX_NAME; URL indexURL = bootstrapUrlProvider.getFullURL(indexSuffix); indices.add(readJson(indexURL)); } return indices; }
BootstrapIndexRetriever { public List<BootstrapDataIndex> retrieve() { List<BootstrapDataIndex> indices = new ArrayList<>(); for (String pk : publicKeys) { String indexSuffix = pk +"/" + INDEX_NAME; URL indexURL = bootstrapUrlProvider.getFullURL(indexSuffix); indices.add(readJson(indexURL)); } return indices; } }
BootstrapIndexRetriever { public List<BootstrapDataIndex> retrieve() { List<BootstrapDataIndex> indices = new ArrayList<>(); for (String pk : publicKeys) { String indexSuffix = pk +"/" + INDEX_NAME; URL indexURL = bootstrapUrlProvider.getFullURL(indexSuffix); indices.add(readJson(indexURL)); } return indices; } Bootstr...
BootstrapIndexRetriever { public List<BootstrapDataIndex> retrieve() { List<BootstrapDataIndex> indices = new ArrayList<>(); for (String pk : publicKeys) { String indexSuffix = pk +"/" + INDEX_NAME; URL indexURL = bootstrapUrlProvider.getFullURL(indexSuffix); indices.add(readJson(indexURL)); } return indices; } Bootstr...
BootstrapIndexRetriever { public List<BootstrapDataIndex> retrieve() { List<BootstrapDataIndex> indices = new ArrayList<>(); for (String pk : publicKeys) { String indexSuffix = pk +"/" + INDEX_NAME; URL indexURL = bootstrapUrlProvider.getFullURL(indexSuffix); indices.add(readJson(indexURL)); } return indices; } Bootstr...
@Test public void retrievePublicKey() throws IOException { ObjectMapper objectMapper = mock(ObjectMapper.class); BootstrapDataIndex bdi = new BootstrapDataIndex(Collections.singletonList( new BootstrapDataEntry(1, "", "db", "hash", new BootstrapDataSignature("r", "s")))); when(objectMapper.readValue(any(URL.class), eq(...
public List<BootstrapDataIndex> retrieve() { List<BootstrapDataIndex> indices = new ArrayList<>(); for (String pk : publicKeys) { String indexSuffix = pk +"/" + INDEX_NAME; URL indexURL = bootstrapUrlProvider.getFullURL(indexSuffix); indices.add(readJson(indexURL)); } return indices; }
BootstrapIndexRetriever { public List<BootstrapDataIndex> retrieve() { List<BootstrapDataIndex> indices = new ArrayList<>(); for (String pk : publicKeys) { String indexSuffix = pk +"/" + INDEX_NAME; URL indexURL = bootstrapUrlProvider.getFullURL(indexSuffix); indices.add(readJson(indexURL)); } return indices; } }
BootstrapIndexRetriever { public List<BootstrapDataIndex> retrieve() { List<BootstrapDataIndex> indices = new ArrayList<>(); for (String pk : publicKeys) { String indexSuffix = pk +"/" + INDEX_NAME; URL indexURL = bootstrapUrlProvider.getFullURL(indexSuffix); indices.add(readJson(indexURL)); } return indices; } Bootstr...
BootstrapIndexRetriever { public List<BootstrapDataIndex> retrieve() { List<BootstrapDataIndex> indices = new ArrayList<>(); for (String pk : publicKeys) { String indexSuffix = pk +"/" + INDEX_NAME; URL indexURL = bootstrapUrlProvider.getFullURL(indexSuffix); indices.add(readJson(indexURL)); } return indices; } Bootstr...
BootstrapIndexRetriever { public List<BootstrapDataIndex> retrieve() { List<BootstrapDataIndex> indices = new ArrayList<>(); for (String pk : publicKeys) { String indexSuffix = pk +"/" + INDEX_NAME; URL indexURL = bootstrapUrlProvider.getFullURL(indexSuffix); indices.add(readJson(indexURL)); } return indices; } Bootstr...
@Test public void importData() throws IOException, URISyntaxException { BlockStore blockStore = mock(BlockStore.class); when(blockStore.getMaxNumber()).thenReturn(0L); when(blockStore.isEmpty()).thenReturn(false); BlockFactory blockFactory = mock(BlockFactory.class); TrieStore trieStore = mock(TrieStore.class); Bootstr...
public void importData() { bootstrapDataProvider.retrieveData(); updateDatabase(); }
BootstrapImporter { public void importData() { bootstrapDataProvider.retrieveData(); updateDatabase(); } }
BootstrapImporter { public void importData() { bootstrapDataProvider.retrieveData(); updateDatabase(); } BootstrapImporter( BlockStore blockStore, TrieStore trieStore, BlockFactory blockFactory, BootstrapDataProvider bootstrapDataProvider); }
BootstrapImporter { public void importData() { bootstrapDataProvider.retrieveData(); updateDatabase(); } BootstrapImporter( BlockStore blockStore, TrieStore trieStore, BlockFactory blockFactory, BootstrapDataProvider bootstrapDataProvider); void importData(); }
BootstrapImporter { public void importData() { bootstrapDataProvider.retrieveData(); updateDatabase(); } BootstrapImporter( BlockStore blockStore, TrieStore trieStore, BlockFactory blockFactory, BootstrapDataProvider bootstrapDataProvider); void importData(); }
@Test public void getFullURL() { String BASE_URL = "http: BootstrapURLProvider bootstrapURLProvider = new BootstrapURLProvider(BASE_URL); String suffix = "suffix"; URL fullURL = bootstrapURLProvider.getFullURL(suffix); try { URL expected = new URL(BASE_URL + suffix); assertEquals(expected, fullURL); } catch (MalformedU...
public URL getFullURL(String uriSuffix) { try { return new URL(bootstrapBaseURL + uriSuffix); } catch (MalformedURLException e) { throw new BootstrapImportException(String.format( "The defined url for database.import.url %s is not valid", bootstrapBaseURL ), e); } }
BootstrapURLProvider { public URL getFullURL(String uriSuffix) { try { return new URL(bootstrapBaseURL + uriSuffix); } catch (MalformedURLException e) { throw new BootstrapImportException(String.format( "The defined url for database.import.url %s is not valid", bootstrapBaseURL ), e); } } }
BootstrapURLProvider { public URL getFullURL(String uriSuffix) { try { return new URL(bootstrapBaseURL + uriSuffix); } catch (MalformedURLException e) { throw new BootstrapImportException(String.format( "The defined url for database.import.url %s is not valid", bootstrapBaseURL ), e); } } BootstrapURLProvider(String bo...
BootstrapURLProvider { public URL getFullURL(String uriSuffix) { try { return new URL(bootstrapBaseURL + uriSuffix); } catch (MalformedURLException e) { throw new BootstrapImportException(String.format( "The defined url for database.import.url %s is not valid", bootstrapBaseURL ), e); } } BootstrapURLProvider(String bo...
BootstrapURLProvider { public URL getFullURL(String uriSuffix) { try { return new URL(bootstrapBaseURL + uriSuffix); } catch (MalformedURLException e) { throw new BootstrapImportException(String.format( "The defined url for database.import.url %s is not valid", bootstrapBaseURL ), e); } } BootstrapURLProvider(String bo...
@Test(expected=BootstrapImportException.class) public void getWrongFullURL() { String BASE_URL = "localhost/baseURL"; BootstrapURLProvider bootstrapURLProvider = new BootstrapURLProvider(BASE_URL); String suffix = "suffix"; bootstrapURLProvider.getFullURL(suffix); }
public URL getFullURL(String uriSuffix) { try { return new URL(bootstrapBaseURL + uriSuffix); } catch (MalformedURLException e) { throw new BootstrapImportException(String.format( "The defined url for database.import.url %s is not valid", bootstrapBaseURL ), e); } }
BootstrapURLProvider { public URL getFullURL(String uriSuffix) { try { return new URL(bootstrapBaseURL + uriSuffix); } catch (MalformedURLException e) { throw new BootstrapImportException(String.format( "The defined url for database.import.url %s is not valid", bootstrapBaseURL ), e); } } }
BootstrapURLProvider { public URL getFullURL(String uriSuffix) { try { return new URL(bootstrapBaseURL + uriSuffix); } catch (MalformedURLException e) { throw new BootstrapImportException(String.format( "The defined url for database.import.url %s is not valid", bootstrapBaseURL ), e); } } BootstrapURLProvider(String bo...
BootstrapURLProvider { public URL getFullURL(String uriSuffix) { try { return new URL(bootstrapBaseURL + uriSuffix); } catch (MalformedURLException e) { throw new BootstrapImportException(String.format( "The defined url for database.import.url %s is not valid", bootstrapBaseURL ), e); } } BootstrapURLProvider(String bo...
BootstrapURLProvider { public URL getFullURL(String uriSuffix) { try { return new URL(bootstrapBaseURL + uriSuffix); } catch (MalformedURLException e) { throw new BootstrapImportException(String.format( "The defined url for database.import.url %s is not valid", bootstrapBaseURL ), e); } } BootstrapURLProvider(String bo...
@Test public void matchAllBloomWithFilterWithAccount() { Account account = new AccountBuilder().name("account").build(); RskAddress address = account.getAddress(); AddressesTopicsFilter filter = new AddressesTopicsFilter(new RskAddress[] { address }, null); Assert.assertTrue(filter.matchBloom(getAllBloom())); }
public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; }
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } }
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(RskAddress[] ...
@Test(expected = IllegalStateException.class) public void getMinNumber_emptyIndex() { target.getMinNumber(); }
@Override public long getMinNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return getMaxNumber() - index.size() + 1; }
MapDBBlocksIndex implements BlocksIndex { @Override public long getMinNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return getMaxNumber() - index.size() + 1; } }
MapDBBlocksIndex implements BlocksIndex { @Override public long getMinNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return getMaxNumber() - index.size() + 1; } MapDBBlocksIndex(DB indexDB); }
MapDBBlocksIndex implements BlocksIndex { @Override public long getMinNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return getMaxNumber() - index.size() + 1; } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @Override long getMinNumber()...
MapDBBlocksIndex implements BlocksIndex { @Override public long getMinNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return getMaxNumber() - index.size() + 1; } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @Override long getMinNumber()...
@Test public void getMinNumber_nonEmptyIndex() { metadata.put(MAX_BLOCK_NUMBER_KEY, ByteUtil.longToBytes(9)); index.put(9L, new ArrayList<>()); index.put(8L, new ArrayList<>()); assertEquals(8L, target.getMinNumber()); }
@Override public long getMinNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return getMaxNumber() - index.size() + 1; }
MapDBBlocksIndex implements BlocksIndex { @Override public long getMinNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return getMaxNumber() - index.size() + 1; } }
MapDBBlocksIndex implements BlocksIndex { @Override public long getMinNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return getMaxNumber() - index.size() + 1; } MapDBBlocksIndex(DB indexDB); }
MapDBBlocksIndex implements BlocksIndex { @Override public long getMinNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return getMaxNumber() - index.size() + 1; } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @Override long getMinNumber()...
MapDBBlocksIndex implements BlocksIndex { @Override public long getMinNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return getMaxNumber() - index.size() + 1; } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @Override long getMinNumber()...
@Test(expected = IllegalStateException.class) public void getMaxNumber_emptyIndex() { metadata.put(MAX_BLOCK_NUMBER_KEY, ByteUtil.longToBytes(9)); target.getMaxNumber(); }
@Override public long getMaxNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return ByteUtil.byteArrayToLong(metadata.get(MAX_BLOCK_NUMBER_KEY)); }
MapDBBlocksIndex implements BlocksIndex { @Override public long getMaxNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return ByteUtil.byteArrayToLong(metadata.get(MAX_BLOCK_NUMBER_KEY)); } }
MapDBBlocksIndex implements BlocksIndex { @Override public long getMaxNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return ByteUtil.byteArrayToLong(metadata.get(MAX_BLOCK_NUMBER_KEY)); } MapDBBlocksIndex(DB indexDB); }
MapDBBlocksIndex implements BlocksIndex { @Override public long getMaxNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return ByteUtil.byteArrayToLong(metadata.get(MAX_BLOCK_NUMBER_KEY)); } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @O...
MapDBBlocksIndex implements BlocksIndex { @Override public long getMaxNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return ByteUtil.byteArrayToLong(metadata.get(MAX_BLOCK_NUMBER_KEY)); } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @O...
@Test public void getMaxNumber() { metadata.put(MAX_BLOCK_NUMBER_KEY, ByteUtil.longToBytes(9)); index.put(9L, new ArrayList<>()); assertEquals(target.getMaxNumber(),9); }
@Override public long getMaxNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return ByteUtil.byteArrayToLong(metadata.get(MAX_BLOCK_NUMBER_KEY)); }
MapDBBlocksIndex implements BlocksIndex { @Override public long getMaxNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return ByteUtil.byteArrayToLong(metadata.get(MAX_BLOCK_NUMBER_KEY)); } }
MapDBBlocksIndex implements BlocksIndex { @Override public long getMaxNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return ByteUtil.byteArrayToLong(metadata.get(MAX_BLOCK_NUMBER_KEY)); } MapDBBlocksIndex(DB indexDB); }
MapDBBlocksIndex implements BlocksIndex { @Override public long getMaxNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return ByteUtil.byteArrayToLong(metadata.get(MAX_BLOCK_NUMBER_KEY)); } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @O...
MapDBBlocksIndex implements BlocksIndex { @Override public long getMaxNumber() { if (index.isEmpty()) { throw new IllegalStateException("Index is empty"); } return ByteUtil.byteArrayToLong(metadata.get(MAX_BLOCK_NUMBER_KEY)); } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @O...
@Test public void contains_true() { long blockNumber = 12; index.put(blockNumber, new ArrayList<>()); assertTrue(target.contains(blockNumber)); }
@Override public boolean contains(long blockNumber) { return index.containsKey(blockNumber); }
MapDBBlocksIndex implements BlocksIndex { @Override public boolean contains(long blockNumber) { return index.containsKey(blockNumber); } }
MapDBBlocksIndex implements BlocksIndex { @Override public boolean contains(long blockNumber) { return index.containsKey(blockNumber); } MapDBBlocksIndex(DB indexDB); }
MapDBBlocksIndex implements BlocksIndex { @Override public boolean contains(long blockNumber) { return index.containsKey(blockNumber); } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @Override long getMinNumber(); @Override boolean contains(long blockNumber); @Override List<I...
MapDBBlocksIndex implements BlocksIndex { @Override public boolean contains(long blockNumber) { return index.containsKey(blockNumber); } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @Override long getMinNumber(); @Override boolean contains(long blockNumber); @Override List<I...
@Test public void contains_false() { long blockNumber = 12; assertFalse(target.contains(blockNumber)); }
@Override public boolean contains(long blockNumber) { return index.containsKey(blockNumber); }
MapDBBlocksIndex implements BlocksIndex { @Override public boolean contains(long blockNumber) { return index.containsKey(blockNumber); } }
MapDBBlocksIndex implements BlocksIndex { @Override public boolean contains(long blockNumber) { return index.containsKey(blockNumber); } MapDBBlocksIndex(DB indexDB); }
MapDBBlocksIndex implements BlocksIndex { @Override public boolean contains(long blockNumber) { return index.containsKey(blockNumber); } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @Override long getMinNumber(); @Override boolean contains(long blockNumber); @Override List<I...
MapDBBlocksIndex implements BlocksIndex { @Override public boolean contains(long blockNumber) { return index.containsKey(blockNumber); } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @Override long getMinNumber(); @Override boolean contains(long blockNumber); @Override List<I...
@Test public void getBlocksByNumber_found() { long blockNumber = 20; List<IndexedBlockStore.BlockInfo> expectedResult = mock(List.class); index.put(blockNumber, expectedResult); List<IndexedBlockStore.BlockInfo> result = target.getBlocksByNumber(blockNumber); assertEquals(expectedResult, result); }
@Override public List<IndexedBlockStore.BlockInfo> getBlocksByNumber(long blockNumber) { return index.getOrDefault(blockNumber, new ArrayList<>()); }
MapDBBlocksIndex implements BlocksIndex { @Override public List<IndexedBlockStore.BlockInfo> getBlocksByNumber(long blockNumber) { return index.getOrDefault(blockNumber, new ArrayList<>()); } }
MapDBBlocksIndex implements BlocksIndex { @Override public List<IndexedBlockStore.BlockInfo> getBlocksByNumber(long blockNumber) { return index.getOrDefault(blockNumber, new ArrayList<>()); } MapDBBlocksIndex(DB indexDB); }
MapDBBlocksIndex implements BlocksIndex { @Override public List<IndexedBlockStore.BlockInfo> getBlocksByNumber(long blockNumber) { return index.getOrDefault(blockNumber, new ArrayList<>()); } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @Override long getMinNumber(); @Overri...
MapDBBlocksIndex implements BlocksIndex { @Override public List<IndexedBlockStore.BlockInfo> getBlocksByNumber(long blockNumber) { return index.getOrDefault(blockNumber, new ArrayList<>()); } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @Override long getMinNumber(); @Overri...
@Test(expected = IllegalArgumentException.class) public void putBlocks_nullList() { target.putBlocks(20L, null); }
@Override public void putBlocks(long blockNumber, List<IndexedBlockStore.BlockInfo> blocks) { if (blocks == null || blocks.isEmpty()) { throw new IllegalArgumentException("Block list cannot be empty nor null."); } long maxNumber = -1; if (index.size() > 0) { maxNumber = getMaxNumber(); } if (blockNumber > maxNumber) { ...
MapDBBlocksIndex implements BlocksIndex { @Override public void putBlocks(long blockNumber, List<IndexedBlockStore.BlockInfo> blocks) { if (blocks == null || blocks.isEmpty()) { throw new IllegalArgumentException("Block list cannot be empty nor null."); } long maxNumber = -1; if (index.size() > 0) { maxNumber = getMaxN...
MapDBBlocksIndex implements BlocksIndex { @Override public void putBlocks(long blockNumber, List<IndexedBlockStore.BlockInfo> blocks) { if (blocks == null || blocks.isEmpty()) { throw new IllegalArgumentException("Block list cannot be empty nor null."); } long maxNumber = -1; if (index.size() > 0) { maxNumber = getMaxN...
MapDBBlocksIndex implements BlocksIndex { @Override public void putBlocks(long blockNumber, List<IndexedBlockStore.BlockInfo> blocks) { if (blocks == null || blocks.isEmpty()) { throw new IllegalArgumentException("Block list cannot be empty nor null."); } long maxNumber = -1; if (index.size() > 0) { maxNumber = getMaxN...
MapDBBlocksIndex implements BlocksIndex { @Override public void putBlocks(long blockNumber, List<IndexedBlockStore.BlockInfo> blocks) { if (blocks == null || blocks.isEmpty()) { throw new IllegalArgumentException("Block list cannot be empty nor null."); } long maxNumber = -1; if (index.size() > 0) { maxNumber = getMaxN...
@Test public void isEmpty_empty() { assertTrue(target.isEmpty()); }
@Override public boolean isEmpty() { return index.isEmpty(); }
MapDBBlocksIndex implements BlocksIndex { @Override public boolean isEmpty() { return index.isEmpty(); } }
MapDBBlocksIndex implements BlocksIndex { @Override public boolean isEmpty() { return index.isEmpty(); } MapDBBlocksIndex(DB indexDB); }
MapDBBlocksIndex implements BlocksIndex { @Override public boolean isEmpty() { return index.isEmpty(); } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @Override long getMinNumber(); @Override boolean contains(long blockNumber); @Override List<IndexedBlockStore.BlockInfo> getB...
MapDBBlocksIndex implements BlocksIndex { @Override public boolean isEmpty() { return index.isEmpty(); } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @Override long getMinNumber(); @Override boolean contains(long blockNumber); @Override List<IndexedBlockStore.BlockInfo> getB...
@Test public void flush() { target.flush(); verify(indexDB, times(1)).commit(); }
@Override public void flush() { indexDB.commit(); }
MapDBBlocksIndex implements BlocksIndex { @Override public void flush() { indexDB.commit(); } }
MapDBBlocksIndex implements BlocksIndex { @Override public void flush() { indexDB.commit(); } MapDBBlocksIndex(DB indexDB); }
MapDBBlocksIndex implements BlocksIndex { @Override public void flush() { indexDB.commit(); } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @Override long getMinNumber(); @Override boolean contains(long blockNumber); @Override List<IndexedBlockStore.BlockInfo> getBlocksByNumb...
MapDBBlocksIndex implements BlocksIndex { @Override public void flush() { indexDB.commit(); } MapDBBlocksIndex(DB indexDB); @Override boolean isEmpty(); @Override long getMaxNumber(); @Override long getMinNumber(); @Override boolean contains(long blockNumber); @Override List<IndexedBlockStore.BlockInfo> getBlocksByNumb...
@Test public void mimeTest() { final String SIMPLE_CONTENT_TYPE = "text/html"; final String NORMAL_CONTENT_TYPE = "text/html; charset=utf-8"; HttpMessage message = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK); HttpHeaders headers = message.headers(); String contentType = HttpHeaders.Names.CONTEN...
public static String getMimeType(String contentTypeValue) { if (contentTypeValue == null) { return null; } int indexOfSemicolon = contentTypeValue.indexOf(';'); if (indexOfSemicolon != -1) { return contentTypeValue.substring(0, indexOfSemicolon); } else { return contentTypeValue.length() > 0 ? contentTypeValue : null; ...
HttpUtils { public static String getMimeType(String contentTypeValue) { if (contentTypeValue == null) { return null; } int indexOfSemicolon = contentTypeValue.indexOf(';'); if (indexOfSemicolon != -1) { return contentTypeValue.substring(0, indexOfSemicolon); } else { return contentTypeValue.length() > 0 ? contentTypeVa...
HttpUtils { public static String getMimeType(String contentTypeValue) { if (contentTypeValue == null) { return null; } int indexOfSemicolon = contentTypeValue.indexOf(';'); if (indexOfSemicolon != -1) { return contentTypeValue.substring(0, indexOfSemicolon); } else { return contentTypeValue.length() > 0 ? contentTypeVa...
HttpUtils { public static String getMimeType(String contentTypeValue) { if (contentTypeValue == null) { return null; } int indexOfSemicolon = contentTypeValue.indexOf(';'); if (indexOfSemicolon != -1) { return contentTypeValue.substring(0, indexOfSemicolon); } else { return contentTypeValue.length() > 0 ? contentTypeVa...
HttpUtils { public static String getMimeType(String contentTypeValue) { if (contentTypeValue == null) { return null; } int indexOfSemicolon = contentTypeValue.indexOf(';'); if (indexOfSemicolon != -1) { return contentTypeValue.substring(0, indexOfSemicolon); } else { return contentTypeValue.length() > 0 ? contentTypeVa...
@Test public void getCliArgsSmokeTest() { RskTestContext devnetContext = new RskTestContext(new String[] { "--devnet" }); assertThat(devnetContext.getCliArgs(), notNullValue()); assertThat(devnetContext.getCliArgs().getFlags(), contains(NodeCliFlags.NETWORK_DEVNET)); }
public CliArgs<NodeCliOptions, NodeCliFlags> getCliArgs() { return cliArgs; }
RskContext implements NodeBootstrapper { public CliArgs<NodeCliOptions, NodeCliFlags> getCliArgs() { return cliArgs; } }
RskContext implements NodeBootstrapper { public CliArgs<NodeCliOptions, NodeCliFlags> getCliArgs() { return cliArgs; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); }
RskContext implements NodeBootstrapper { public CliArgs<NodeCliOptions, NodeCliFlags> getCliArgs() { return cliArgs; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); BootstrapImporter getBootstrapImporter(); @Override NodeRunner getNodeRunner(); Blockchain getBlockchain()...
RskContext implements NodeBootstrapper { public CliArgs<NodeCliOptions, NodeCliFlags> getCliArgs() { return cliArgs; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); BootstrapImporter getBootstrapImporter(); @Override NodeRunner getNodeRunner(); Blockchain getBlockchain()...
@Test public void shouldBuildSimpleTrieStore() throws IOException { Path testDatabasesDirectory = databaseDir.getRoot().toPath(); doReturn(new GarbageCollectorConfig(false, 1000, 3)).when(testProperties).garbageCollectorConfig(); doReturn(testDatabasesDirectory.toString()).when(testProperties).databaseDir(); TrieStore ...
public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); BootstrapImporte...
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); BootstrapImporte...
@Test public void shouldBuildSimpleTrieStoreCleaningUpMultiTrieStore() throws IOException, InterruptedException { Path testDatabasesDirectory = databaseDir.getRoot().toPath(); doReturn(new GarbageCollectorConfig(false, 1000, 3)).when(testProperties).garbageCollectorConfig(); doReturn(testDatabasesDirectory.toString())....
public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); BootstrapImporte...
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); BootstrapImporte...
@Test public void shouldBuildMultiTrieStore() throws IOException { long numberOfEpochs = 3; Path testDatabasesDirectory = databaseDir.getRoot().toPath(); doReturn(new GarbageCollectorConfig(true, 1000, (int) numberOfEpochs)).when(testProperties).garbageCollectorConfig(); doReturn(testDatabasesDirectory.toString()).when...
public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); BootstrapImporte...
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); BootstrapImporte...
@Test public void shouldBuildMultiTrieStoreMigratingSingleTrieStore() throws IOException { long numberOfEpochs = 3; Path testDatabasesDirectory = databaseDir.getRoot().toPath(); doReturn(new GarbageCollectorConfig(true, 1000, (int) numberOfEpochs)).when(testProperties).garbageCollectorConfig(); doReturn(testDatabasesDi...
public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); BootstrapImporte...
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); BootstrapImporte...
@Test public void shouldBuildMultiTrieStoreFromExistingDirectories() throws IOException { int numberOfEpochs = 3; Path testDatabasesDirectory = databaseDir.getRoot().toPath(); doReturn(new GarbageCollectorConfig(true, 1000, numberOfEpochs)).when(testProperties).garbageCollectorConfig(); doReturn(testDatabasesDirectory....
public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); BootstrapImporte...
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); BootstrapImporte...
@Test(expected = IllegalStateException.class) @Ignore("Permissions set fails under CircleCI") public void shouldFailIfCannotBuildMultiTrieStore() throws IOException { Path testDatabasesDirectory = Files.createTempDirectory("test", PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("---------"))); doRe...
public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); }
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); BootstrapImporte...
RskContext implements NodeBootstrapper { public TrieStore getTrieStore() { if (trieStore == null) { trieStore = buildAbstractTrieStore(Paths.get(getRskSystemProperties().databaseDir())); } return trieStore; } RskContext(String[] args); private RskContext(CliArgs<NodeCliOptions, NodeCliFlags> cliArgs); BootstrapImporte...