Skip to content

Commit

Permalink
Remove is_integer_num for better analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
wizz-wallet-dev committed Oct 6, 2024
1 parent 527eb39 commit 747c300
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
3 changes: 1 addition & 2 deletions electrumx/lib/atomicals_blueprint_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
compact_to_location_id_bytes,
is_compact_atomical_id,
is_custom_colored_operation,
is_integer_num,
is_mint_operation,
is_op_return_dmitem_payment_marker_atomical_id,
is_op_return_subrealm_payment_marker_atomical_id,
Expand Down Expand Up @@ -1025,7 +1024,7 @@ def are_payments_satisfied(self, expected_payment_outputs):
# There is no value defined or the expected payment is below the dust limit, or skip it
expected_output_payment_value = expected_output_payment_value_dict.get("v", None)
if (
not is_integer_num(expected_output_payment_value)
not isinstance(expected_output_payment_value, int)
or expected_output_payment_value < SUBNAME_MIN_PAYMENT_DUST_LIMIT
):
continue
Expand Down
8 changes: 1 addition & 7 deletions electrumx/lib/util_atomicals.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@ def is_sanitized_dict_whitelist_only(d: dict, allow_bytes=False):
return True


def is_integer_num(n):
if isinstance(n, int):
return True
return False


# Check whether the value is hex string
def is_hex_string(value):
if not isinstance(value, str):
Expand Down Expand Up @@ -1518,7 +1512,7 @@ def validate_subrealm_rules_outputs_format(outputs):
return False # Reject if one of the entries expects less than the minimum payment amount
expected_output_id = expected_output_value.get("id")
expected_output_qty = expected_output_value.get("v")
if not is_integer_num(expected_output_qty) or expected_output_qty < SUBNAME_MIN_PAYMENT_DUST_LIMIT:
if not isinstance(expected_output_qty, int) or expected_output_qty < SUBNAME_MIN_PAYMENT_DUST_LIMIT:
print_subrealm_calculate_log("validate_subrealm_rules_outputs_format: invalid expected output value")
return False # Reject if one of the entries expects less than the minimum payment amount
# If there is a type restriction on the payment type then ensure it is a valid atomical id
Expand Down

0 comments on commit 747c300

Please sign in to comment.