Add a nulldata builder

This commit is contained in:
Christian Nyumbayire 2017-05-06 11:40:35 +02:00
parent 1e0a768927
commit a77abd4545
1 changed files with 8 additions and 0 deletions

View File

@ -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);