Skip to content

Commit

Permalink
Merge tag '0.6.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
gmart7t2 committed Jun 7, 2023
2 parents e90ab7d + 46cb65d commit 4d805b3
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 46 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
Changelog
=========

[0.6.0-gm1](https://github.com/gmart7t2/ord/releases/tag/0.6.0-gm1) - 2023-06-05
[0.6.1-gm1](https://github.com/gmart7t2/ord/releases/tag/0.6.0-gm1) - 2023-06-07
--------------------------------------------------------------------------------

### Changed
- Merged in release 0.6.0 from upstream.
- Merged in release 0.6.1 from upstream.

[0.6.1](https://github.com/ordinals/ord/releases/tag/0.6.1) - 2023-06-06
---------------------------------------------------------------------

### Changed
- Fix sat index test and unbound assignment (#2154)
- Updated install.sh for new repo name (#2155)

[0.6.0](https://github.com/ordinals/ord/releases/tag/0.6.0) - 2023-06-04
---------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ord"
description = "◉ Ordinal wallet and block explorer"
version = "0.6.0-gm1"
version = "0.6.1-gm1"
license = "CC0-1.0"
edition = "2021"
autotests = false
Expand Down
5 changes: 2 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env bash

set -euo pipefail

if [ ! -z ${GITHUB_ACTIONS-} ]; then
set -x
fi
Expand All @@ -24,7 +23,7 @@ OPTIONS:
EOF
}

git=casey/ord
git=ordinals/ord
crate=ord
url=https://github.com/ordinals/ord
releases=$url/releases
Expand Down Expand Up @@ -98,7 +97,7 @@ if [ -z ${dest-} ]; then
fi

if [ -z ${tag-} ]; then
tag=$(curl --proto =https --tlsv1.2 -sSf https://api.github.com/repos/casey/ord/releases/latest |
tag=$(curl --proto =https --tlsv1.2 -sSf https://api.github.com/repos/ordinals/ord/releases/latest |
grep tag_name |
cut -d'"' -f4
)
Expand Down
65 changes: 37 additions & 28 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1009,35 +1009,44 @@ impl Index {
inscription_id,
);

if let Some(sat) = sat {
if self.has_sat_index().unwrap() {
assert_eq!(
InscriptionId::load(
*rtx
.open_table(SAT_TO_INSCRIPTION_ID)
.unwrap()
.get(&sat)
.unwrap()
.unwrap()
.value()
),
inscription_id,
);

// we do not track common sats or anything in the unbound output
if !Sat(sat).is_common() && satpoint.outpoint != unbound_outpoint() {
match sat {
Some(sat) => {
if self.has_sat_index().unwrap() {
// unbound inscriptions should not be assigned to a sat
assert!(satpoint.outpoint != unbound_outpoint());
assert_eq!(
SatPoint::load(
InscriptionId::load(
*rtx
.open_table(SAT_TO_SATPOINT)
.open_table(SAT_TO_INSCRIPTION_ID)
.unwrap()
.get(&sat)
.unwrap()
.unwrap()
.value()
),
satpoint,
inscription_id,
);

// we do not track common sats (only the sat ranges)
if !Sat(sat).is_common() {
assert_eq!(
SatPoint::load(
*rtx
.open_table(SAT_TO_SATPOINT)
.unwrap()
.get(&sat)
.unwrap()
.unwrap()
.value()
),
satpoint,
);
}
}
}
None => {
if self.has_sat_index().unwrap() {
assert!(satpoint.outpoint == unbound_outpoint())
}
}
}
Expand Down Expand Up @@ -2360,7 +2369,7 @@ mod tests {
outpoint: unbound_outpoint(),
offset: 0,
},
Some(50 * COIN_VALUE),
None, // should not be on a sat
);

assert!(context
Expand Down Expand Up @@ -2537,7 +2546,7 @@ mod tests {
outpoint: OutPoint { txid, vout: 0 },
offset: 0,
},
None,
Some(50 * COIN_VALUE),
);

context.index.assert_inscription_location(
Expand All @@ -2546,7 +2555,7 @@ mod tests {
outpoint: OutPoint { txid, vout: 0 },
offset: 50 * COIN_VALUE,
},
None,
Some(100 * COIN_VALUE),
);

context.index.assert_inscription_location(
Expand All @@ -2555,7 +2564,7 @@ mod tests {
outpoint: OutPoint { txid, vout: 0 },
offset: 100 * COIN_VALUE,
},
None,
Some(150 * COIN_VALUE),
);

assert_eq!(
Expand Down Expand Up @@ -2642,7 +2651,7 @@ mod tests {
outpoint: OutPoint { txid, vout: 0 },
offset: 0,
},
None,
Some(50 * COIN_VALUE),
);

context.index.assert_inscription_location(
Expand Down Expand Up @@ -2749,7 +2758,7 @@ mod tests {
outpoint: OutPoint { txid, vout: 0 },
offset: 0,
},
None,
Some(50 * COIN_VALUE),
);

context.index.assert_inscription_location(
Expand All @@ -2758,7 +2767,7 @@ mod tests {
outpoint: OutPoint { txid, vout: 0 },
offset: 50 * COIN_VALUE,
},
None,
Some(100 * COIN_VALUE),
);

context.index.assert_inscription_location(
Expand Down Expand Up @@ -2901,7 +2910,7 @@ mod tests {
},
offset: 0,
},
None,
Some(100 * COIN_VALUE),
);

assert_eq!(
Expand Down
29 changes: 17 additions & 12 deletions src/index/updater/inscription_updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,20 +316,25 @@ impl<'a, 'db, 'tx> InscriptionUpdater<'a, 'db, 'tx> {

self.number_to_id.insert(number, &inscription_id)?;

let mut sat = None;
if let Some(input_sat_ranges) = input_sat_ranges {
let mut offset = 0;
for (start, end) in input_sat_ranges {
let size = end - start;
if offset + size > flotsam.offset {
let n = start + flotsam.offset - offset;
self.sat_to_inscription_id.insert(&n, &inscription_id)?;
sat = Some(Sat(n));
break;
let sat = if unbound {
None
} else {
let mut sat = None;
if let Some(input_sat_ranges) = input_sat_ranges {
let mut offset = 0;
for (start, end) in input_sat_ranges {
let size = end - start;
if offset + size > flotsam.offset {
let n = start + flotsam.offset - offset;
self.sat_to_inscription_id.insert(&n, &inscription_id)?;
sat = Some(Sat(n));
break;
}
offset += size;
}
offset += size;
}
}
sat
};

self.id_to_entry.insert(
&inscription_id,
Expand Down

0 comments on commit 4d805b3

Please sign in to comment.