method2testcases stringlengths 118 3.08k |
|---|
### Question:
ListArrayUtil { public static int getLength(@Nullable byte[] array) { if (array == null) { return 0; } return array.length; } private ListArrayUtil(); static List<Byte> asByteList(byte[] primitiveByteArray); static boolean isEmpty(@Nullable byte[] array); static int getLength(@Nullable byte[] array); sta... |
### Question:
Topic { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } Topic otherTopic = (Topic) other; return Arrays.equals(bytes, otherTopic.bytes); } Topic(String topic); Topic(byte[] bytes); byte[] getBy... |
### Question:
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.groupCou... |
### Question:
PendingTransactionFilter extends Filter { @Override public void newPendingTx(Transaction tx) { add(new PendingTransactionFilterEvent(tx)); } @Override void newPendingTx(Transaction tx); }### Answer:
@Test public void oneTransactionAndEvents() { PendingTransactionFilter filter = new PendingTransactionFil... |
### Question:
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(... |
### Question:
FormatUtils { public static String formatNanosecondsToSeconds(long nanoseconds) { return String.format("%.6f", nanoseconds / 1_000_000_000.0); } private FormatUtils(); static String formatNanosecondsToSeconds(long nanoseconds); }### Answer:
@Test public void formatNanosecondsToSeconds() { Assert.assertE... |
### Question:
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 (Inter... |
### Question:
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,
... |
### Question:
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; } BlockDif... |
### Question:
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 m... |
### Question:
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... |
### Question:
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; } Bloc... |
### Question:
RepositoryLocator { public RepositorySnapshot snapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header) .map(MutableRepository::new) .orElseThrow(() -> trieNotFoundException(header)); } RepositoryLocator(TrieStore store, StateRootHandler stateRootHandler); Optional<RepositorySnapshot> findSnap... |
### Question:
RepositoryLocator { public Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header) { return mutableTrieSnapshotAt(header).map(MutableRepository::new); } RepositoryLocator(TrieStore store, StateRootHandler stateRootHandler); Optional<RepositorySnapshot> findSnapshotAt(BlockHeader header); Repositor... |
### Question:
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... |
### Question:
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 indi... |
### Question:
BootstrapImporter { public void importData() { bootstrapDataProvider.retrieveData(); updateDatabase(); } BootstrapImporter(
BlockStore blockStore,
TrieStore trieStore,
BlockFactory blockFactory, BootstrapDataProvider bootstrapDataProvider); void importData(); }### Answ... |
### Question:
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); } } BootstrapURLProv... |
### Question:
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 ... |
### Question:
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 getM... |
### Question:
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); @O... |
### Question:
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 getMinNum... |
### Question:
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) { maxNu... |
### Question:
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.B... |
### Question:
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> g... |
### Question:
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 ?... |
### Question:
BlocksBloomStore { public void setBlocksBloom(BlocksBloom blocksBloom) { this.blocksBloom.put(blocksBloom.fromBlock(), blocksBloom); if (this.dataSource != null) { this.dataSource.put(longToKey(blocksBloom.fromBlock()), BlocksBloomEncoder.encode(blocksBloom)); } } BlocksBloomStore(int noBlocks, int noConf... |
### Question:
BlocksBloom { public void addBlockBloom(long blockNumber, Bloom blockBloom) { if (this.empty) { this.fromBlock = blockNumber; this.toBlock = blockNumber; this.empty = false; } else if (blockNumber == toBlock + 1) { this.toBlock = blockNumber; } else { throw new UnsupportedOperationException("Block out of ... |
### Question:
BlocksBloom { public boolean matches(Bloom bloom) { return this.bloom.matches(bloom); } BlocksBloom(); BlocksBloom(long fromBlock, long toBlock, Bloom bloom); Bloom getBloom(); long fromBlock(); long toBlock(); long size(); void addBlockBloom(long blockNumber, Bloom blockBloom); boolean matches(Bloom blo... |
### Question:
NewBlockFilter extends Filter { @Override public void newBlockReceived(Block b) { add(new NewBlockFilterEvent(b)); } @Override void newBlockReceived(Block b); }### Answer:
@Test public void oneBlockAndEvent() { NewBlockFilter filter = new NewBlockFilter(); Block block = new BlockGenerator().getBlock(1);... |
### Question:
NetBlockStore { public synchronized Block getBlockByHash(byte[] hash) { return this.blocks.get(new Keccak256(hash)); } synchronized void saveBlock(Block block); synchronized void removeBlock(Block block); synchronized Block getBlockByHash(byte[] hash); synchronized List<Block> getBlocksByNumber(long numb... |
### Question:
NetBlockStore { public synchronized void releaseRange(long from, long to) { for (long k = from; k <= to; k++) { for (Block b : this.getBlocksByNumber(k)) { this.removeBlock(b); } } } synchronized void saveBlock(Block block); synchronized void removeBlock(Block block); synchronized Block getBlockByHash(by... |
### Question:
NetBlockStore { public synchronized void saveHeader(@Nonnull final BlockHeader header) { this.headers.put(header.getHash(), header); } synchronized void saveBlock(Block block); synchronized void removeBlock(Block block); synchronized Block getBlockByHash(byte[] hash); synchronized List<Block> getBlocksBy... |
### Question:
NetBlockStore { public synchronized void removeHeader(@Nonnull final BlockHeader header) { if (!this.hasHeader(header.getHash())) { return; } this.headers.remove(header.getHash()); } synchronized void saveBlock(Block block); synchronized void removeBlock(Block block); synchronized Block getBlockByHash(by... |
### Question:
NodeDistanceTable { public synchronized List<Node> getClosestNodes(NodeID nodeId) { return getAllNodes().stream() .sorted(new NodeDistanceComparator(nodeId, this.distanceCalculator)) .collect(Collectors.toList()); } NodeDistanceTable(int numberOfBuckets, int entriesPerBucket, Node localNode); synchronized... |
### Question:
NodeDistanceTable { public synchronized OperationResult addNode(Node node) { return getNodeBucket(node).addNode(node); } NodeDistanceTable(int numberOfBuckets, int entriesPerBucket, Node localNode); synchronized OperationResult addNode(Node node); synchronized OperationResult removeNode(Node node); synchr... |
### Question:
DistanceCalculator { public int calculateDistance(NodeID node1, NodeID node2) { byte[] nodeId1 = HashUtil.keccak256(HashUtil.keccak256(node1.getID())); byte[] nodeId2 = HashUtil.keccak256(HashUtil.keccak256(node2.getID())); byte[] result = new byte[nodeId1.length]; for (int i = 0; i < result.length; i++) ... |
### Question:
UDPChannel extends SimpleChannelInboundHandler<DiscoveryEvent> { @Override public void channelRead0(ChannelHandlerContext ctx, DiscoveryEvent event) throws Exception { this.peerExplorer.handleMessage(event); } UDPChannel(Channel ch, PeerExplorer peerExplorer); @Override void channelRead0(ChannelHandlerCon... |
### Question:
UDPChannel extends SimpleChannelInboundHandler<DiscoveryEvent> { public void write(DiscoveryEvent discoveryEvent) { InetSocketAddress address = discoveryEvent.getAddress(); sendPacket(discoveryEvent.getMessage().getPacket(), address); } UDPChannel(Channel ch, PeerExplorer peerExplorer); @Override void cha... |
### Question:
UDPChannel extends SimpleChannelInboundHandler<DiscoveryEvent> { @Override public void channelActive(ChannelHandlerContext ctx) throws Exception { peerExplorer.start(); } UDPChannel(Channel ch, PeerExplorer peerExplorer); @Override void channelRead0(ChannelHandlerContext ctx, DiscoveryEvent event); void w... |
### Question:
UDPServer implements InternalService { @Override public void start() { if (port == 0) { logger.error("Discovery can't be started while listen port == 0"); } else { new Thread("UDPServer") { @Override public void run() { try { UDPServer.this.startUDPServer(); } catch (Exception e) { logger.error("Discovery... |
### Question:
PeerDiscoveryRequest { public boolean validateMessageResponse(InetSocketAddress responseAddress, PeerDiscoveryMessage message) { return this.expectedResponse == message.getMessageType() && !this.hasExpired() && getAddress().equals(responseAddress); } PeerDiscoveryRequest(String messageId, PeerDiscoveryMes... |
### Question:
StatusMessage extends Message { @Override public void accept(MessageVisitor v) { v.apply(this); } StatusMessage(Status status); @Override MessageType getMessageType(); @Override byte[] getEncodedMessage(); Status getStatus(); @Override void accept(MessageVisitor v); }### Answer:
@Test public void accept(... |
### Question:
BlockResponseMessage extends MessageWithId { @Override public void accept(MessageVisitor v) { v.apply(this); } BlockResponseMessage(long id, Block block); long getId(); Block getBlock(); @Override MessageType getMessageType(); @Override byte[] getEncodedMessageWithoutId(); @Override void accept(MessageVis... |
### Question:
BlockRequestMessage extends MessageWithId { @Override public void accept(MessageVisitor v) { v.apply(this); } BlockRequestMessage(long id, byte[] hash); long getId(); byte[] getBlockHash(); @Override MessageType getMessageType(); @Override MessageType getResponseMessageType(); @Override byte[] getEncodedM... |
### Question:
BodyRequestMessage extends MessageWithId { @Override public void accept(MessageVisitor v) { v.apply(this); } BodyRequestMessage(long id, byte[] hash); long getId(); byte[] getBlockHash(); @Override MessageType getMessageType(); @Override MessageType getResponseMessageType(); @Override byte[] getEncodedMes... |
### Question:
BlockHashRequestMessage extends MessageWithId { @Override public void accept(MessageVisitor v) { v.apply(this); } BlockHashRequestMessage(long id, long height); @Override MessageType getMessageType(); @Override MessageType getResponseMessageType(); @Override byte[] getEncodedMessageWithoutId(); long getId... |
### Question:
BlockHeadersResponseMessage extends MessageWithId { @Override public void accept(MessageVisitor v) { v.apply(this); } BlockHeadersResponseMessage(long id, List<BlockHeader> headers); @Override long getId(); List<BlockHeader> getBlockHeaders(); @Override MessageType getMessageType(); @Override void accept(... |
### Question:
BlockHeadersRequestMessage extends MessageWithId { @Override public void accept(MessageVisitor v) { v.apply(this); } BlockHeadersRequestMessage(long id, byte[] hash, int count); long getId(); byte[] getHash(); int getCount(); @Override byte[] getEncodedMessageWithoutId(); @Override MessageType getMessageT... |
### Question:
SkeletonResponseMessage extends MessageWithId { @Override public void accept(MessageVisitor v) { v.apply(this); } SkeletonResponseMessage(long id, List<BlockIdentifier> blockIdentifiers); @Override MessageType getMessageType(); @Override byte[] getEncodedMessageWithoutId(); long getId(); List<BlockIdentif... |
### Question:
BodyResponseMessage extends MessageWithId { @Override public void accept(MessageVisitor v) { v.apply(this); } BodyResponseMessage(long id, List<Transaction> transactions, List<BlockHeader> uncles); @Override long getId(); List<Transaction> getTransactions(); List<BlockHeader> getUncles(); @Override Messag... |
### Question:
SkeletonRequestMessage extends MessageWithId { @Override public void accept(MessageVisitor v) { v.apply(this); } SkeletonRequestMessage(long id, long startNumber); @Override MessageType getMessageType(); @Override MessageType getResponseMessageType(); @Override byte[] getEncodedMessageWithoutId(); long ge... |
### Question:
BlockHashResponseMessage extends MessageWithId { @Override public void accept(MessageVisitor v) { v.apply(this); } BlockHashResponseMessage(long id, byte[] hash); @Override MessageType getMessageType(); @Override byte[] getEncodedMessageWithoutId(); long getId(); byte[] getHash(); @Override void accept(Me... |
### Question:
TransactionsMessage extends Message { @Override public MessageType getMessageType() { return MessageType.TRANSACTIONS; } TransactionsMessage(List<Transaction> transactions); List<Transaction> getTransactions(); @Override MessageType getMessageType(); @Override byte[] getEncodedMessage(); String getMessage... |
### Question:
TransactionsMessage extends Message { public List<Transaction> getTransactions() { return this.transactions; } TransactionsMessage(List<Transaction> transactions); List<Transaction> getTransactions(); @Override MessageType getMessageType(); @Override byte[] getEncodedMessage(); String getMessageContentInf... |
### Question:
TransactionsMessage extends Message { @Override public void accept(MessageVisitor v) { v.apply(this); } TransactionsMessage(List<Transaction> transactions); List<Transaction> getTransactions(); @Override MessageType getMessageType(); @Override byte[] getEncodedMessage(); String getMessageContentInfo(); @O... |
### Question:
GetBlockMessage extends Message { @Override public void accept(MessageVisitor v) { v.apply(this); } GetBlockMessage(byte[] hash); @Override MessageType getMessageType(); @Override byte[] getEncodedMessage(); byte[] getBlockHash(); @Override void accept(MessageVisitor v); }### Answer:
@Test public void ac... |
### Question:
BlockMessage extends Message { @Override public MessageType getMessageType() { return MessageType.BLOCK_MESSAGE; } BlockMessage(Block block); Block getBlock(); @Override MessageType getMessageType(); @Override byte[] getEncodedMessage(); @Override void accept(MessageVisitor v); }### Answer:
@Test public ... |
### Question:
BlockMessage extends Message { public Block getBlock() { return this.block; } BlockMessage(Block block); Block getBlock(); @Override MessageType getMessageType(); @Override byte[] getEncodedMessage(); @Override void accept(MessageVisitor v); }### Answer:
@Test public void getBlock() { Block block = mock(... |
### Question:
BlockMessage extends Message { @Override public void accept(MessageVisitor v) { v.apply(this); } BlockMessage(Block block); Block getBlock(); @Override MessageType getMessageType(); @Override byte[] getEncodedMessage(); @Override void accept(MessageVisitor v); }### Answer:
@Test public void accept() { Bl... |
### Question:
CallArgumentsToByteArray { public byte[] getData() { byte[] data = null; if (args.data != null && args.data.length() != 0) { data = stringHexToByteArray(args.data); } return data; } CallArgumentsToByteArray(Web3.CallArguments args); byte[] getGasPrice(); byte[] getGasLimit(); byte[] getToAddress(); byte[]... |
### Question:
ECKey { public boolean isPubKeyOnly() { return priv == null; } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static ECPoint decompressPoint(ECPoint compressed); static ECKey fromPrivate(BigInteger privKey); s... |
### Question:
BlockCache { public Block getBlockByHash(byte[] hash) { return blockMap.get(new Keccak256(hash)); } BlockCache(int cacheSize); void removeBlock(Block block); void addBlock(Block block); Block getBlockByHash(byte[] hash); }### Answer:
@Test public void getUnknownBlockAsNull() { BlockCache store = getSubje... |
### Question:
TxValidatorNotRemascTxValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (!(tx instanceof RemascTransaction)) { return Transaction... |
### Question:
TxValidatorAccountStateValidator implements TxValidatorStep { @Override public TransactionValidationResult validate(Transaction tx, @Nullable AccountState state, BigInteger gasLimit, Coin minimumGasPrice, long bestBlockNumber, boolean isFreeTx) { if (isFreeTx) { return TransactionValidationResult.ok(); } ... |
### Question:
TxsPerAccount { public List<Transaction> getTransactions(){ return txs; } List<Transaction> getTransactions(); void setTransactions(List<Transaction> txs); @VisibleForTesting BigInteger getNextNonce(); }### Answer:
@Test public void containsNoTransactions() { TxsPerAccount txspa = new TxsPerAccount(); A... |
### Question:
TxsPerAccount { @VisibleForTesting public BigInteger getNextNonce() { return this.nextNonce; } List<Transaction> getTransactions(); void setTransactions(List<Transaction> txs); @VisibleForTesting BigInteger getNextNonce(); }### Answer:
@Test public void nextNonceIsNull() { TxsPerAccount txspa = new TxsP... |
### Question:
TxsPerAccount { boolean containsNonce(BigInteger nonce) { for (Transaction tx : txs) { if (new BigInteger(1, tx.getNonce()).equals(nonce)) { return true; } } return false; } List<Transaction> getTransactions(); void setTransactions(List<Transaction> txs); @VisibleForTesting BigInteger getNextNonce(); }#... |
### Question:
NodeMessageHandler implements MessageHandler, InternalService, Runnable { @Override public void postMessage(Peer sender, Message message) { logger.trace("Start post message (queue size {}) (message type {})", this.queue.size(), message.getMessageType()); cleanExpiredMessages(); tryAddMessage(sender, messa... |
### Question:
DownloadingBackwardsHeadersSyncState extends BaseSyncState { @Override public void onEnter() { Keccak256 hashToRequest = child.getHash(); ChunkDescriptor chunkDescriptor = new ChunkDescriptor( hashToRequest.getBytes(), syncConfiguration.getChunkSize()); syncEventsHandler.sendBlockHeadersRequest(selectedPe... |
### Question:
DownloadingBackwardsHeadersSyncState extends BaseSyncState { @Override public void newBlockHeaders(List<BlockHeader> toRequest) { syncEventsHandler.backwardDownloadBodies( child, toRequest.stream().skip(1).collect(Collectors.toList()), selectedPeer ); } DownloadingBackwardsHeadersSyncState(
Sy... |
### Question:
BlockNodeInformation { @Nonnull public synchronized Set<NodeID> getNodesByBlock(@Nonnull final Keccak256 blockHash) { Set<NodeID> result = nodesByBlock.get(blockHash); if (result == null) { result = new HashSet<>(); } return new HashSet<>(result); } BlockNodeInformation(final int maxBlocks); BlockNodeInf... |
### Question:
ABICallElection { public Map<ABICallSpec, List<RskAddress>> getVotes() { return votes; } ABICallElection(AddressBasedAuthorizer authorizer, Map<ABICallSpec, List<RskAddress>> votes); ABICallElection(AddressBasedAuthorizer authorizer); Map<ABICallSpec, List<RskAddress>> getVotes(); void clear(); boolean v... |
### Question:
ABICallElection { public void clear() { this.votes = new HashMap<>(); } ABICallElection(AddressBasedAuthorizer authorizer, Map<ABICallSpec, List<RskAddress>> votes); ABICallElection(AddressBasedAuthorizer authorizer); Map<ABICallSpec, List<RskAddress>> getVotes(); void clear(); boolean vote(ABICallSpec c... |
### Question:
ABICallSpec { public String getFunction() { return function; } ABICallSpec(String function, byte[][] arguments); String getFunction(); byte[][] getArguments(); byte[] getEncoded(); @Override String toString(); @Override boolean equals(Object other); @Override int hashCode(); static final Comparator<ABICal... |
### Question:
ABICallSpec { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } ABICallSpec otherSpec = ((ABICallSpec) other); return otherSpec.getFunction().equals(getFunction()) && areEqual(arguments, otherSpec... |
### Question:
PendingFederation { public List<FederationMember> getMembers() { return members; } PendingFederation(List<FederationMember> members); List<FederationMember> getMembers(); List<BtcECKey> getBtcPublicKeys(); boolean isComplete(); PendingFederation addMember(FederationMember member); Federation buildFederati... |
### Question:
PendingFederation { public boolean isComplete() { return this.members.size() >= MIN_MEMBERS_REQUIRED; } PendingFederation(List<FederationMember> members); List<FederationMember> getMembers(); List<BtcECKey> getBtcPublicKeys(); boolean isComplete(); PendingFederation addMember(FederationMember member); Fed... |
### Question:
PendingFederation { @Override public String toString() { return String.format("%d signatures pending federation (%s)", members.size(), isComplete() ? "complete" : "incomplete"); } PendingFederation(List<FederationMember> members); List<FederationMember> getMembers(); List<BtcECKey> getBtcPublicKeys(); boo... |
### Question:
ECKey { @Nullable public byte[] getPrivKeyBytes() { return bigIntegerToBytes(priv, 32); } ECKey(); ECKey(SecureRandom secureRandom); ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static ECPoint decompressPoint(ECPoint compressed); static ECKey fromPri... |
### Question:
PendingFederation { public Keccak256 getHash() { byte[] encoded = BridgeSerializationUtils.serializePendingFederationOnlyBtcKeys(this); return new Keccak256(HashUtil.keccak256(encoded)); } PendingFederation(List<FederationMember> members); List<FederationMember> getMembers(); List<BtcECKey> getBtcPublicKe... |
### Question:
AddressBasedAuthorizer { public boolean isAuthorized(RskAddress sender) { return authorizedAddresses.stream() .anyMatch(address -> Arrays.equals(address, sender.getBytes())); } AddressBasedAuthorizer(List<ECKey> authorizedKeys, MinimumRequiredCalculation requiredCalculation); boolean isAuthorized(RskAddre... |
### Question:
TransportAsync implements Transport { public synchronized void handleConnected() { if (!this.state) { this.state = true; fireEvent(true, this.listener); } } TransportAsync(final Executor executor); synchronized void handleConnected(); synchronized void handleDisconnected(); @Override void state(final Cons... |
### Question:
Topic { public Stream<String> stream() { return segments.stream(); } private Topic(final List<String> segments); List<String> getSegments(); Stream<String> stream(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); static Topic split(String path); static Topic ... |
### Question:
Payload { public static Payload of(final String key, final Object value) { Objects.requireNonNull(key); return new Payload(now(), singletonMap(key, value), false); } private Payload(final Instant timestamp, final Map<String, ?> values, final boolean cloneValues); Instant getTimestamp(); Map<String, ?> ge... |
### Question:
Errors { public static ErrorHandler<RuntimeException> ignore() { return IGNORE; } private Errors(); static ErrorHandler<RuntimeException> ignore(); static ErrorHandler<RuntimeException> handle(final BiConsumer<Throwable, Optional<Payload>> handler); static void ignore(final Throwable e, final Optional<Pa... |
### Question:
Errors { public static ErrorHandler<RuntimeException> handle(final BiConsumer<Throwable, Optional<Payload>> handler) { return new ErrorHandler<RuntimeException>() { @Override public void handleError(final Throwable e, final Optional<Payload> payload) throws RuntimeException { handler.accept(e, payload); }... |
### Question:
JksServerConfigurator implements HttpServerConfigurator { private int getPort(ServerConfiguration configuration) { return configuration.getInteger(ConfigKies.HTTPS_PORT, ConfigKies.DEFAULT_HTTPS_PORT); } @Override void configureHttpServer(VertxContext context, HttpServerOptions options); }### Answer:
@T... |
### Question:
MessageSourceServiceDiscovery { public <T> void getConsumer(Function<Record, Boolean> filter, Handler<AsyncResult<MessageConsumer<T>>> handler) { MessageSource.getConsumer(serviceDiscovery, filter, handler); } MessageSourceServiceDiscovery(ServiceDiscovery serviceDiscovery); void publish(MessageSourceConf... |
### Question:
RedisServiceDiscovery { public void getClient(Function<Record, Boolean> filter, Handler<AsyncResult<RedisClient>> handler) { RedisDataSource.getRedisClient(serviceDiscovery, filter, handler); } RedisServiceDiscovery(ServiceDiscovery serviceDiscovery); void publish(DataSourceServiceConfiguration configurat... |
### Question:
EventBusServiceDiscovery { public <T> void getProxy(Class<T> serviceClass, Handler<AsyncResult<T>> handler) { EventBusService.getProxy(serviceDiscovery, serviceClass, handler); } EventBusServiceDiscovery(ServiceDiscovery serviceDiscovery); void publish(EventBusServiceConfiguration configuration, Handler<A... |
### Question:
EventBusServiceDiscovery { public <T> void getServiceProxy(Function<Record, Boolean> filter, Class<T> serviceClass, Handler<AsyncResult<T>> handler) { EventBusService.getServiceProxy(serviceDiscovery, filter, serviceClass, handler); } EventBusServiceDiscovery(ServiceDiscovery serviceDiscovery); void publi... |
### Question:
JDBCServiceDiscovery { public void getClient(Function<Record, Boolean> filter, Handler<AsyncResult<JDBCClient>> handler) { JDBCDataSource.getJDBCClient(serviceDiscovery, filter, handler); } JDBCServiceDiscovery(ServiceDiscovery serviceDiscovery); void publish(DataSourceServiceConfiguration configuration, ... |
### Question:
MongoServiceDiscovery { public void getClient(Function<Record, Boolean> filter, Handler<AsyncResult<MongoClient>> handler) { MongoDataSource.getMongoClient(serviceDiscovery, filter, handler); } MongoServiceDiscovery(ServiceDiscovery serviceDiscovery); void publish(DataSourceServiceConfiguration configurat... |
### Question:
VertxServiceDiscovery { public void publishRecord(Record record, Handler<AsyncResult<Record>> handler) { serviceDiscovery.publish(record, handler); } VertxServiceDiscovery(Vertx vertx); ServiceDiscovery serviceDiscovery(); HttpServiceDiscovery http(); EventBusServiceDiscovery eventBus(); MessageSourceServ... |
### Question:
JksServerConfigurator implements HttpServerConfigurator { private String getPath(ServerConfiguration configuration) { return configuration.getString(ConfigKies.SSL_JKS_PATH); } @Override void configureHttpServer(VertxContext context, HttpServerOptions options); }### Answer:
@Test public void givenSslEna... |
### Question:
VertxServiceDiscovery { public void lookupIncludeOutOfService(Function<Record, Boolean> filter, Handler<AsyncResult<Record>> handler) { lookup(filter, true, handler); } VertxServiceDiscovery(Vertx vertx); ServiceDiscovery serviceDiscovery(); HttpServiceDiscovery http(); EventBusServiceDiscovery eventBus()... |
### Question:
VertxServiceDiscovery { public void lookupByJson(JsonObject jsonFilter, Handler<AsyncResult<Record>> handler) { serviceDiscovery.getRecord(jsonFilter, handler); } VertxServiceDiscovery(Vertx vertx); ServiceDiscovery serviceDiscovery(); HttpServiceDiscovery http(); EventBusServiceDiscovery eventBus(); Mess... |
### Question:
VertxServiceDiscovery { public void lookupAllIncludeOutOfService(Function<Record, Boolean> filter, Handler<AsyncResult<List<Record>>> handler) { lookupAll(filter, true, handler); } VertxServiceDiscovery(Vertx vertx); ServiceDiscovery serviceDiscovery(); HttpServiceDiscovery http(); EventBusServiceDiscover... |
### Question:
VertxServiceDiscovery { public void lookupAllByJson(JsonObject jsonFilter, Handler<AsyncResult<List<Record>>> handler) { serviceDiscovery.getRecords(jsonFilter, handler); } VertxServiceDiscovery(Vertx vertx); ServiceDiscovery serviceDiscovery(); HttpServiceDiscovery http(); EventBusServiceDiscovery eventB... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.