@@ -8,7 +8,7 @@ pub fn sign_simple_encoded(address: &str, message: &str, wif_private_key: &str)
88
99 let private_key = PrivateKey :: from_wif ( wif_private_key) . context ( error:: PrivateKeyParse ) ?;
1010
11- let witness = sign_simple ( & address, message. as_bytes ( ) , private_key) ?;
11+ let witness = sign_simple ( & address, message, private_key) ?;
1212
1313 let mut buffer = Vec :: new ( ) ;
1414
@@ -27,7 +27,7 @@ pub fn sign_full_encoded(address: &str, message: &str, wif_private_key: &str) ->
2727
2828 let private_key = PrivateKey :: from_wif ( wif_private_key) . context ( error:: PrivateKeyParse ) ?;
2929
30- let tx = sign_full ( & address, message. as_bytes ( ) , private_key) ?;
30+ let tx = sign_full ( & address, message, private_key) ?;
3131
3232 let mut buffer = Vec :: new ( ) ;
3333
@@ -38,7 +38,11 @@ pub fn sign_full_encoded(address: &str, message: &str, wif_private_key: &str) ->
3838}
3939
4040/// Signs in the BIP-322 simple format from proper Rust types and returns the witness.
41- pub fn sign_simple ( address : & Address , message : & [ u8 ] , private_key : PrivateKey ) -> Result < Witness > {
41+ pub fn sign_simple (
42+ address : & Address ,
43+ message : impl AsRef < [ u8 ] > ,
44+ private_key : PrivateKey ,
45+ ) -> Result < Witness > {
4246 Ok (
4347 sign_full ( address, message, private_key) ?. input [ 0 ]
4448 . witness
@@ -49,7 +53,7 @@ pub fn sign_simple(address: &Address, message: &[u8], private_key: PrivateKey) -
4953/// Signs in the BIP-322 full format from proper Rust types and returns the full transaction.
5054pub fn sign_full (
5155 address : & Address ,
52- message : & [ u8 ] ,
56+ message : impl AsRef < [ u8 ] > ,
5357 private_key : PrivateKey ,
5458) -> Result < Transaction > {
5559 let to_spend = create_to_spend ( address, message) ?;
0 commit comments