Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions algosdk/abi/tuple_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ def decode(self, bytestring: Union[bytes, bytearray]) -> list:
"value string must be in bytes: {}".format(bytestring)
)
tuple_elements = self.child_types
dynamic_segments: List[
List[int]
] = list() # Store the start and end of a dynamic element
dynamic_segments: List[List[int]] = (
list()
) # Store the start and end of a dynamic element
value_partitions: List[Optional[Union[bytes, bytearray]]] = list()
i = 0
array_index = 0
Expand Down
6 changes: 3 additions & 3 deletions algosdk/atomic_transaction_composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,9 +679,9 @@ def gather_signatures(self) -> List[GenericSignedTransaction]:
stxn_list: List[Optional[GenericSignedTransaction]] = [None] * len(
self.txn_list
)
signer_indexes: Dict[
TransactionSigner, List[int]
] = {} # Map a signer to a list of indices to sign
signer_indexes: Dict[TransactionSigner, List[int]] = (
{}
) # Map a signer to a list of indices to sign
txn_list = self.build_group()
for i, txn_with_signer in enumerate(txn_list):
if txn_with_signer.signer not in signer_indexes:
Expand Down
67 changes: 36 additions & 31 deletions algosdk/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ def undictify(d):
"sender": encoding.encode_address(d["snd"]),
"note": d["note"] if "note" in d else None,
"lease": d["lx"] if "lx" in d else None,
"rekey_to": encoding.encode_address(d["rekey"])
if "rekey" in d
else None,
"rekey_to": (
encoding.encode_address(d["rekey"]) if "rekey" in d else None
),
}
txn_type = d["type"]
if not isinstance(d["type"], str):
Expand Down Expand Up @@ -394,13 +394,15 @@ def dictify(self):
@staticmethod
def _undictify(d):
args = {
"close_remainder_to": encoding.encode_address(d["close"])
if "close" in d
else None,
"close_remainder_to": (
encoding.encode_address(d["close"]) if "close" in d else None
),
"amt": d["amt"] if "amt" in d else 0,
"receiver": encoding.encode_address(d["rcv"])
if "rcv" in d
else constants.ZERO_ADDRESS,
"receiver": (
encoding.encode_address(d["rcv"])
if "rcv" in d
else constants.ZERO_ADDRESS
),
}
return args

