-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: handle withdrawn status #43
Conversation
9c91b76
to
e0901dd
Compare
@@ -81,7 +78,7 @@ func (s *Service) sendUnbondingDelegationEvent(ctx context.Context, delegation * | |||
uint64(delegation.StartHeight), | |||
uint64(delegation.EndHeight), | |||
delegation.UnbondingTx, | |||
delegation.UnbondingTime, | |||
"", |
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.
Could you remind me the value of this unbondingTime
? is it the timelock or the final height in which the unbonding tx timelock will expire?
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.
unbondingTime
is basically the unbonding timelock (if the staker does early unbonding)
the indexer is not pushing correct data to the api queues (there is some empty strings or dummy stuff) this needs fixing once schema is finalized
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.
it's good you reminded, logged an issue about the queue schema
#45
// Get delegation details | ||
delegation, err := s.getDelegationDetails(ctx, unbondedEarlyEvent.StakingTxHash) | ||
if err != nil { | ||
return err |
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.
Nit: It might be worth adding a log or appending error messages to make it easier to locate the issue when an error is thrown. The same applies to the other instances of return err in the code.
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.
good point, this have to improved in lot of places.
can work on it in a separate pr, logged a ticket for now #46
Fixes - #8
This pr subscribes to spend notifications of staking tx or unbonding tx then performs checks to identify if the spending tx is a withdrawal tx and marks the status as "Withdrawn".
The handling of spend notification is taken from phase 1 indexer code ref