Skip to content

Commit

Permalink
fix find_matching_payment_op() bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeUrban committed Oct 19, 2020
1 parent 0f5ab5f commit 7d18082
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ DJANGO_SECRET_KEY=notsosecretkey\

# Install dependencies
WORKDIR /code
RUN pip install pipenv; pipenv lock --clear; pipenv install --dev --system
RUN pip install pipenv; pipenv install --dev --system

# collect static assets
RUN python manage.py collectstatic --no-input --ignore=*.scss
Expand Down
6 changes: 1 addition & 5 deletions polaris/polaris/management/commands/watch_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,11 @@ def find_matching_payment_op(
:param horizon_tx: the decoded Transaction object contained in the Horizon response
:param transaction: a database model object representing the transaction
"""
if horizon_tx.source.public_key != transaction.stellar_account:
# transaction wasn't created by sender of payment
return

matching_payment_op = None
for operation in horizon_tx.operations:
if cls._check_payment_op(operation, transaction.asset):
transaction.stellar_transaction_id = response["id"]
transaction.from_address = horizon_tx.source.public_key
transaction.from_address = operation.source
transaction.paging_token = response["paging_token"]
transaction.status_eta = 0
transaction.save()
Expand Down
1 change: 1 addition & 0 deletions polaris/polaris/tests/processes/test_watch_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
amount=50,
destination=Keypair.from_secret(USD_DISTRIBUTION_SEED).public_key,
type_code=Mock(return_value=1),
source="GCUZ6YLL5RQBTYLTTQLPCM73C5XAIUGK2TIMWQH7HPSGWVS2KJ2F3CHS",
)
],
source=Keypair.from_public_key(
Expand Down

0 comments on commit 7d18082

Please sign in to comment.