Skip to content

Commit 09ecebf

Browse files
committed
Version 1.12.1.0
1 parent eb5461a commit 09ecebf

File tree

9 files changed

+19
-13
lines changed

9 files changed

+19
-13
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ repos:
44
hooks:
55
- id: check-merge-conflict
66
- repo: https://github.com/asottile/yesqa
7-
rev: v1.4.0
7+
rev: v1.5.0
88
hooks:
99
- id: yesqa
1010
- repo: https://github.com/psf/black
11-
rev: 23.3.0
11+
rev: 23.7.0
1212
hooks:
1313
- id: black
1414
- repo: https://github.com/pycqa/isort
1515
rev: 5.12.0
1616
hooks:
1717
- id: isort
1818
- repo: https://github.com/pycqa/flake8
19-
rev: 6.0.0
19+
rev: 6.1.0
2020
hooks:
2121
- id: flake8
2222
- repo: https://github.com/asottile/pyupgrade
23-
rev: v3.3.1
23+
rev: v3.10.1
2424
hooks:
2525
- id: pyupgrade
2626
args: ["--py38-plus"]
@@ -48,6 +48,6 @@ repos:
4848
args: ["--remove"]
4949
- id: detect-private-key
5050
- repo: https://github.com/pre-commit/mirrors-prettier
51-
rev: v3.0.0-alpha.6
51+
rev: v3.0.1
5252
hooks:
5353
- id: prettier

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Latest changes
44

5+
## 1.12.1.0
6+
7+
Electrums upgrade to 4.4.5
8+
59
## 1.12.0.0
610

711
Breaking: removed `rate` and `list_fiat` commands.

bitcart/coins/bch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class BCH(BTC):
88
friendly_name = "Bitcoin Cash"
99
RPC_URL = "http://localhost:5004"
1010
AMOUNT_FIELD = "amount (BCH)"
11+
EXPIRATION_KEY = "expiration"
1112

1213
async def history(self) -> dict: # pragma: no cover
1314
return await self.server.history() # type: ignore

bitcart/coins/btc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class BTC(Coin, EventDelivery):
3535
RPC_PASS = "electrumz"
3636
ALLOWED_EVENTS = ["new_block", "new_transaction", "new_payment", "verified_tx"]
3737
BALANCE_ATTRS = ["confirmed", "unconfirmed", "unmatured", "lightning"]
38+
EXPIRATION_KEY = "expiry"
3839
is_eth_based = False
3940
additional_xpub_fields: List[str] = []
4041

@@ -155,7 +156,7 @@ async def _add_request_base(
155156
extra_kwargs: dict = {},
156157
) -> dict:
157158
expiration = 60 * expire if expire else None
158-
kwargs = {"amount": amount, "memo": description, "expiration": expiration}
159+
kwargs = {"amount": amount, "memo": description, self.EXPIRATION_KEY: expiration}
159160
kwargs.update(extra_kwargs)
160161
data = await method(**kwargs)
161162
return await self._convert_amounts(data)
@@ -608,7 +609,7 @@ async def get_invoice(self, rhash: str) -> dict:
608609
Example:
609610
610611
>>> c.get_invoice("e34d7fb4cda66e0760fc193496c302055d0fd960cfd982432355c8bfeecd5f33")
611-
{'is_lightning': True, 'amount_BTC': Decimal('0.5'), 'timestamp': 1619273042, 'expiration': 900, ...
612+
{'is_lightning': True, 'amount_BTC': Decimal('0.5'), 'timestamp': 1619273042, 'expiry': 900, ...
612613
613614
Args:
614615
rhash (str): invoice rhash

bitcart/coins/eth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class ETH(BTC):
1010
friendly_name = "Ethereum"
1111
RPC_URL = "http://localhost:5002"
1212
ALLOWED_EVENTS = ["new_block", "new_transaction", "new_payment"]
13+
EXPIRATION_KEY = "expiration"
1314
is_eth_based = True
1415

1516
async def history(self) -> dict: # pragma: no cover

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
setup(
44
name="bitcart",
55
packages=find_packages(),
6-
version="1.12.0.0",
6+
version="1.12.1.0",
77
license="MIT",
88
description="BitcartCC coins support library",
99
long_description=open("README.md").read(),

tests/coins/btc/test_lightning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ async def test_add_invoice(btc_wallet):
2929
}.items()
3030
)
3131
data_check(invoice, "timestamp", int)
32-
data_check(invoice, "expiration", int)
32+
data_check(invoice, "expiry", int)
3333
data_check(invoice, "rhash", str)
3434
data_check(invoice, "lightning_invoice", str)
35-
assert invoice["expiration"] - invoice["timestamp"] == 900
35+
assert invoice["expiry"] == 900
3636
got_invoice = await btc_wallet.get_invoice(invoice["rhash"])
3737
assert got_invoice == invoice
3838

tests/coins/btc/test_with_wallet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ async def test_payment_request(btc_wallet):
5151
}.items()
5252
)
5353
data_check(request1, "timestamp", int)
54-
data_check(request1, "expiration", int)
54+
data_check(request1, "expiry", int)
5555
data_check(request1, "address", str)
5656
data_check(request1, "URI", str)
57-
assert request1["expiration"] - request1["timestamp"] == 900
57+
assert request1["expiry"] == 900
5858

5959

6060
async def test_insufficient_funds_pay(btc_wallet):

tests/regtest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ async def test_list_peers(regtest_wallet, regtest_node_id): # running on regtes
131131
assert peer["node_id"] == regtest_node_id.split("@")[0]
132132
data_check(peer, "address", str)
133133
data_check(peer, "features", str)
134-
assert "LnFeatures." in peer["features"]
135134
data_check(peer, "channels", list, 0)
136135

137136

0 commit comments

Comments
 (0)