Skip to content

Commit 96fa6db

Browse files
authored
Merge pull request #256 from BoostryJP/fix/#255
fix: automatic approval notification
2 parents b56d34a + abd3ce7 commit 96fa6db

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

batch/indexer_transfer_approval.py

+8
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
from app.model.db import (
4343
Token,
4444
TokenType,
45+
AdditionalTokenInfo,
4546
IDXTransferApproval,
4647
IDXTransferApprovalBlockNumber,
4748
Notification,
@@ -534,6 +535,13 @@ def __register_notification(self, transaction_hash, token_address, exchange_addr
534535
first()
535536
sender = web3.eth.getTransaction(transaction_hash)["from"]
536537
if token is not None and token.issuer_address != sender:
538+
if notice_code == 0: # ApplyFor
539+
_additional_info = self.db.query(AdditionalTokenInfo). \
540+
filter(AdditionalTokenInfo.token_address == token_address). \
541+
first()
542+
if _additional_info is None or _additional_info.is_manual_transfer_approval is not True:
543+
# SKIP Automatic approval
544+
return
537545
self.sink.on_info_notification(
538546
issuer_address=token.issuer_address,
539547
code=notice_code,

0 commit comments

Comments
 (0)