From 12fdfdfabcf3aa597d67a13eeb234cc3cf026473 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Sun, 3 Nov 2024 15:05:32 -0800 Subject: [PATCH] Do not chunk runestone data pushes (#4036) --- crates/ordinals/src/lib.rs | 2 +- crates/ordinals/src/runestone.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/ordinals/src/lib.rs b/crates/ordinals/src/lib.rs index 98b16f0355..1e7c63e19b 100644 --- a/crates/ordinals/src/lib.rs +++ b/crates/ordinals/src/lib.rs @@ -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, diff --git a/crates/ordinals/src/runestone.rs b/crates/ordinals/src/runestone.rs index 82cb43694b..710ae5abd4 100644 --- a/crates/ordinals/src/runestone.rs +++ b/crates/ordinals/src/runestone.rs @@ -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); } @@ -1794,7 +1794,7 @@ mod tests { } #[test] - fn runestone_payload_is_chunked() { + fn runestone_payloads_are_not_chunked() { let script = Runestone { edicts: vec![ Edict { @@ -1823,7 +1823,7 @@ mod tests { } .encipher(); - assert_eq!(script.instructions().count(), 4); + assert_eq!(script.instructions().count(), 3); } #[test]