Skip to content

Commit

Permalink
Do not chunk runestone data pushes (ordinals#4036)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Nov 3, 2024
1 parent bef31b7 commit 12fdfdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/ordinals/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use {
bitcoin::{
consensus::{Decodable, Encodable},
constants::{DIFFCHANGE_INTERVAL, MAX_SCRIPT_ELEMENT_SIZE, SUBSIDY_HALVING_INTERVAL},
constants::{DIFFCHANGE_INTERVAL, SUBSIDY_HALVING_INTERVAL},
opcodes,
script::{self, Instruction},
Network, OutPoint, ScriptBuf, Transaction,
Expand Down
6 changes: 3 additions & 3 deletions crates/ordinals/src/runestone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl Runestone {
.push_opcode(opcodes::all::OP_RETURN)
.push_opcode(Runestone::MAGIC_NUMBER);

for chunk in payload.chunks(MAX_SCRIPT_ELEMENT_SIZE) {
for chunk in payload.chunks(u32::MAX.try_into().unwrap()) {
let push: &script::PushBytes = chunk.try_into().unwrap();
builder = builder.push_slice(push);
}
Expand Down Expand Up @@ -1794,7 +1794,7 @@ mod tests {
}

#[test]
fn runestone_payload_is_chunked() {
fn runestone_payloads_are_not_chunked() {
let script = Runestone {
edicts: vec![
Edict {
Expand Down Expand Up @@ -1823,7 +1823,7 @@ mod tests {
}
.encipher();

assert_eq!(script.instructions().count(), 4);
assert_eq!(script.instructions().count(), 3);
}

#[test]
Expand Down

0 comments on commit 12fdfdf

Please sign in to comment.