From b008cbdc50c2e05742c909166c0fc878a1f0b195 Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Mon, 16 Dec 2024 11:18:05 +0000 Subject: [PATCH] Catch errors correctly when composing MPMA send --- .../counterpartycore/lib/messages/versions/mpma.py | 10 +++++++--- release-notes/release-notes-v10.9.0.md | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/counterparty-core/counterpartycore/lib/messages/versions/mpma.py b/counterparty-core/counterpartycore/lib/messages/versions/mpma.py index 4c441a2f9..fb1db0690 100644 --- a/counterparty-core/counterpartycore/lib/messages/versions/mpma.py +++ b/counterparty-core/counterpartycore/lib/messages/versions/mpma.py @@ -143,9 +143,13 @@ def compose( raise exceptions.ComposeError(problems) data = message_type.pack(ID) - data += _encode_mpma_send( - db, asset_dest_quant_list, block_index, memo=memo, memo_is_hex=memo_is_hex - ) + + try: + data += _encode_mpma_send( + db, asset_dest_quant_list, block_index, memo=memo, memo_is_hex=memo_is_hex + ) + except Exception as e: + raise exceptions.ComposeError(f"couldn't encode MPMA send: {e}") from e return (source, [], data) diff --git a/release-notes/release-notes-v10.9.0.md b/release-notes/release-notes-v10.9.0.md index 5e03c0580..fffb8e996 100644 --- a/release-notes/release-notes-v10.9.0.md +++ b/release-notes/release-notes-v10.9.0.md @@ -10,6 +10,7 @@ ## Bugfixes - Fix endpoint to get info from raw transaction when block index is not provided +- Catch errors correctly when composing MPMA send ## Codebase