|
1 | 1 | /// This contains low-level parsing of PSBT into a node structure suitable for display |
2 | 2 | use crate::address::from_output_script_with_network; |
3 | 3 | use crate::bitcoin::consensus::Decodable; |
4 | | -use crate::bitcoin::hashes::Hash; |
5 | 4 | use crate::bitcoin::psbt::Psbt; |
6 | 5 | use crate::bitcoin::{ScriptBuf, Transaction}; |
7 | 6 | use crate::fixed_script_wallet::bitgo_psbt::{ |
@@ -250,7 +249,7 @@ fn tx_input_to_node(input: &crate::bitcoin::TxIn, index: usize) -> Node { |
250 | 249 |
|
251 | 250 | input_node.add_child(Node::new( |
252 | 251 | "prev_txid", |
253 | | - Primitive::Buffer(input.previous_output.txid.to_byte_array().to_vec()), |
| 252 | + Primitive::String(input.previous_output.txid.to_string()), |
254 | 253 | )); |
255 | 254 | input_node.add_child(Node::new( |
256 | 255 | "prev_vout", |
@@ -325,7 +324,7 @@ fn psbt_input_to_node(input: &crate::bitcoin::psbt::Input, index: usize, network |
325 | 324 | if let Some(utxo) = &input.non_witness_utxo { |
326 | 325 | input_node.add_child(Node::new( |
327 | 326 | "non_witness_utxo", |
328 | | - Primitive::Buffer(utxo.compute_txid().to_byte_array().to_vec()), |
| 327 | + Primitive::String(utxo.compute_txid().to_string()), |
329 | 328 | )); |
330 | 329 | } |
331 | 330 |
|
@@ -483,15 +482,15 @@ pub fn tx_to_node(tx: &Transaction, network: Network) -> Node { |
483 | 482 | )); |
484 | 483 | tx_node.add_child(Node::new( |
485 | 484 | "txid", |
486 | | - Primitive::Buffer(tx.compute_txid().to_byte_array().to_vec()), |
| 485 | + Primitive::String(tx.compute_txid().to_string()), |
487 | 486 | )); |
488 | 487 | tx_node.add_child(Node::new( |
489 | 488 | "ntxid", |
490 | | - Primitive::Buffer(tx.compute_ntxid().to_byte_array().to_vec()), |
| 489 | + Primitive::String(tx.compute_ntxid().to_string()), |
491 | 490 | )); |
492 | 491 | tx_node.add_child(Node::new( |
493 | 492 | "wtxid", |
494 | | - Primitive::Buffer(tx.compute_wtxid().to_byte_array().to_vec()), |
| 493 | + Primitive::String(tx.compute_wtxid().to_string()), |
495 | 494 | )); |
496 | 495 | tx_node.add_child(tx_inputs_to_node(&tx.input)); |
497 | 496 | tx_node.add_child(tx_outputs_to_node(&tx.output, network)); |
@@ -529,15 +528,15 @@ pub fn zcash_tx_to_node(parts: &ZcashTransactionParts, network: Network) -> Node |
529 | 528 | )); |
530 | 529 | tx_node.add_child(Node::new( |
531 | 530 | "txid", |
532 | | - Primitive::Buffer(tx.compute_txid().to_byte_array().to_vec()), |
| 531 | + Primitive::String(tx.compute_txid().to_string()), |
533 | 532 | )); |
534 | 533 | tx_node.add_child(Node::new( |
535 | 534 | "ntxid", |
536 | | - Primitive::Buffer(tx.compute_ntxid().to_byte_array().to_vec()), |
| 535 | + Primitive::String(tx.compute_ntxid().to_string()), |
537 | 536 | )); |
538 | 537 | tx_node.add_child(Node::new( |
539 | 538 | "wtxid", |
540 | | - Primitive::Buffer(tx.compute_wtxid().to_byte_array().to_vec()), |
| 539 | + Primitive::String(tx.compute_wtxid().to_string()), |
541 | 540 | )); |
542 | 541 | tx_node.add_child(tx_inputs_to_node(&tx.input)); |
543 | 542 | tx_node.add_child(tx_outputs_to_node(&tx.output, network)); |
|
0 commit comments