Skip to content

Commit

Permalink
Keep inscriptions with unrecognized even fields unbound after jubilee (
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Dec 25, 2023
1 parent ec6aac6 commit 4bbeadc
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
45 changes: 45 additions & 0 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3251,6 +3251,51 @@ mod tests {
}
}

#[test]
fn unrecognized_even_field_inscriptions_are_unbound_after_jubilee() {
for context in Context::configurations() {
context.mine_blocks(109);

let witness = envelope(&[
b"ord",
&[1],
b"text/plain;charset=utf-8",
&[2],
b"bar",
&[4],
b"ord",
]);

let txid = context.rpc_server.broadcast_tx(TransactionTemplate {
inputs: &[(1, 0, 0, witness)],
..Default::default()
});

let inscription_id = InscriptionId { txid, index: 0 };

context.mine_blocks(1);

context.index.assert_inscription_location(
inscription_id,
SatPoint {
outpoint: unbound_outpoint(),
offset: 0,
},
None,
);

assert_eq!(
context
.index
.get_inscription_entry(inscription_id)
.unwrap()
.unwrap()
.inscription_number,
0
);
}
}

#[test]
fn inscriptions_are_uncursed_after_jubilee() {
for context in Context::configurations() {
Expand Down
4 changes: 3 additions & 1 deletion src/index/updater/inscription_updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ impl<'a, 'db, 'tx> InscriptionUpdater<'a, 'db, 'tx> {
None
};

let unbound = current_input_value == 0 || curse == Some(Curse::UnrecognizedEvenField);
let unbound = current_input_value == 0
|| curse == Some(Curse::UnrecognizedEvenField)
|| inscription.payload.unrecognized_even_field;

let offset = inscription
.payload
Expand Down

0 comments on commit 4bbeadc

Please sign in to comment.