Skip to content

Commit

Permalink
Version 1.12.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNaif2018 committed Aug 12, 2023
1 parent eb5461a commit 09ecebf
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ repos:
hooks:
- id: check-merge-conflict
- repo: https://github.com/asottile/yesqa
rev: v1.4.0
rev: v1.5.0
hooks:
- id: yesqa
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.10.1
hooks:
- id: pyupgrade
args: ["--py38-plus"]
Expand Down Expand Up @@ -48,6 +48,6 @@ repos:
args: ["--remove"]
- id: detect-private-key
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.6
rev: v3.0.1
hooks:
- id: prettier
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Latest changes

## 1.12.1.0

Electrums upgrade to 4.4.5

## 1.12.0.0

Breaking: removed `rate` and `list_fiat` commands.
Expand Down
1 change: 1 addition & 0 deletions bitcart/coins/bch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class BCH(BTC):
friendly_name = "Bitcoin Cash"
RPC_URL = "http://localhost:5004"
AMOUNT_FIELD = "amount (BCH)"
EXPIRATION_KEY = "expiration"

async def history(self) -> dict: # pragma: no cover
return await self.server.history() # type: ignore
Expand Down
5 changes: 3 additions & 2 deletions bitcart/coins/btc.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class BTC(Coin, EventDelivery):
RPC_PASS = "electrumz"
ALLOWED_EVENTS = ["new_block", "new_transaction", "new_payment", "verified_tx"]
BALANCE_ATTRS = ["confirmed", "unconfirmed", "unmatured", "lightning"]
EXPIRATION_KEY = "expiry"
is_eth_based = False
additional_xpub_fields: List[str] = []

Expand Down Expand Up @@ -155,7 +156,7 @@ async def _add_request_base(
extra_kwargs: dict = {},
) -> dict:
expiration = 60 * expire if expire else None
kwargs = {"amount": amount, "memo": description, "expiration": expiration}
kwargs = {"amount": amount, "memo": description, self.EXPIRATION_KEY: expiration}
kwargs.update(extra_kwargs)
data = await method(**kwargs)
return await self._convert_amounts(data)
Expand Down Expand Up @@ -608,7 +609,7 @@ async def get_invoice(self, rhash: str) -> dict:
Example:
>>> c.get_invoice("e34d7fb4cda66e0760fc193496c302055d0fd960cfd982432355c8bfeecd5f33")
{'is_lightning': True, 'amount_BTC': Decimal('0.5'), 'timestamp': 1619273042, 'expiration': 900, ...
{'is_lightning': True, 'amount_BTC': Decimal('0.5'), 'timestamp': 1619273042, 'expiry': 900, ...
Args:
rhash (str): invoice rhash
Expand Down
1 change: 1 addition & 0 deletions bitcart/coins/eth.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class ETH(BTC):
friendly_name = "Ethereum"
RPC_URL = "http://localhost:5002"
ALLOWED_EVENTS = ["new_block", "new_transaction", "new_payment"]
EXPIRATION_KEY = "expiration"
is_eth_based = True

async def history(self) -> dict: # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name="bitcart",
packages=find_packages(),
version="1.12.0.0",
version="1.12.1.0",
license="MIT",
description="BitcartCC coins support library",
long_description=open("README.md").read(),
Expand Down
4 changes: 2 additions & 2 deletions tests/coins/btc/test_lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ async def test_add_invoice(btc_wallet):
}.items()
)
data_check(invoice, "timestamp", int)
data_check(invoice, "expiration", int)
data_check(invoice, "expiry", int)
data_check(invoice, "rhash", str)
data_check(invoice, "lightning_invoice", str)
assert invoice["expiration"] - invoice["timestamp"] == 900
assert invoice["expiry"] == 900
got_invoice = await btc_wallet.get_invoice(invoice["rhash"])
assert got_invoice == invoice

Expand Down
4 changes: 2 additions & 2 deletions tests/coins/btc/test_with_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ async def test_payment_request(btc_wallet):
}.items()
)
data_check(request1, "timestamp", int)
data_check(request1, "expiration", int)
data_check(request1, "expiry", int)
data_check(request1, "address", str)
data_check(request1, "URI", str)
assert request1["expiration"] - request1["timestamp"] == 900
assert request1["expiry"] == 900


async def test_insufficient_funds_pay(btc_wallet):
Expand Down
1 change: 0 additions & 1 deletion tests/regtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ async def test_list_peers(regtest_wallet, regtest_node_id): # running on regtes
assert peer["node_id"] == regtest_node_id.split("@")[0]
data_check(peer, "address", str)
data_check(peer, "features", str)
assert "LnFeatures." in peer["features"]
data_check(peer, "channels", list, 0)


Expand Down

0 comments on commit 09ecebf

Please sign in to comment.