Skip to content

Commit cde47df

Browse files
committed
feat: add parent hash in the block event
1 parent 2cc57bd commit cde47df

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

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

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

30+
31+
@Getter
32+
@Setter
33+
private String parentHash;
34+
3035
public BlockLogTrigger() {
3136
setTriggerName(Trigger.BLOCK_TRIGGER_NAME);
3237
}
@@ -45,6 +50,10 @@ public String toString() {
4550
.append(", latestSolidifiedBlockNumber: ")
4651
.append(latestSolidifiedBlockNumber)
4752
.append(", transactionList: ")
48-
.append(transactionList).toString();
53+
.append(transactionList)
54+
.append(", parentHash: ")
55+
.append(parentHash)
56+
.toString();
57+
4958
}
5059
}

framework/src/main/java/org/tron/common/logsfilter/capsule/BlockLogTriggerCapsule.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public BlockLogTriggerCapsule(BlockCapsule block) {
2121
block.getTransactions().forEach(trx ->
2222
blockLogTrigger.getTransactionList().add(trx.getTransactionId().toString())
2323
);
24+
blockLogTrigger.setParentHash(block.getParentHash().toString());
2425
}
2526

2627
public void setLatestSolidifiedBlockNumber(long latestSolidifiedBlockNumber) {

0 commit comments

Comments
 (0)