diff --git a/script/src/builder.rs b/script/src/builder.rs index 5b363899..9d0b4601 100644 --- a/script/src/builder.rs +++ b/script/src/builder.rs @@ -31,6 +31,14 @@ impl Builder { .into_script() } + /// Builds op_return script + pub fn build_nulldata(bytes: &[u8]) -> Script { + Builder::default() + .push_opcode(Opcode::OP_RETURN) + .push_bytes(bytes) + .into_script() + } + /// Pushes opcode to the end of script pub fn push_opcode(mut self, opcode: Opcode) -> Self { self.data.push(opcode as u8);