Skip to content

Commit d223c6c

Browse files
committed
chore: updated files for ruff update
1 parent a09abc0 commit d223c6c

File tree

9 files changed

+16
-23
lines changed

9 files changed

+16
-23
lines changed

src/algokit_utils/_legacy_v2/account.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333

3434
@deprecated(
35-
"Use `algorand.account.from_mnemonic()` instead. Example: " "`account = algorand.account.from_mnemonic(mnemonic)`"
35+
"Use `algorand.account.from_mnemonic()` instead. Example: `account = algorand.account.from_mnemonic(mnemonic)`"
3636
)
3737
def get_account_from_mnemonic(mnemonic: str) -> Account:
3838
"""Convert a mnemonic (25 word passphrase) into an Account"""
@@ -127,7 +127,7 @@ def get_dispenser_account(client: "AlgodClient") -> Account:
127127

128128

129129
@deprecated(
130-
"Use `algorand.account.from_kmd()` instead. Example: " "`account = algorand.account.from_kmd(name, predicate)`"
130+
"Use `algorand.account.from_kmd()` instead. Example: `account = algorand.account.from_kmd(name, predicate)`"
131131
)
132132
def get_kmd_wallet_account(
133133
client: "AlgodClient",

src/algokit_utils/_legacy_v2/application_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,7 @@ def prepare(
243243
"""Creates a copy of this ApplicationClient, using the new signer, sender and app_id values if provided.
244244
Will also substitute provided template_values into the associated app_spec in the copy"""
245245
new_client: ApplicationClient = copy.copy(self)
246-
new_client._prepare( # noqa: SLF001
247-
new_client, signer=signer, sender=sender, app_id=app_id, template_values=template_values
248-
)
246+
new_client._prepare(new_client, signer=signer, sender=sender, app_id=app_id, template_values=template_values)
249247
return new_client
250248

251249
def _prepare(

src/algokit_utils/_legacy_v2/deploy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,7 @@ def _deploy_update(self) -> DeployResponse:
641641
elif self.on_update == OnUpdate.ReplaceApp:
642642
if self.existing_app_metadata_or_reference.updatable is False:
643643
logger.warning(
644-
"App is not updatable and on_update=ReplaceApp, "
645-
"will attempt to create new app and delete old app"
644+
"App is not updatable and on_update=ReplaceApp, will attempt to create new app and delete old app"
646645
)
647646
else:
648647
logger.warning(

src/algokit_utils/applications/app_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,7 @@ def _get_abi_args_with_default_values( # noqa: C901, PLR0912
20472047
if not value:
20482048
raise ValueError(
20492049
f"Key '{default_value.data}' not found in {default_value.source} "
2050-
f"storage for argument {method_arg.name or f'arg{i+1}'}"
2050+
f"storage for argument {method_arg.name or f'arg{i + 1}'}"
20512051
)
20522052

20532053
if value.value_raw:
@@ -2065,7 +2065,7 @@ def _get_abi_args_with_default_values( # noqa: C901, PLR0912
20652065
elif not algosdk.abi.is_abi_transaction_type(method_arg.type):
20662066
raise ValueError(
20672067
f"No value provided for required argument "
2068-
f"{method_arg.name or f'arg{i+1}'} in call to method {method.name}"
2068+
f"{method_arg.name or f'arg{i + 1}'} in call to method {method.name}"
20692069
)
20702070
elif arg_value is None and default_value is None:
20712071
# At this point only allow explicit None values if no default value was identified

src/algokit_utils/applications/app_deployer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def deploy(self, deployment: AppDeployParams) -> AppDeployResult:
239239
suppress_log = send_params.get("suppress_log") or False
240240

241241
config.logger.info(
242-
f"Idempotently deploying app \"{deployment.metadata.name}\" from creator "
242+
f'Idempotently deploying app "{deployment.metadata.name}" from creator '
243243
f"{deployment.create_params.sender} using {len(deployment.create_params.approval_program)} bytes of "
244244
f"{'teal code' if isinstance(deployment.create_params.approval_program, str) else 'AVM bytecode'} and "
245245
f"{len(deployment.create_params.clear_state_program)} bytes of "
@@ -623,8 +623,7 @@ def _handle_update(
623623

624624
if deployment.on_update in (OnUpdate.Fail, "fail") or deployment.on_update is None:
625625
raise ValueError(
626-
"Update detected and on_update=Fail, stopping deployment. "
627-
"Try a different on_update value to not fail."
626+
"Update detected and on_update=Fail, stopping deployment. Try a different on_update value to not fail."
628627
)
629628

630629
if deployment.on_update in (OnUpdate.AppendApp, "append"):

src/algokit_utils/applications/app_factory.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,13 +1122,12 @@ def _get_create_abi_args_with_default_values(
11221122
results.append(decoded_value)
11231123
else:
11241124
raise ValueError(
1125-
f"Cannot provide default value from source={default_value.source} "
1126-
"for a contract creation call."
1125+
f"Cannot provide default value from source={default_value.source} for a contract creation call."
11271126
)
11281127
else:
11291128
param_name = param.name or f"arg{i + 1}"
11301129
raise ValueError(
1131-
f"No value provided for required argument {param_name} " f"in call to method {method.name}"
1130+
f"No value provided for required argument {param_name} in call to method {method.name}"
11321131
)
11331132

11341133
return results

src/algokit_utils/transactions/transaction_composer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
TransactionSigner,
1818
TransactionWithSigner,
1919
)
20-
from algosdk.transaction import ApplicationCallTxn, OnComplete, SuggestedParams
20+
from algosdk.transaction import OnComplete, SuggestedParams
2121
from algosdk.v2client.algod import AlgodClient
2222
from algosdk.v2client.models.simulate_request import SimulateRequest
2323
from typing_extensions import deprecated
@@ -1833,8 +1833,7 @@ def send(
18331833
group = self.build().transactions
18341834

18351835
if not params:
1836-
has_app_call = any(isinstance(txn.txn, ApplicationCallTxn) for txn in group)
1837-
params = SendParams() if has_app_call else SendParams()
1836+
params = SendParams()
18381837

18391838
cover_app_call_inner_transaction_fees = params.get("cover_app_call_inner_transaction_fees")
18401839
populate_app_call_resources = params.get("populate_app_call_resources")

src/algokit_utils/transactions/transaction_sender.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,8 +650,7 @@ def asset_opt_in(
650650
return self._send(
651651
lambda c: c.add_asset_opt_in,
652652
pre_log=lambda params, transaction: (
653-
f"Opting in {params.sender} to asset with ID {params.asset_id} via transaction "
654-
f"{transaction.get_txid()}"
653+
f"Opting in {params.sender} to asset with ID {params.asset_id} via transaction {transaction.get_txid()}"
655654
),
656655
)(params, send_params)
657656

@@ -714,7 +713,7 @@ def asset_opt_out(
714713
)
715714
except Exception as e:
716715
raise ValueError(
717-
f"Account {params.sender} is not opted-in to Asset {params.asset_id}; " "can't opt-out."
716+
f"Account {params.sender} is not opted-in to Asset {params.asset_id}; can't opt-out."
718717
) from e
719718

720719
if not hasattr(params, "creator"):

tests/test_debug_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def test_simulate_response_filename_generation(
255255
sender=funded_account.address,
256256
receiver=client_fixture.app_address,
257257
amount=AlgoAmount.from_micro_algo(1_000_000 * (i + 1)),
258-
note=f"Payment{i+1}".encode(),
258+
note=f"Payment{i + 1}".encode(),
259259
)
260260
)
261261

@@ -275,7 +275,7 @@ def test_simulate_response_filename_generation(
275275
atc.add_app_call_method_call(
276276
AppCallMethodCallParams(
277277
method=Method.from_signature("hello(string)string"),
278-
args=[f"test{i+1}"],
278+
args=[f"test{i + 1}"],
279279
sender=funded_account.address,
280280
app_id=client_fixture.app_id,
281281
)

0 commit comments

Comments
 (0)