Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNaif2018 committed Feb 19, 2024
1 parent c6bdbfe commit 945c87d
Show file tree
Hide file tree
Showing 21 changed files with 958 additions and 948 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos:
hooks:
- id: yesqa
- repo: https://github.com/psf/black
rev: 24.1.1
rev: 24.2.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
Expand All @@ -20,7 +20,7 @@ repos:
hooks:
- id: flake8
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.15.1
hooks:
- id: pyupgrade
args: ["--py38-plus"]
Expand Down
12 changes: 7 additions & 5 deletions api/invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ def get_pending_invoice_statuses(statuses=None):

def get_pending_invoices_query(currency, statuses=None):
return (
select([
models.PaymentMethod,
models.Invoice,
models.Wallet,
])
select(
[
models.PaymentMethod,
models.Invoice,
models.Wallet,
]
)
.where(models.PaymentMethod.invoice_id == models.Invoice.id)
.where(models.PaymentMethod.wallet_id == models.Wallet.id)
.where(get_pending_invoice_statuses(statuses=statuses))
Expand Down
24 changes: 13 additions & 11 deletions api/views/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,20 @@ class InvoiceNotify(GenericWebsocketEndpoint):

async def maybe_exit_early(self, websocket):
if self.object.status in [InvoiceStatus.EXPIRED, InvoiceStatus.COMPLETE]:
await websocket.send_json({
"status": self.object.status,
"exception_status": self.object.exception_status,
"sent_amount": currency_table.format_decimal(
"",
self.object.sent_amount,
divisibility=crud.invoices.find_sent_amount_divisibility(
self.object.id, self.object.payments, self.object.paid_currency
await websocket.send_json(
{
"status": self.object.status,
"exception_status": self.object.exception_status,
"sent_amount": currency_table.format_decimal(
"",
self.object.sent_amount,
divisibility=crud.invoices.find_sent_amount_divisibility(
self.object.id, self.object.payments, self.object.paid_currency
),
),
),
"paid_currency": self.object.paid_currency,
})
"paid_currency": self.object.paid_currency,
}
)
await websocket.close()
return True
return False
20 changes: 11 additions & 9 deletions daemons/eth.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,15 +657,17 @@ async def writecontract(self, address, function, *args, **kwargs):
multiplier = kwargs.pop("speed_multiplier", None)
exec_function = await self.load_contract_exec_function(address, function, *args, **kwargs)
# pass gas here to avoid calling estimate_gas on an incomplete tx
tx = await exec_function.build_transaction({
**await self.get_common_payto_params(
self.wallets[wallet].address,
nonce=nonce,
gas_price=gas_price,
multiplier=multiplier,
),
"gas": TX_DEFAULT_GAS,
})
tx = await exec_function.build_transaction(
{
**await self.get_common_payto_params(
self.wallets[wallet].address,
nonce=nonce,
gas_price=gas_price,
multiplier=multiplier,
),
"gas": TX_DEFAULT_GAS,
}
)
tx["gas"] = int(gas) if gas else await self.get_default_gas(tx)
if unsigned:
return tx
Expand Down
8 changes: 5 additions & 3 deletions daemons/trx.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,11 @@ def add_privkey(self, privkey):


TRON_ALIASES = ETHDaemon.ALIASES
TRON_ALIASES.update({
"get_default_energy": "get_default_gas",
})
TRON_ALIASES.update(
{
"get_default_energy": "get_default_gas",
}
)


class TRXDaemon(ETHDaemon):
Expand Down
12 changes: 6 additions & 6 deletions requirements/deterministic/daemons/bch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ charset-normalizer==3.3.2 \
--hash=sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519 \
--hash=sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561
# via requests
dnspython==2.5.0 \
--hash=sha256:6facdf76b73c742ccf2d07add296f178e629da60be23ce4b0a9c927b1e02c3a6 \
--hash=sha256:a0034815a59ba9ae888946be7ccca8f7c157b286f8455b379c692efb51022a15
dnspython==2.6.1 \
--hash=sha256:5ef3b9680161f6fa89daf8ad451b5f1a33b18ae8a1c6778cdf4b43f08c0a6e50 \
--hash=sha256:e8f0f9c23a7b7cb99ded64e6c3a6f3e701d78f50c55e002b839dea7225cff7cc
# via electron-cash
ecdsa==0.18.0 \
--hash=sha256:190348041559e21b22a1d65cee485282ca11a6f81d503fddb84d5017e9ed1e49 \
Expand Down Expand Up @@ -467,9 +467,9 @@ typing-extensions==4.9.0 \
--hash=sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 \
--hash=sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd
# via qrcode
urllib3==2.2.0 \
--hash=sha256:051d961ad0c62a94e50ecf1af379c3aba230c66c710493493560c0c223c49f20 \
--hash=sha256:ce3711610ddce217e6d113a2732fafad960a03fd0318c91faa79481e35c11224
urllib3==2.2.1 \
--hash=sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d \
--hash=sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19
# via requests
yarl==1.9.4 \
--hash=sha256:008d3e808d03ef28542372d01057fd09168419cdc8f848efe2804f894ae03e51 \
Expand Down
Loading

0 comments on commit 945c87d

Please sign in to comment.