Skip to content

Commit

Permalink
fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gokselcoban committed Apr 17, 2023
1 parent d4a1012 commit bf89824
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
install_requires=["py-algorand-sdk >= 1.10.0"],
packages=setuptools.find_packages(),
python_requires=">=3.8",
package_data={"tinyman.v1": ["asc.json"], "tinyman.v2": ["amm_approval.map.json", "swap_router_approval.map.json"]},
package_data={
"tinyman.v1": ["asc.json"],
"tinyman.v2": ["amm_approval.map.json", "swap_router_approval.map.json"],
},
include_package_data=True,
)
1 change: 0 additions & 1 deletion tests/swap_router/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ def test_algo_input_prepare_swap_router_transactions(self):
def test_indirect_route_prepare_swap_router_transactions_from_quotes(self):
sp = self.get_suggested_params()
user_private_key, user_address = generate_account()
router_app_address = get_application_address(self.ROUTER_APP_ID)
asset_in = AssetAmount(self.asset_in, 1_000_000)
asset_out = AssetAmount(self.asset_out, 2_000_000)
asset_intermediary = AssetAmount(self.intermediary_asset, 9_999_999)
Expand Down
10 changes: 6 additions & 4 deletions tinyman/swap_router/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
ApplicationNoOpTxn,
SuggestedParams,
)
from tinyman.swap_router.constants import CLAIM_EXTRA_APP_ARGUMENT, SET_MANAGER_APP_ARGUMENT, SET_EXTRA_COLLECTOR_APP_ARGUMENT
from tinyman.swap_router.constants import (
CLAIM_EXTRA_APP_ARGUMENT,
SET_MANAGER_APP_ARGUMENT,
SET_EXTRA_COLLECTOR_APP_ARGUMENT,
)
from tinyman.utils import TransactionGroup


Expand All @@ -22,7 +26,7 @@ def prepare_claim_extra_transactions(
index=router_app_id,
app_args=[CLAIM_EXTRA_APP_ARGUMENT],
foreign_assets=asset_ids,
note=app_call_note
note=app_call_note,
)
min_fee = suggested_params.min_fee
inner_transaction_count = len(asset_ids)
Expand Down Expand Up @@ -72,5 +76,3 @@ def prepare_set_extra_collector_transactions(
]
txn_group = TransactionGroup(txns)
return txn_group


8 changes: 6 additions & 2 deletions tinyman/swap_router/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

from tinyman.assets import Asset, AssetAmount
from tinyman.compat import SuggestedParams
from tinyman.exceptions import PoolHasNoLiquidity, InsufficientReserves, LowSwapAmountError
from tinyman.exceptions import (
PoolHasNoLiquidity,
InsufficientReserves,
LowSwapAmountError,
)
from tinyman.utils import TransactionGroup
from tinyman.swap_router.constants import FIXED_INPUT_SWAP_TYPE, FIXED_OUTPUT_SWAP_TYPE
from tinyman.v1.pools import Pool as TinymanV1Pool
Expand Down Expand Up @@ -196,7 +200,7 @@ def get_transaction_count(cls, quotes) -> int:
2: {
FIXED_INPUT_SWAP_TYPE: 8,
FIXED_OUTPUT_SWAP_TYPE: 9,
}
},
}

swap_count = len(quotes)
Expand Down
11 changes: 8 additions & 3 deletions tinyman/v2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from base64 import b64decode

import tinyman.v2
from tinyman.swap_router.constants import TESTNET_SWAP_ROUTER_APP_ID_V1, MAINNET_SWAP_ROUTER_APP_ID_V1
from tinyman.swap_router.constants import (
TESTNET_SWAP_ROUTER_APP_ID_V1,
MAINNET_SWAP_ROUTER_APP_ID_V1,
)
from tinyman.tealishmap import TealishMap
from tinyman.utils import bytes_to_int
from tinyman.v2.constants import TESTNET_VALIDATOR_APP_ID, MAINNET_VALIDATOR_APP_ID
Expand All @@ -31,7 +34,9 @@
json.loads(importlib.resources.read_text(tinyman.v2, "amm_approval.map.json"))
)
swap_router_tealishmap = TealishMap(
json.loads(importlib.resources.read_text(tinyman.v2, "swap_router_approval.map.json"))
json.loads(
importlib.resources.read_text(tinyman.v2, "swap_router_approval.map.json")
)
)


Expand Down Expand Up @@ -74,7 +79,7 @@ def get_tealishmap(app_id):
TESTNET_VALIDATOR_APP_ID: amm_tealishmap,
MAINNET_VALIDATOR_APP_ID: amm_tealishmap,
TESTNET_SWAP_ROUTER_APP_ID_V1: swap_router_tealishmap,
MAINNET_SWAP_ROUTER_APP_ID_V1: swap_router_tealishmap
MAINNET_SWAP_ROUTER_APP_ID_V1: swap_router_tealishmap,
}
return maps.get(app_id)

Expand Down

0 comments on commit bf89824

Please sign in to comment.