Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: fix msig sks type + a couple other mypy complaints #434

Merged
merged 1 commit into from
Jan 12, 2023
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
2 changes: 1 addition & 1 deletion algosdk/atomic_transaction_composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ class MultisigTransactionSigner(TransactionSigner):
sks (str): private keys of multisig
"""

def __init__(self, msig: transaction.Multisig, sks: str) -> None:
def __init__(self, msig: transaction.Multisig, sks: List[str]) -> None:
super().__init__()
self.msig = msig
self.sks = sks
Expand Down
11 changes: 6 additions & 5 deletions algosdk/dryrun_results.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import base64
from typing import List, Optional, cast
from typing import List, Optional, cast, Dict, Any


class StackPrinterConfig:
Expand All @@ -26,15 +26,15 @@ def __init__(self, drrjson: dict):


class DryrunTransactionResult:
def __init__(self, dr):
def __init__(self, dr: Dict[str, Any]):
assert (
"disassembly" in dr
), "expecting dryrun transaction result to have key 'disassembly' but its missing"

self.disassembly = dr["disassembly"]

# cost is separated into 2 fields: `budget-added` and `budget-consumed`
optionals = [
optionals: List[str] = [
"app-call-messages",
"local-deltas",
"global-delta",
Expand All @@ -45,7 +45,7 @@ def __init__(self, dr):
"logs",
]

def attrname(field):
def attrname(field: str):
return field.replace("-", "_")

for field in optionals:
Expand Down Expand Up @@ -131,7 +131,7 @@ def app_trace(self, spc: Optional[StackPrinterConfig] = None) -> str:
spc = StackPrinterConfig(top_of_stack_first=False)
spc = cast(StackPrinterConfig, spc)

return self.trace(self.app_call_trace, self.disassembly, spc=spc)
return self.trace(self.app_call_trace, self.disassembly, spc=spc) # type: ignore[attr-defined] # dynamic attribute

def lsig_trace(self, spc: Optional[StackPrinterConfig] = None) -> str:
if not hasattr(self, "logic_sig_trace"):
Expand Down Expand Up @@ -181,6 +181,7 @@ def __str__(self) -> str:
return str(self.int)

def __eq__(self, other: object):
other = cast(DryrunStackValue, other)
return (
hasattr(other, "type")
and self.type == other.type
Expand Down
4 changes: 4 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
[mypy]


[mypy-msgpack.*]
ignore_missing_imports = True