@@ -87,7 +87,9 @@ string dump_pubkey(const struct pubkey *kp)
8787string dump_ext_pubkey (const  struct  ext_key  *xp)
8888{
8989	char  *out;
90+ 	tal_wally_start ();
9091	int  rv = bip32_key_to_base58 (xp, BIP32_FLAG_KEY_PUBLIC, &out);
92+ 	tal_wally_end (NULL );
9193	assert (rv == WALLY_OK);
9294	string retval (out);
9395	wally_free_string (out);
@@ -208,29 +210,30 @@ string dump_wally_tx_witness_stack(const struct wally_tx_witness_stack *sp)
208210	return  ostrm.str ();
209211}
210212
211- string dump_wally_keypath_item (const  struct  wally_keypath_item  *ip)
213+ string dump_wally_keypath_item (const  struct  wally_map_item  *ip)
212214{
215+ 	size_t  npath = (ip->value_len  - BIP32_KEY_FINGERPRINT_LEN) / sizeof (uint32_t );
213216	ostringstream ostrm;
214217	ostrm << " { "  ;
215- 	ostrm << " \" pubkey\" :"   << dump_hex (
216- 		ip->pubkey , pubkey_is_compressed (ip->pubkey ) ?
217- 		EC_PUBLIC_KEY_LEN : EC_PUBLIC_KEY_UNCOMPRESSED_LEN);
218+ 	ostrm << " \" pubkey\" :"   << dump_hex (ip->key , ip->key_len );
218219	ostrm << " , \" origin\" :{ "  ;
219- 	ostrm << "  \" fingerprint\" :"  <<  dump_hex (ip-> origin . fingerprint , 
220- 					       sizeof (ip->origin . fingerprint ) );
220+ 	ostrm << "  \" fingerprint\" :" 
221+ 	      <<  dump_hex (ip->value , BIP32_KEY_FINGERPRINT_LEN );
221222	ostrm << " , \" path\" :[ "  ;
222- 	for  (size_t  ii = 0 ; ii < ip-> origin . path_len ; ++ii) {
223+ 	for  (size_t  ii = 0 ; ii < npath ; ++ii) {
223224		if  (ii != 0 )
224225			ostrm << " ,"  ;
225- 		ostrm << ip->origin .path [ii];
226+ 		uint32_t  pelem = *(uint32_t  *)
227+ 			ip->value  + BIP32_KEY_FINGERPRINT_LEN + ii * sizeof (uint32_t );
228+ 		ostrm << pelem;
226229	}
227230	ostrm << "  ]"  ;
228231	ostrm << "  }"  ;
229232	ostrm << "  }"  ;
230233	return  ostrm.str ();
231234}
232235
233- string dump_wally_keypath_map (const  struct  wally_keypath_map  *mp)
236+ string dump_wally_keypath_map (const  struct  wally_map  *mp)
234237{
235238	ostringstream ostrm;
236239	ostrm << " ["  ;
@@ -245,34 +248,32 @@ string dump_wally_keypath_map(const struct wally_keypath_map *mp)
245248	return  ostrm.str ();
246249}
247250
248- string dump_wally_partial_sigs_item (const  struct  wally_partial_sigs_item  *ip)
251+ string dump_wally_signatures_item (const  struct  wally_map_item  *ip)
249252{
250253	ostringstream ostrm;
251254	ostrm << " { "  ;
252- 	ostrm << " \" pubkey\" :"   << dump_hex (
253- 		ip->pubkey , pubkey_is_compressed (ip->pubkey ) ?
254- 		EC_PUBLIC_KEY_LEN : EC_PUBLIC_KEY_UNCOMPRESSED_LEN);
255- 	ostrm << " , \" sig\" :"   << dump_hex (ip->sig , ip->sig_len );
255+ 	ostrm << " \" pubkey\" :"   << dump_hex (ip->key , ip->key_len );
256+ 	ostrm << " , \" sig\" :"   << dump_hex (ip->value , ip->value_len );
256257	ostrm << "  }"  ;
257258	return  ostrm.str ();
258259}
259260
260- string dump_wally_partial_sigs_map (const  struct  wally_partial_sigs_map  *mp)
261+ string dump_wally_signatures_map (const  struct  wally_map  *mp)
261262{
262263	ostringstream ostrm;
263264	ostrm << " ["  ;
264265	if  (mp) {
265266		for  (size_t  ii = 0 ; ii < mp->num_items ; ii++) {
266267			if  (ii != 0 )
267268				ostrm << " ,"  ;
268- 			ostrm << dump_wally_partial_sigs_item (&mp->items [ii]);
269+ 			ostrm << dump_wally_signatures_item (&mp->items [ii]);
269270		}
270271	}
271272	ostrm << " ]"  ;
272273	return  ostrm.str ();
273274}
274275
275- string dump_wally_unknowns_item (const  struct  wally_unknowns_item  *ip)
276+ string dump_wally_unknowns_item (const  struct  wally_map_item  *ip)
276277{
277278	ostringstream ostrm;
278279	ostrm << " { "  ;
@@ -282,7 +283,7 @@ string dump_wally_unknowns_item(const struct wally_unknowns_item *ip)
282283	return  ostrm.str ();
283284}
284285
285- string dump_wally_unknowns_map (const  struct  wally_unknowns_map  *mp)
286+ string dump_wally_unknowns_map (const  struct  wally_map  *mp)
286287{
287288	ostringstream ostrm;
288289	ostrm << " ["  ;
@@ -380,21 +381,21 @@ string dump_wally_psbt_input(const struct wally_psbt_input *in)
380381{
381382	ostringstream ostrm;
382383	ostrm << " { "  ;
383- 	ostrm << " \" non_witness_utxo \" :"   << dump_wally_tx (in->non_witness_utxo );
384+ 	ostrm << " \" utxo \" :"   << dump_wally_tx (in->utxo );
384385	ostrm << " , \" witness_utxo\" :"   << dump_wally_tx_output (in->witness_utxo );
385386	ostrm << " , \" redeem_script\" :"   << dump_hex (in->redeem_script ,
386387						    in->redeem_script_len );
387388	ostrm << " , \" witness_script\" :"   << dump_hex (in->witness_script ,
388389						     in->witness_script_len );
389- 	ostrm << " , \" final_script_sig \" :"   << dump_hex (in->final_script_sig ,
390- 						       in->final_script_sig_len );
390+ 	ostrm << " , \" final_scriptsig \" :"   << dump_hex (in->final_scriptsig ,
391+ 						       in->final_scriptsig_len );
391392	ostrm << " , \" final_witness\" :" 
392393	      << dump_wally_tx_witness_stack (in->final_witness );
393- 	ostrm << " , \" keypaths\" :"   << dump_wally_keypath_map (in->keypaths );
394- 	ostrm << " , \" partial_sigs \" :" 
395- 	      << dump_wally_partial_sigs_map ( in->partial_sigs );
396- 	ostrm << " , \" unknowns\" :"   << dump_wally_unknowns_map (in->unknowns );
397- 	ostrm << " , \" sighash_type \" :"   << in->sighash_type ;
394+ 	ostrm << " , \" keypaths\" :"   << dump_wally_keypath_map (& in->keypaths );
395+ 	ostrm << " , \" signatures \" :" 
396+ 	      << dump_wally_signatures_map (& in->signatures );
397+ 	ostrm << " , \" unknowns\" :"   << dump_wally_unknowns_map (& in->unknowns );
398+ 	ostrm << " , \" sighash \" :"   << in->sighash ;
398399	ostrm << "  }"  ;
399400	return  ostrm.str ();
400401}
@@ -421,8 +422,8 @@ string dump_wally_psbt_output(const struct wally_psbt_output *out)
421422						  out->redeem_script_len );
422423	ostrm << " , \" witness_script\" :"   << dump_hex (out->witness_script ,
423424						     out->witness_script_len );
424- 	ostrm << " , \" keypaths\" :"   << dump_wally_keypath_map (out->keypaths );
425- 	ostrm << " , \" unknowns\" :"   << dump_wally_unknowns_map (out->unknowns );
425+ 	ostrm << " , \" keypaths\" :"   << dump_wally_keypath_map (& out->keypaths );
426+ 	ostrm << " , \" unknowns\" :"   << dump_wally_unknowns_map (& out->unknowns );
426427	ostrm << "  }"  ;
427428	return  ostrm.str ();
428429
@@ -452,7 +453,7 @@ string dump_wally_psbt(const struct wally_psbt *psbt)
452453	      << dump_wally_psbt_inputs (psbt->inputs , psbt->num_inputs );
453454	ostrm << " , \" outputs\" :" 
454455	      << dump_wally_psbt_outputs (psbt->outputs , psbt->num_outputs );
455- 	ostrm << " , \" unknowns\" :"   << dump_wally_unknowns_map (psbt->unknowns );
456+ 	ostrm << " , \" unknowns\" :"   << dump_wally_unknowns_map (& psbt->unknowns );
456457	ostrm << " , \" version\" :"   << psbt->version ;
457458	ostrm << "  }"  ;
458459	return  ostrm.str ();
0 commit comments