Skip to content

Commit

Permalink
re-apply doc and test changes from 033e3c8
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <[email protected]>
  • Loading branch information
garyschulte committed Dec 8, 2023
1 parent 240a3ac commit 1e091d6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions besu/src/main/java/org/hyperledger/besu/Runner.java
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,11 @@ Optional<EnodeURL> getLocalEnode() {
return networkRunner.getNetwork().getLocalEnode();
}

/**
* get P2PNetwork service.
*
* @return p2p network service.
*/
public P2PNetwork getP2PNetwork() {
return networkRunner.getNetwork();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ private boolean blockShouldBeProcessed(
private void appendBlockHelper(
final BlockWithReceipts blockWithReceipts, final boolean storeOnly) {

// TODO: before merging fleet-mode, re-enable this check
/*if (!blockShouldBeProcessed(blockWithReceipts.getBlock(), blockWithReceipts.getReceipts())) {
return;
}*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,10 @@ public void appendUnconnectedBlock() {
new BlockDataGenerator.BlockOptions().setBlockNumber(1L).setParentHash(Hash.ZERO);
final Block newBlock = gen.block(options);
final List<TransactionReceipt> receipts = gen.receipts(newBlock);
// TODO: before merging fleet-mode, change back to IllegalArgumentException
assertThatThrownBy(() -> blockchain.appendBlock(newBlock, receipts))
.isInstanceOf(IllegalArgumentException.class);
// .isInstanceOf(IllegalArgumentException.class);
.isInstanceOf(IllegalStateException.class);
}

@Test
Expand All @@ -264,8 +266,10 @@ public void appendBlockWithMismatchedReceipts() {
final Block newBlock = gen.block(options);
final List<TransactionReceipt> receipts = gen.receipts(newBlock);
receipts.add(gen.receipt());
// TODO: before merging fleet-mode, change back to IllegalArgumentException
assertThatThrownBy(() -> blockchain.appendBlock(newBlock, receipts))
.isInstanceOf(IllegalArgumentException.class);
// .isInstanceOf(IllegalArgumentException.class);
.isInstanceOf(IndexOutOfBoundsException.class);
}

@Test
Expand Down

0 comments on commit 1e091d6

Please sign in to comment.