Expand Down Expand Up @@ -1169,7 +1171,6 @@ def __init__(


class AssetFreezeTxn(Transaction):

"""
Represents a transaction for freezing or unfreezing an account's asset
holdings. Must be issued by the asset's freeze manager.
Expand Down Expand Up @@ -1367,17 +1368,19 @@ def dictify(self):
@staticmethod
def _undictify(d):
args = {
"receiver": encoding.encode_address(d["arcv"])
if "arcv" in d
else constants.ZERO_ADDRESS,
"receiver": (
encoding.encode_address(d["arcv"])
if "arcv" in d
else constants.ZERO_ADDRESS
),
"amt": d["aamt"] if "aamt" in d else 0,
"index": d["xaid"] if "xaid" in d else None,
"close_assets_to": encoding.encode_address(d["aclose"])
if "aclose" in d
else None,
"revocation_target": encoding.encode_address(d["asnd"])
if "asnd" in d
else None,
"close_assets_to": (
encoding.encode_address(d["aclose"]) if "aclose" in d else None
),
"revocation_target": (
encoding.encode_address(d["asnd"]) if "asnd" in d else None
),
}

return args
Expand Down Expand Up @@ -1685,22 +1688,24 @@ def _undictify(d):
args = {
"index": d["apid"] if "apid" in d else None,
"on_complete": d["apan"] if "apan" in d else None,
"local_schema": StateSchema.undictify(d["apls"])
if "apls" in d
else None,
"global_schema": StateSchema.undictify(d["apgs"])
if "apgs" in d
else None,
"local_schema": (
StateSchema.undictify(d["apls"]) if "apls" in d else None
),
"global_schema": (
StateSchema.undictify(d["apgs"]) if "apgs" in d else None
),
"approval_program": d["apap"] if "apap" in d else None,
"clear_program": d["apsu"] if "apsu" in d else None,
"app_args": d["apaa"] if "apaa" in d else None,
"accounts": d["apat"] if "apat" in d else None,
"foreign_apps": d["apfa"] if "apfa" in d else None,
"foreign_assets": d["apas"] if "apas" in d else None,
"extra_pages": d["apep"] if "apep" in d else 0,
"boxes": [BoxReference.undictify(box) for box in d["apbx"]]
if "apbx" in d
else None,
"boxes": (
[BoxReference.undictify(box) for box in d["apbx"]]
if "apbx" in d
else None
),
}
if args["accounts"]:
args["accounts"] = [
Expand Down Expand Up @@ -2303,9 +2308,9 @@ def merge(
for s in range(len(stx.multisig.subsigs)):
if stx.multisig.subsigs[s].signature:
if not msigstx.multisig.subsigs[s].signature:
msigstx.multisig.subsigs[
s
].signature = stx.multisig.subsigs[s].signature
msigstx.multisig.subsigs[s].signature = (
stx.multisig.subsigs[s].signature
)
elif (
not msigstx.multisig.subsigs[s].signature
== stx.multisig.subsigs[s].signature
Expand Down
8 changes: 5 additions & 3 deletions algosdk/v2client/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,11 @@ def dictify(self):
elif isinstance(value, dict):
result[oas_attr] = dict(
map(
lambda item: (item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item,
lambda item: (
(item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item
),
value.items(),
)
)
Expand Down
8 changes: 5 additions & 3 deletions algosdk/v2client/models/account_participation.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,11 @@ def dictify(self):
elif isinstance(value, dict):
result[oas_attr] = dict(
map(
lambda item: (item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item,
lambda item: (
(item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item
),
value.items(),
)
)
Expand Down
8 changes: 5 additions & 3 deletions algosdk/v2client/models/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ def dictify(self):
elif isinstance(value, dict):
result[oas_attr] = dict(
map(
lambda item: (item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item,
lambda item: (
(item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item
),
value.items(),
)
)
Expand Down
8 changes: 5 additions & 3 deletions algosdk/v2client/models/application_local_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ def dictify(self):
elif isinstance(value, dict):
result[oas_attr] = dict(
map(
lambda item: (item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item,
lambda item: (
(item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item
),
value.items(),
)
)
Expand Down
8 changes: 5 additions & 3 deletions algosdk/v2client/models/application_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,11 @@ def dictify(self):
elif isinstance(value, dict):
result[oas_attr] = dict(
map(
lambda item: (item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item,
lambda item: (
(item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item
),
value.items(),
)
)
Expand Down
8 changes: 5 additions & 3 deletions algosdk/v2client/models/application_state_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ def dictify(self):
elif isinstance(value, dict):
result[oas_attr] = dict(
map(
lambda item: (item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item,
lambda item: (
(item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item
),
value.items(),
)
)
Expand Down
8 changes: 5 additions & 3 deletions algosdk/v2client/models/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ def dictify(self):
elif isinstance(value, dict):
result[oas_attr] = dict(
map(
lambda item: (item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item,
lambda item: (
(item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item
),
value.items(),
)
)
Expand Down
8 changes: 5 additions & 3 deletions algosdk/v2client/models/asset_holding.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,11 @@ def dictify(self):
elif isinstance(value, dict):
result[oas_attr] = dict(
map(
lambda item: (item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item,
lambda item: (
(item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item
),
value.items(),
)
)
Expand Down
8 changes: 5 additions & 3 deletions algosdk/v2client/models/asset_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,11 @@ def dictify(self):
elif isinstance(value, dict):
result[oas_attr] = dict(
map(
lambda item: (item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item,
lambda item: (
(item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item
),
value.items(),
)
)
Expand Down
8 changes: 5 additions & 3 deletions algosdk/v2client/models/dryrun_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,11 @@ def dictify(self):
elif isinstance(value, dict):
result[oas_attr] = dict(
map(
lambda item: (item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item,
lambda item: (
(item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item
),
value.items(),
)
)
Expand Down
8 changes: 5 additions & 3 deletions algosdk/v2client/models/dryrun_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,11 @@ def dictify(self):
elif isinstance(value, dict):
result[oas_attr] = dict(
map(
lambda item: (item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item,
lambda item: (
(item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item
),
value.items(),
)
)
Expand Down
8 changes: 5 additions & 3 deletions algosdk/v2client/models/teal_key_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ def dictify(self):
elif isinstance(value, dict):
result[oas_attr] = dict(
map(
lambda item: (item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item,
lambda item: (
(item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item
),
value.items(),
)
)
Expand Down
8 changes: 5 additions & 3 deletions algosdk/v2client/models/teal_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ def dictify(self):
elif isinstance(value, dict):
result[oas_attr] = dict(
map(
lambda item: (item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item,
lambda item: (
(item[0], item[1].dictify())
if hasattr(item[1], "dictify")
else item
),
value.items(),
)
)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.
black==23.1.0
black==24.3.0
glom==20.11.0
pytest==6.2.5
mypy==1.0
Expand Down
Loading