Skip to content

Commit d21ada1

Browse files
committed
Linter complaints
1 parent e31a0a9 commit d21ada1

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

pretix_eth/management/commands/confirm_payments.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,35 +148,33 @@ def confirm_payments_for_event(self, event: Event, no_dry_run, log_verbosity=0):
148148
).value
149149
receipt_reciever = receipt.to.lower()
150150
correct_recipient = (
151-
receipt_reciever == signed_message.recipient_address.lower()
151+
receipt_reciever == signed_message.recipient_address.lower()
152152
)
153153

154154
else:
155155
# DAI
156156
contract = w3.eth.contract(address=token.ADDRESS,
157157
abi=TOKEN_ABI)
158158
transaction_details = (
159-
contract.events.Transfer().processReceipt(receipt)[
160-
0].args
159+
contract.events.Transfer().processReceipt(receipt)[0].args
161160
)
162161
payment_amount = transaction_details.value
163162
# check that the payment happened on the right contract address
164163
correct_contract = token.ADDRESS.lower() == receipt.to.lower()
165164
# take recipient address from the topics,
166165
# not from the "from" field, as that's the contract address
167-
receipt_reciever = receipt.logs[0].topics[2][
168-
12:].hex().lower()
166+
receipt_reciever = receipt.logs[0].topics[2][12:].hex().lower()
169167
correct_recipient = correct_contract and (
170-
receipt_reciever == signed_message.recipient_address.lower()
168+
receipt_reciever == signed_message.recipient_address.lower()
171169
)
172170

173171
receipt_sender = getattr(receipt, "from").lower()
174172
correct_sender = receipt_sender == signed_message.sender_address.lower()
175173

176174
if not (correct_sender and correct_recipient):
177175
logger.warning(
178-
f" * Transaction hash provided does not match "
179-
f"correct sender and recipient"
176+
" * Transaction hash provided does not match "
177+
"correct sender and recipient"
180178
)
181179
if log_verbosity > 0:
182180
logger.info(

pretix_eth/network/tokens.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ def get_balance_of_address(self, hex_wallet_address, rpc_url):
164164
)
165165
return token_contract.functions.balanceOf(checksum_address).call()
166166

167-
def get_transaction_link(self, transaction_hash: Optional[str]) -> Optional[
168-
str]:
167+
def get_transaction_link(self, transaction_hash: Optional[str]) -> Optional[str]:
169168
return "{base}/tx/{hash}".format(
170169
base=self.EIP3091_EXPLORER_URL,
171170
hash=transaction_hash,

0 commit comments

Comments
 (0)