Merge rust-bitcoin/rust-bitcoin#2002: Remove unnecessary reference
f17bb0d18f
Remove unnecessary reference (Tobin C. Harding) Pull request description: `T` is a generic that implements`AsRef<PushBytes>`, it should not be a reference. This is inline with other usages of `AsRef<PushBytes>` for example in `Builder::push_slice`. Found while working on #2003 ACKs for top commit: apoelstra: ACKf17bb0d18f
Tree-SHA512: 6f6ae0ba5d5010db53d9c2af107df84bc058277b2b7cc35800f4e6ed93d351838b7f101284b7d80345bee639615d27d76a2e5c4c784782c5b3e5090444defe29
This commit is contained in:
commit
f80ec98f35
|
@ -153,7 +153,7 @@ impl ScriptBuf {
|
|||
}
|
||||
|
||||
/// Generates OP_RETURN-type of scriptPubkey for the given data.
|
||||
pub fn new_op_return<T: AsRef<PushBytes>>(data: &T) -> Self {
|
||||
pub fn new_op_return<T: AsRef<PushBytes>>(data: T) -> Self {
|
||||
Builder::new().push_opcode(OP_RETURN).push_slice(data).into_script()
|
||||
}
|
||||
|
||||
|
|
|
@ -224,7 +224,7 @@ fn script_generators() {
|
|||
// Test data are taken from the second output of
|
||||
// 2ccb3a1f745eb4eefcf29391460250adda5fab78aaddb902d25d3cd97d9d8e61 transaction
|
||||
let data = hex!("aa21a9ed20280f53f2d21663cac89e6bd2ad19edbabb048cda08e73ed19e9268d0afea2a");
|
||||
let op_return = ScriptBuf::new_op_return(&data);
|
||||
let op_return = ScriptBuf::new_op_return(data);
|
||||
assert!(op_return.is_op_return());
|
||||
assert_eq!(
|
||||
op_return.to_hex_string(),
|
||||
|
|
Loading…
Reference in New Issue