Skip to content

Commit

Permalink
Release 0.0.6 (#710)
Browse files Browse the repository at this point in the history
- Bump version: 0.0.5 → 0.0.6
- Update dependencies
- Fix lints
  • Loading branch information
casey authored Oct 25, 2022
1 parent 7f82147 commit e9a6659
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 22 deletions.
15 changes: 8 additions & 7 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ord"
description = "Bitcoin satoshi ordinal number utility"
version = "0.0.5"
version = "0.0.6"
license = "CC0-1.0"
edition = "2021"
autotests = false
Expand Down Expand Up @@ -34,7 +34,7 @@ log = "0.4.14"
mime = "0.3.16"
mime_guess = "2.0.4"
rayon = "1.5.1"
redb = "0.7.0"
redb = "0.8.0"
regex = "1.6.0"
reqwest = { version = "0.11.10", features = ["blocking"] }
rust-embed = "6.4.0"
Expand Down
19 changes: 6 additions & 13 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,10 @@ impl Index {

let height_to_block_hash = rtx.0.open_table(HEIGHT_TO_BLOCK_HASH)?;

let mut cursor = height_to_block_hash
for next in height_to_block_hash
.range(height.saturating_sub(take.saturating_sub(1))..=height)?
.rev();

while let Some(next) = cursor.next() {
.rev()
{
blocks.push((next.0, BlockHash::from_slice(next.1)?));
}

Expand All @@ -481,10 +480,8 @@ impl Index {

let table = rtx.open_multimap_table(ORDINAL_TO_RUNE_HASHES)?;

let mut values = table.get(&ordinal.0)?;

let mut inscriptions = Vec::new();
while let Some(value) = values.next() {
for value in table.get(&ordinal.0)? {
inscriptions.push(sha256::Hash::from_inner(*value));
}

Expand All @@ -498,9 +495,7 @@ impl Index {

let ordinal_to_satpoint = rtx.open_table(ORDINAL_TO_SATPOINT)?;

let mut cursor = ordinal_to_satpoint.range(0..)?;

while let Some((ordinal, satpoint)) = cursor.next() {
for (ordinal, satpoint) in ordinal_to_satpoint.range(0..)? {
result.push((Ordinal(ordinal), deserialize(satpoint)?));
}

Expand Down Expand Up @@ -656,9 +651,7 @@ impl Index {

let outpoint_to_ordinal_ranges = rtx.open_table(OUTPOINT_TO_ORDINAL_RANGES)?;

let mut cursor = outpoint_to_ordinal_ranges.range([0; 36]..)?;

while let Some((key, value)) = cursor.next() {
for (key, value) in outpoint_to_ordinal_ranges.range([0; 36]..)? {
let mut offset = 0;
for chunk in value.chunks_exact(11) {
let (start, end) = Index::decode_ordinal_range(chunk.try_into().unwrap());
Expand Down

0 comments on commit e9a6659

Please sign in to comment.