From 776f266e76df7bd756277f535a147b285bb1c3c4 Mon Sep 17 00:00:00 2001 From: lamafab <42901763+lamafab@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:13:22 +0000 Subject: [PATCH] complete handling todos in utils.rs --- rust/tw_bitcoin/src/modules/utils.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rust/tw_bitcoin/src/modules/utils.rs b/rust/tw_bitcoin/src/modules/utils.rs index b64408c045b..f64f9bfb29e 100644 --- a/rust/tw_bitcoin/src/modules/utils.rs +++ b/rust/tw_bitcoin/src/modules/utils.rs @@ -118,7 +118,9 @@ pub fn hard_clone_proto_output(proto: Proto::Output<'_>) -> Result ProtoPubkeyOrHash::pubkey(pubkey.to_vec().into()), ProtoPubkeyOrHash::hash(hash) => ProtoPubkeyOrHash::hash(hash.to_vec().into()), - ProtoPubkeyOrHash::None => todo!(), + ProtoPubkeyOrHash::None => { + return Err(Error::from(Proto::Error::Error_missing_recipient)) + }, }; Ok(Proto::ToPublicKeyOrHash { to_address }) @@ -164,7 +166,9 @@ pub fn hard_clone_proto_output(proto: Proto::Output<'_>) -> Result todo!(), + ProtoOutputBuilder::None => { + return Err(Error::from(Proto::Error::Error_missing_output_builder)) + }, }, ProtoOutputRecipient::custom_script_pubkey(custom) => { ProtoOutputRecipient::custom_script_pubkey(custom.to_vec().into()) @@ -172,7 +176,9 @@ pub fn hard_clone_proto_output(proto: Proto::Output<'_>) -> Result { ProtoOutputRecipient::from_address(address.to_string().into()) }, - ProtoOutputRecipient::None => todo!(), + ProtoOutputRecipient::None => { + return Err(Error::from(Proto::Error::Error_missing_output_builder)) + }, }; Ok(Proto::Output {