Skip to content
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

fix: off by one #146

Merged
merged 1 commit into from
Aug 4, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ impl SequenceCursor {
inscription_number + 1
}
_ => {
self.blessed = Some(0);
0
}
}
Expand All @@ -376,7 +375,6 @@ impl SequenceCursor {
inscription_number - 1
}
_ => {
self.cursed = Some(-1);
-1
}
}
Expand Down Expand Up @@ -514,8 +512,6 @@ pub fn augment_transaction_with_ordinals_inscriptions_data(
OrdinalOperation::InscriptionTransferred(_) => continue,
};

let mut inscription_number = sequence_cursor.pick_next(is_cursed, block_identifier.index);

let transaction_identifier = tx.transaction_identifier.clone();
let traversal = match inscriptions_data
.remove(&(transaction_identifier, inscription.inscription_input_index))
Expand All @@ -534,9 +530,8 @@ pub fn augment_transaction_with_ordinals_inscriptions_data(
}
};

// Do we need to curse the inscription because of re-inscription?
let mut curse_type_override = None;

// Do we need to curse the inscription?
if !is_cursed {
// Is this inscription re-inscribing an existing blessed inscription?
if let Some(exisiting_inscription_id) =
Expand All @@ -558,6 +553,8 @@ pub fn augment_transaction_with_ordinals_inscriptions_data(
}
};

let mut inscription_number = sequence_cursor.pick_next(is_cursed, block_identifier.index);

let outputs = &tx.metadata.outputs;
inscription.inscription_number = inscription_number;
inscription.ordinal_offset = traversal.get_ordinal_coinbase_offset();
Expand Down