-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backport: Insert inclusion height to early unbonding event #230
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -188,8 +188,10 @@ func (k Keeper) ProcessAllPowerDistUpdateEvents( | |
activeBTCDels[fpBTCPKHex] = append(activeBTCDels[fpBTCPKHex], btcDel) | ||
} | ||
} else if delEvent.NewState == types.BTCDelegationStatus_UNBONDED { | ||
// emit event about this unbonded BTC delegation | ||
types.EmitUnbondedBTCDelEvent(sdkCtx, delEvent.StakingTxHash, btcDel.IsUnbondedEarly()) | ||
// emit expired event if it is not early unbonding | ||
if !btcDel.IsUnbondedEarly() { | ||
types.EmitExpiredDelegationEvent(sdkCtx, delEvent.StakingTxHash) | ||
} | ||
Comment on lines
+192
to
+194
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if it's an early unbond? No event emitted? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is now emitted during processing undelegate message https://github.com/babylonlabs-io/babylon/pull/228/files#diff-0490899e13cee0223ce9b01147d9ad2753112c4e8118443e1b54684738fc4969R585. The reason we changed the emitting there is because we don't want to save the inclusion height in db considering re-org could happen on Bitcoin. Discussions |
||
// add the unbonded BTC delegation to the map | ||
unbondedBTCDels[delEvent.StakingTxHash] = struct{}{} | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this not a uint32 or uint64? Just curious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for easier parsing for subscribers of the event