Skip to content

Commit

Permalink
complete handling todos in utils.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
lamafab committed Sep 19, 2023
1 parent 6fa15fc commit 776f266
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rust/tw_bitcoin/src/modules/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ pub fn hard_clone_proto_output(proto: Proto::Output<'_>) -> Result<Proto::Output
let to_address = match proto.to_address {
ProtoPubkeyOrHash::pubkey(pubkey) => 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 })
Expand Down Expand Up @@ -164,15 +166,19 @@ pub fn hard_clone_proto_output(proto: Proto::Output<'_>) -> Result<Proto::Output
payload: ord.payload.to_vec().into(),
}),
),
ProtoOutputBuilder::None => 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())
},
ProtoOutputRecipient::from_address(address) => {
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 {
Expand Down

0 comments on commit 776f266

Please sign in to comment.