-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Include blockhash in /r/utxo response #4259
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
base: master
Are you sure you want to change the base?
Conversation
This would be a great addition since with this we can also determine the remaining locktime of the assets locked with the methods in #4256 |
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.
I like it, just some small things
Make `blockhash` a required field for `UtxoRecursive` struct
Could you add a test for this? |
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.
See comments.
src/index.rs
Outdated
Ok(Some(api::UtxoRecursive { | ||
inscriptions: self.get_inscriptions_for_output(outpoint)?, | ||
runes: self.get_rune_balances_for_output(outpoint)?, | ||
sat_ranges: self.list(outpoint)?, | ||
value: utxo_entry.value().parse(self).total_value(), | ||
blockhash: tx_info.blockhash.unwrap(), |
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.
Under what circumstances will this unwrap panic?
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 should never panic because this only gets called if there's an entry present in OUTPOINT_TO_UTXO_ENTRY
.
@raphjaph I updated the existing test to add coverage for this. Do you think this needs its own test? |
This enables recursive retrieval of a UTXO blockhash, allowing to determine how long an inscription has been held or when it was burned.