Skip to content

Commit 42f0c64

Browse files
committed
style(event): address PR tronprotocol#6294 review nits and assert parentHash
- Remove double blank line before parentHash field in BlockLogTrigger - Remove trailing blank line inside toString() body - Add testParentHashPopulated to verify capsule constructor sets parentHash
1 parent 5084784 commit 42f0c64

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎common/src/main/java/org/tron/common/logsfilter/trigger/BlockLogTrigger.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public class BlockLogTrigger extends Trigger {
2727
@Setter
2828
private List<String> transactionList = new ArrayList<>();
2929

30-
3130
@Getter
3231
@Setter
3332
private String parentHash;
@@ -54,6 +53,5 @@ public String toString() {
5453
.append(", parentHash: ")
5554
.append(parentHash)
5655
.toString();
57-
5856
}
5957
}

‎framework/src/test/java/org/tron/common/logsfilter/capsule/BlockLogTriggerCapsuleTest.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,10 @@ public void testSetLatestSolidifiedBlockNumber() {
3232
Assert.assertEquals(100,
3333
blockLogTriggerCapsule.getBlockLogTrigger().getLatestSolidifiedBlockNumber());
3434
}
35+
36+
@Test
37+
public void testParentHashPopulated() {
38+
Assert.assertEquals(Sha256Hash.ZERO_HASH.toString(),
39+
blockLogTriggerCapsule.getBlockLogTrigger().getParentHash());
40+
}
3541
}

0 commit comments

Comments
 (0)