diff --git a/.github/workflows/build-macos-installer.yml b/.github/workflows/build-macos-installer.yml index cf653aaf85d6..b01cfcdb5e91 100644 --- a/.github/workflows/build-macos-installer.yml +++ b/.github/workflows/build-macos-installer.yml @@ -23,13 +23,13 @@ jobs: build: name: MacOS Intel Installer runs-on: ${{ matrix.os }} - timeout-minutes: 40 + timeout-minutes: 50 strategy: fail-fast: false max-parallel: 4 matrix: python-version: [3.9] - os: [macos-10.15] + os: [macos-11] steps: - name: Checkout Code diff --git a/CHANGELOG.md b/CHANGELOG.md index be27fed09175..1ce3c22f840c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -295,4 +295,4 @@ There is a known issue where harvesters will not reconnect to the farmer automat # -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project does not yet adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) for setuptools_scm/PEP 440 reasons. \ No newline at end of file +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project does not yet adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) for setuptools_scm/PEP 440 reasons. diff --git a/chinilla-blockchain-gui b/chinilla-blockchain-gui index ca0c0093e864..3ef553b382a2 160000 --- a/chinilla-blockchain-gui +++ b/chinilla-blockchain-gui @@ -1 +1 @@ -Subproject commit ca0c0093e8643c82e037c17db41311a15cd7b0dc +Subproject commit 3ef553b382a22985a7830504d58f64dc9e5238f8 diff --git a/chinilla/rpc/wallet_rpc_api.py b/chinilla/rpc/wallet_rpc_api.py index 013e879c9fc0..811e796a30b3 100644 --- a/chinilla/rpc/wallet_rpc_api.py +++ b/chinilla/rpc/wallet_rpc_api.py @@ -1067,7 +1067,8 @@ async def create_offer_for_ids(self, request): trade_record, error, ) = await self.service.wallet_state_manager.trade_manager.create_offer_for_ids( - modified_offer, driver_dict, fee=fee, validate_only=validate_only, min_coin_amount=min_coin_amount) + modified_offer, driver_dict, fee=fee, validate_only=validate_only, min_coin_amount=min_coin_amount + ) if success: return { "offer": Offer.from_bytes(trade_record.offer).to_bech32(), @@ -1098,11 +1099,9 @@ async def take_offer(self, request): min_coin_amount: uint128 = uint128(request.get("min_coin_amount", 0)) async with self.service.wallet_state_manager.lock: - ( - success, - trade_record, - error, - ) = await self.service.wallet_state_manager.trade_manager.respond_to_offer(offer, fee=fee, min_coin_amount=min_coin_amount) + (success, trade_record, error,) = await self.service.wallet_state_manager.trade_manager.respond_to_offer( + offer, fee=fee, min_coin_amount=min_coin_amount + ) if not success: raise ValueError(error) return {"trade_record": trade_record.to_json_dict_convenience()} diff --git a/chinilla/util/files.py b/chinilla/util/files.py index b122132ca83a..893d79aa3543 100644 --- a/chinilla/util/files.py +++ b/chinilla/util/files.py @@ -3,7 +3,7 @@ import os import shutil -from aiofiles import tempfile # type: ignore +from aiofiles import tempfile from pathlib import Path from typing import Union @@ -68,7 +68,7 @@ async def write_file_async(file_path: Path, data: Union[str, bytes], *, file_mod mode: str = "w+" if type(data) == str else "w+b" temp_file_path: Path - async with tempfile.NamedTemporaryFile(dir=file_path.parent, mode=mode, delete=False) as f: + async with tempfile.NamedTemporaryFile(dir=file_path.parent, mode=mode, delete=False) as f: # type: ignore temp_file_path = f.name await f.write(data) await f.flush() diff --git a/chinilla/wallet/trade_manager.py b/chinilla/wallet/trade_manager.py index 21d9d8ac5326..658b0702200d 100644 --- a/chinilla/wallet/trade_manager.py +++ b/chinilla/wallet/trade_manager.py @@ -301,7 +301,9 @@ async def create_offer_for_ids( ) -> Tuple[bool, Optional[TradeRecord], Optional[str]]: if driver_dict is None: driver_dict = {} - success, created_offer, error = await self._create_offer_for_ids(offer, driver_dict, fee=fee, min_coin_amount=min_coin_amount) + success, created_offer, error = await self._create_offer_for_ids( + offer, driver_dict, fee=fee, min_coin_amount=min_coin_amount + ) if not success or created_offer is None: raise Exception(f"Error creating offer: {error}") now = uint64(int(time.time())) @@ -583,7 +585,9 @@ async def calculate_tx_records_for_offer(self, offer: Offer, validate: bool) -> return txs - async def respond_to_offer(self, offer: Offer, fee=uint64(0), min_coin_amount: Optional[uint128] = None) -> Tuple[bool, Optional[TradeRecord], Optional[str]]: + async def respond_to_offer( + self, offer: Offer, fee=uint64(0), min_coin_amount: Optional[uint128] = None + ) -> Tuple[bool, Optional[TradeRecord], Optional[str]]: take_offer_dict: Dict[Union[bytes32, int], int] = {} arbitrage: Dict[Optional[bytes32], int] = offer.arbitrage() @@ -606,7 +610,9 @@ async def respond_to_offer(self, offer: Offer, fee=uint64(0), min_coin_amount: O valid: bool = await self.check_offer_validity(offer) if not valid: return False, None, "This offer is no longer valid" - success, take_offer, error = await self._create_offer_for_ids(take_offer_dict, offer.driver_dict, fee=fee, min_coin_amount=min_coin_amount) + success, take_offer, error = await self._create_offer_for_ids( + take_offer_dict, offer.driver_dict, fee=fee, min_coin_amount=min_coin_amount + ) if not success or take_offer is None: return False, None, error diff --git a/tests/wallet/test_wallet.py b/tests/wallet/test_wallet.py index 9a4636a8f697..e11949c8d52b 100644 --- a/tests/wallet/test_wallet.py +++ b/tests/wallet/test_wallet.py @@ -922,7 +922,9 @@ def test_get_wallet_db_path_v2_r1() -> None: fingerprint: str = "1234567890" wallet_db_path: Path = get_wallet_db_path(root_path, config, fingerprint) - assert wallet_db_path == Path("/x/y/z/.chinilla/vanillanet/wallet/db/blockchain_wallet_v2_r1_vanillanet_1234567890.sqlite") + assert wallet_db_path == Path( + "/x/y/z/.chinilla/vanillanet/wallet/db/blockchain_wallet_v2_r1_vanillanet_1234567890.sqlite" + ) def test_get_wallet_db_path_v2() -> None: @@ -934,7 +936,9 @@ def test_get_wallet_db_path_v2() -> None: fingerprint: str = "1234567890" wallet_db_path: Path = get_wallet_db_path(root_path, config, fingerprint) - assert wallet_db_path == Path("/x/y/z/.chinilla/vanillanet/wallet/db/blockchain_wallet_v2_r1_vanillanet_1234567890.sqlite") + assert wallet_db_path == Path( + "/x/y/z/.chinilla/vanillanet/wallet/db/blockchain_wallet_v2_r1_vanillanet_1234567890.sqlite" + ) def test_get_wallet_db_path_v1() -> None: @@ -946,7 +950,9 @@ def test_get_wallet_db_path_v1() -> None: fingerprint: str = "1234567890" wallet_db_path: Path = get_wallet_db_path(root_path, config, fingerprint) - assert wallet_db_path == Path("/x/y/z/.chinilla/vanillanet/wallet/db/blockchain_wallet_v2_r1_vanillanet_1234567890.sqlite") + assert wallet_db_path == Path( + "/x/y/z/.chinilla/vanillanet/wallet/db/blockchain_wallet_v2_r1_vanillanet_1234567890.sqlite" + ) def test_get_wallet_db_path_testnet() -> None: @@ -958,4 +964,6 @@ def test_get_wallet_db_path_testnet() -> None: fingerprint: str = "1234567890" wallet_db_path: Path = get_wallet_db_path(root_path, config, fingerprint) - assert wallet_db_path == Path("/x/y/z/.chinilla/testnet/wallet/db/blockchain_wallet_v2_r1_testnet_1234567890.sqlite") + assert wallet_db_path == Path( + "/x/y/z/.chinilla/testnet/wallet/db/blockchain_wallet_v2_r1_testnet_1234567890.sqlite" + )