Skip to content

Commit

Permalink
just check the length
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouziel committed Mar 5, 2025
1 parent 09dc47c commit 128951c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 1 addition & 4 deletions counterparty-core/counterpartycore/lib/messages/dispenser.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from counterpartycore.lib.ledger.currentstate import CurrentState
from counterpartycore.lib.parser import messagetype, protocol
from counterpartycore.lib.utils import helpers
from counterpartycore.lib.utils.address import pack as address_pack_new
from counterpartycore.lib.utils.address import pack_legacy as address_pack
from counterpartycore.lib.utils.address import unpack_legacy as address_unpack

Expand Down Expand Up @@ -247,9 +246,7 @@ def compose(
oracle_address: str = None,
skip_validation: bool = False,
):
if oracle_address is not None and address_pack(oracle_address) != address_pack_new(
oracle_address
):
if oracle_address is not None and len(oracle_address) > 42:
raise exceptions.ComposeError("Oracle address not supported by dispenser")

Check warning on line 250 in counterparty-core/counterpartycore/lib/messages/dispenser.py

View check run for this annotation

Codecov / codecov/patch

counterparty-core/counterpartycore/lib/messages/dispenser.py#L250

Added line #L250 was not covered by tests

asset_id, problems = validate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ def compose(

for send in asset_dest_quant_list:
destination = send[1]
if address.unpack(destination) != address.unpack_legacy(destination):

if len(destination) > 42:
raise exceptions.ComposeError(f"Address not supported by MPMA send: {address}")

Check warning on line 131 in counterparty-core/counterpartycore/lib/messages/versions/mpma.py

View check run for this annotation

Codecov / codecov/patch

counterparty-core/counterpartycore/lib/messages/versions/mpma.py#L131

Added line #L131 was not covered by tests

if memo and not isinstance(memo, str):
Expand Down

0 comments on commit 128951c

Please sign in to comment.