-
Notifications
You must be signed in to change notification settings - Fork 141
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
Enhancement: Upgrade black, mypy, and add type annotations to algod.py #442
Conversation
pass | ||
|
||
|
||
class AccountTransactionSigner(TransactionSigner): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved these up
@@ -23,27 +24,6 @@ | |||
T = TypeVar("T") | |||
|
|||
|
|||
class AtomicTransactionComposerStatus(IntEnum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-ordering class definitions
@@ -76,11 +56,234 @@ def populate_foreign_array( | |||
return offset + len(foreign_array) - 1 | |||
|
|||
|
|||
GenericSignedTransaction = Union[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now this is imported from transaction.py
on_complete: transaction.OnComplete = transaction.OnComplete.NoOpOC, | ||
local_schema: Optional[transaction.StateSchema] = None, | ||
global_schema: Optional[transaction.StateSchema] = None, | ||
approval_program: Optional[bytes] = None, | ||
clear_program: Optional[bytes] = None, | ||
extra_pages: Optional[int] = None, | ||
extra_pages: int = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
downstream, the extra_pages
param defaults to 0
so I'm unifying the API here.
import urllib.error | ||
from urllib import parse | ||
from urllib.request import Request, urlopen | ||
|
||
from algosdk import constants, encoding, error, transaction, util | ||
|
||
AlgodResponseType = Union[Dict[str, Any], bytes] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AlgodResponseType
results from the fact that the method algod_request()
returns a dict when its response_format == 'json'
(this is the default) and otherwise bytes
mypy
-ifyingalgod.py