Skip to content

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

lifofifoX
Copy link
Collaborator

This enables recursive retrieval of a UTXO blockhash, allowing to determine how long an inscription has been held or when it was burned.

@samedcildir
Copy link
Contributor

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

Copy link
Collaborator

@raphjaph raphjaph left a 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

@lifofifoX lifofifoX requested a review from raphjaph March 25, 2025 03:54
@raphjaph
Copy link
Collaborator

Could you add a test for this?

Copy link
Collaborator

@casey casey left a 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(),
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@lifofifoX
Copy link
Collaborator Author

@raphjaph I updated the existing test to add coverage for this. Do you think this needs its own test?

@lifofifoX lifofifoX requested a review from casey May 17, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants