diff --git a/pretix_eth/management/commands/confirm_payments.py b/pretix_eth/management/commands/confirm_payments.py index c815dc27..e81f09e9 100644 --- a/pretix_eth/management/commands/confirm_payments.py +++ b/pretix_eth/management/commands/confirm_payments.py @@ -219,7 +219,6 @@ def confirm_payments_for_event(self, event: Event, no_dry_run, log_verbosity=0): contract = w3.eth.contract(address=token.ADDRESS, abi=TOKEN_ABI) - logging.info(token.ADDRESS) # This may warn about mismatched ABI if its a smart contract wallet tx because of intermediary function calls - but it'll still process the Transfer event correctly # noqa: E501 transaction_details = ( contract.events.Transfer().process_receipt(receipt)[0].args @@ -260,9 +259,6 @@ def confirm_payments_for_event(self, event: Event, no_dry_run, log_verbosity=0): ) continue - logging.info(payment_amount) - logging.info(expected_amount) - if payment_amount > 0: logger.info( f"Payments found for {full_id} at {signed_message.sender_address}:" diff --git a/tests/integration/test_confirm_payments.py b/tests/integration/test_confirm_payments.py index a72e38ee..bf8c7d9c 100644 --- a/tests/integration/test_confirm_payments.py +++ b/tests/integration/test_confirm_payments.py @@ -4,7 +4,7 @@ import pytest import time from django.test import RequestFactory -from pretix_eth.models import SignedMessage +from pretix_eth.models import SignedMessage WEB3_PROVIDER_URI = os.environ.get("WEB3_PROVIDER_URI") # WEB3_PROVIDER_URI = 'https://goerli.infura.io/v3/8733c260b59e445e85ee90bd80d869aa' @@ -49,8 +49,8 @@ def _create_request_and_payment( def make_order_payment(payment_info, provider, get_request_order_payment): - order_kwargs = {"total": 0 } - payment_kwargs = {"amount": 0 } + order_kwargs = {"total": 0} + payment_kwargs = {"amount": 0} info_data = { "currency_type": payment_info["currency"], @@ -65,21 +65,23 @@ def make_order_payment(payment_info, provider, get_request_order_payment): return order, payment + TEST_ENOUGH_AMOUNT = [ { "currency": "ETH - Goerli", - "amount": 40000000000000, # Required amount in wei + "amount": 40000000000000, # Required amount in wei "signature": "0xf0c9df2bfb0c78754342a142cbafe58ff4cca3e0377c60d7596067abcbbd161c3641969f7135b29710408ab0a975d11e3ba0c609da0525a311937a6161db39461c", "transaction_hash": '0x0cfd2f6f75bd37bf3286ac957964e1671560963b5abc004fe71fd74cd6cb6e45' - }, + }, { "currency": "DAI - Goerli", - "amount": 100000000000000000, # 0.1 dai + "amount": 100000000000000000, # 0.1 dai "signature": "0x3345154d1069fe35e0396366ef9d6960974d9351b3cd46b1c31420ba6549bea0092395380e9140ec7d158343b08a93b3dd6c41130b10c65a3d420cca0cfc5ccd1c", "transaction_hash": '0x196aaf0114721e1e94d661c903b2a7b957d25c936bf559d0eeca23d99914e3c7' }, ] + @pytest.mark.django_db( transaction=True, reset_sequences=True, @@ -211,6 +213,7 @@ def test_confirm_payment_lower_amount( }, # Has enough amount, but in DAI ] + @pytest.mark.django_db( transaction=True, reset_sequences=True,