mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
psbt: have wally_tx serialization methods be legible for gen'd code
our code generators expect the serialization name to match the struct type
This commit is contained in:
committed by
Christian Decker
parent
b63abef542
commit
175fcf381a
@@ -424,7 +424,7 @@ struct wally_psbt *psbt_from_bytes(const tal_t *ctx, const u8 *bytes,
|
|||||||
return psbt;
|
return psbt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void towire_psbt(u8 **pptr, const struct wally_psbt *psbt)
|
void towire_wally_psbt(u8 **pptr, const struct wally_psbt *psbt)
|
||||||
{
|
{
|
||||||
/* Let's include the PSBT bytes */
|
/* Let's include the PSBT bytes */
|
||||||
size_t bytes_written;
|
size_t bytes_written;
|
||||||
@@ -434,7 +434,7 @@ void towire_psbt(u8 **pptr, const struct wally_psbt *psbt)
|
|||||||
tal_free(pbt_bytes);
|
tal_free(pbt_bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wally_psbt *fromwire_psbt(const tal_t *ctx,
|
struct wally_psbt *fromwire_wally_psbt(const tal_t *ctx,
|
||||||
const u8 **cursor, size_t *max)
|
const u8 **cursor, size_t *max)
|
||||||
{
|
{
|
||||||
struct wally_psbt *psbt;
|
struct wally_psbt *psbt;
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ const u8 *psbt_get_bytes(const tal_t *ctx, const struct wally_psbt *psbt,
|
|||||||
size_t *bytes_written);
|
size_t *bytes_written);
|
||||||
struct wally_psbt *psbt_from_bytes(const tal_t *ctx, const u8 *bytes,
|
struct wally_psbt *psbt_from_bytes(const tal_t *ctx, const u8 *bytes,
|
||||||
size_t byte_len);
|
size_t byte_len);
|
||||||
void towire_psbt(u8 **pptr, const struct wally_psbt *psbt);
|
void towire_wally_psbt(u8 **pptr, const struct wally_psbt *psbt);
|
||||||
struct wally_psbt *fromwire_psbt(const tal_t *ctx,
|
struct wally_psbt *fromwire_wally_psbt(const tal_t *ctx,
|
||||||
const u8 **curosr, size_t *max);
|
const u8 **cursor, size_t *max);
|
||||||
#endif /* LIGHTNING_BITCOIN_PSBT_H */
|
#endif /* LIGHTNING_BITCOIN_PSBT_H */
|
||||||
|
|||||||
@@ -652,7 +652,7 @@ struct bitcoin_tx *fromwire_bitcoin_tx(const tal_t *ctx,
|
|||||||
|
|
||||||
/* pull_bitcoin_tx sets the psbt */
|
/* pull_bitcoin_tx sets the psbt */
|
||||||
tal_free(tx->psbt);
|
tal_free(tx->psbt);
|
||||||
tx->psbt = fromwire_psbt(tx, cursor, max);
|
tx->psbt = fromwire_wally_psbt(tx, cursor, max);
|
||||||
|
|
||||||
return tx;
|
return tx;
|
||||||
}
|
}
|
||||||
@@ -667,7 +667,7 @@ void towire_bitcoin_tx(u8 **pptr, const struct bitcoin_tx *tx)
|
|||||||
u8 *lin = linearize_tx(tmpctx, tx);
|
u8 *lin = linearize_tx(tmpctx, tx);
|
||||||
towire_u8_array(pptr, lin, tal_count(lin));
|
towire_u8_array(pptr, lin, tal_count(lin));
|
||||||
|
|
||||||
towire_psbt(pptr, tx->psbt);
|
towire_wally_psbt(pptr, tx->psbt);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct bitcoin_tx_output *fromwire_bitcoin_tx_output(const tal_t *ctx,
|
struct bitcoin_tx_output *fromwire_bitcoin_tx_output(const tal_t *ctx,
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ class Type(FieldSet):
|
|||||||
'onionmsg_path',
|
'onionmsg_path',
|
||||||
'route_hop',
|
'route_hop',
|
||||||
'tx_parts',
|
'tx_parts',
|
||||||
|
'wally_psbt',
|
||||||
]
|
]
|
||||||
|
|
||||||
# Some BOLT types are re-typed based on their field name
|
# Some BOLT types are re-typed based on their field name
|
||||||
|
|||||||
Reference in New Issue
Block a user