diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/task/GetReceiptsFromPeerTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/task/GetReceiptsFromPeerTask.java index 802148b115..afa4fecf96 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/task/GetReceiptsFromPeerTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/task/GetReceiptsFromPeerTask.java @@ -116,7 +116,7 @@ public class GetReceiptsFromPeerTask } @Override - public boolean isPartialSuccess(final Map> result) { - return result.isEmpty(); + public boolean isSuccess(final Map> result) { + return !result.isEmpty(); } } diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/task/GetReceiptsFromPeerTaskTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/task/GetReceiptsFromPeerTaskTest.java index a06ec3a751..18c5d803e3 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/task/GetReceiptsFromPeerTaskTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/task/GetReceiptsFromPeerTaskTest.java @@ -158,22 +158,22 @@ public class GetReceiptsFromPeerTaskTest { } @Test - public void testIsPartialSuccessForPartialSuccess() { + public void testIsSuccessForPartialSuccess() { GetReceiptsFromPeerTask task = new GetReceiptsFromPeerTask(Collections.emptyList(), null, () -> null); - Assertions.assertTrue(task.isPartialSuccess(Collections.emptyMap())); + Assertions.assertFalse(task.isSuccess(Collections.emptyMap())); } @Test - public void testIsPartialSuccessForFullSuccess() { + public void testIsSuccessForFullSuccess() { GetReceiptsFromPeerTask task = new GetReceiptsFromPeerTask(Collections.emptyList(), null, () -> null); Map> map = new HashMap<>(); map.put(mockBlockHeader(1), null); - Assertions.assertFalse(task.isPartialSuccess(map)); + Assertions.assertTrue(task.isSuccess(map)); } private BlockHeader mockBlockHeader(final long blockNumber) {