Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [ "Ash Manning <ash@layertwolabs.com>" ]
edition = "2024"
license = "MIT"
publish = false
version = "0.20.0"
version = "0.21.0-alpha"

[workspace.dependencies]
addr = "0.15.6"
Expand Down
29 changes: 18 additions & 11 deletions app/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,24 +579,31 @@ impl App {
Ok((outpoint, Some(height)))
})
.collect::<Result<_, node::Error>>()?;
let inpoints_to_block_heights: HashMap<_, _> =
bitname_stxos.values()
.map(|spent_output| {
let inpoints_to_block_heights: HashMap<_, _> = bitname_stxos
.values()
.map(|spent_output| {
let txid = match spent_output.inpoint {
InPoint::Regular { txid, vin:_ } => txid,
_ => panic!(
"Impossible: bitname inpoint can only refer to regular tx"
)
InPoint::Regular { txid, vin: _ }
| InPoint::BatchIcann { txid } => txid,
InPoint::Withdrawal { .. } => panic!(
"Impossible: bitname inpoint cannot refer to withdrawal"
),
};
let inclusions = self.node.get_tx_inclusions(txid)?;
let Some(block_hash) = inclusions.into_keys().map(Ok).transpose_into_fallible().find(|block_hash| {
self.node.is_descendant(*block_hash, tip)
})? else {
let Some(block_hash) = inclusions
.into_keys()
.map(Ok)
.transpose_into_fallible()
.find(|block_hash| {
self.node.is_descendant(*block_hash, tip)
})?
else {
return Ok((spent_output.inpoint, None));
};
let height = self.node.get_height(block_hash)?;
Ok((spent_output.inpoint, Some(height)))
}).collect::<Result<_, node::Error>>()?;
})
.collect::<Result<_, node::Error>>()?;
/* associate to each address, a set of pairs of bitname data and
ownership period for the bitname. */
let mut addrs_to_bitnames_ownership: HashMap<_, HashSet<_>> =
Expand Down
1 change: 1 addition & 0 deletions integration_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jsonrpsee = { workspace = true }
libtest-mimic = { workspace = true }
plain_bitnames = { path = "../lib", features = ["clap"] }
plain_bitnames_app_rpc_api = { path = "../rpc-api" }
rand = { workspace = true, features = ["thread_rng"] }
rcgen = { workspace = true }
reserve-port = { workspace = true }
thiserror = { workspace = true }
Expand Down
Loading
Loading