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

Typo Fix for abi.Uint64TypeSpec #549

Merged
merged 1 commit into from
Oct 5, 2022
Merged

Typo Fix for abi.Uint64TypeSpec #549

merged 1 commit into from
Oct 5, 2022

Conversation

ahangsu
Copy link
Contributor

@ahangsu ahangsu commented Oct 5, 2022

When I was attempting to walk through subclasses of TypeSpecs in ABI, I was experimenting with following script, and get the following result:

python3
Python 3.10.6 (main, Aug 30 2022, 04:58:14) [Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyteal import *
>>> stuff = [abi.TypeSpec]
>>> while stuff:
...     now = stuff.pop()
...     print(now)
...     for i in now.__subclasses__():
...         if i not in stuff:
...             stuff.append(i)
...
<class 'pyteal.abi.TypeSpec'>
<class 'pyteal.abi.TransactionTypeSpec'>
<class 'pyteal.abi.ApplicationCallTransactionTypeSpec'>
<class 'pyteal.abi.AssetTransferTransactionTypeSpec'>
<class 'pyteal.abi.AssetFreezeTransactionTypeSpec'>
<class 'pyteal.abi.AssetConfigTransactionTypeSpec'>
<class 'pyteal.abi.KeyRegisterTransactionTypeSpec'>
<class 'pyteal.abi.PaymentTransactionTypeSpec'>
<class 'pyteal.abi.ReferenceTypeSpec'>
<class 'pyteal.abi.ApplicationTypeSpec'>
<class 'pyteal.abi.AssetTypeSpec'>
<class 'pyteal.abi.AccountTypeSpec'>
<class 'pyteal.abi.ArrayTypeSpec'>
<class 'pyteal.abi.StaticArrayTypeSpec'>
<class 'pyteal.abi.AddressTypeSpec'>
<class 'pyteal.abi.StaticBytesTypeSpec'>
<class 'pyteal.abi.DynamicArrayTypeSpec'>
<class 'pyteal.abi.StringTypeSpec'>
<class 'pyteal.abi.DynamicBytesTypeSpec'>
<class 'pyteal.abi.TupleTypeSpec'>
<class 'pyteal.abi.NamedTupleTypeSpec'>
<class 'pyteal.abi.BoolTypeSpec'>
<class 'pyteal.abi.UintTypeSpec'>
<class 'pyteal.ast.abi.uint.Uint64TypeSpec'>
<class 'pyteal.abi.Uint32TypeSpec'>
<class 'pyteal.abi.Uint16TypeSpec'>
<class 'pyteal.abi.Uint8TypeSpec'>
<class 'pyteal.abi.ByteTypeSpec'>

The line <class 'pyteal.ast.abi.uint.Uint64TypeSpec'> looks absurd, so this line one change of typo fix gives correct class name repr over command line:

python3
Python 3.10.6 (main, Aug 30 2022, 04:58:14) [Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyteal import *
>>> stuff = [abi.TypeSpec]
>>> while stuff:
...     now = stuff.pop()
...     print(now)
...     for i in now.__subclasses__():
...         if i not in stuff:
...             stuff.append(i)
...
<class 'pyteal.abi.TypeSpec'>
<class 'pyteal.abi.TransactionTypeSpec'>
<class 'pyteal.abi.ApplicationCallTransactionTypeSpec'>
<class 'pyteal.abi.AssetTransferTransactionTypeSpec'>
<class 'pyteal.abi.AssetFreezeTransactionTypeSpec'>
<class 'pyteal.abi.AssetConfigTransactionTypeSpec'>
<class 'pyteal.abi.KeyRegisterTransactionTypeSpec'>
<class 'pyteal.abi.PaymentTransactionTypeSpec'>
<class 'pyteal.abi.ReferenceTypeSpec'>
<class 'pyteal.abi.ApplicationTypeSpec'>
<class 'pyteal.abi.AssetTypeSpec'>
<class 'pyteal.abi.AccountTypeSpec'>
<class 'pyteal.abi.ArrayTypeSpec'>
<class 'pyteal.abi.StaticArrayTypeSpec'>
<class 'pyteal.abi.AddressTypeSpec'>
<class 'pyteal.abi.StaticBytesTypeSpec'>
<class 'pyteal.abi.DynamicArrayTypeSpec'>
<class 'pyteal.abi.StringTypeSpec'>
<class 'pyteal.abi.DynamicBytesTypeSpec'>
<class 'pyteal.abi.TupleTypeSpec'>
<class 'pyteal.abi.NamedTupleTypeSpec'>
<class 'pyteal.abi.BoolTypeSpec'>
<class 'pyteal.abi.UintTypeSpec'>
<class 'pyteal.abi.Uint64TypeSpec'>
<class 'pyteal.abi.Uint32TypeSpec'>
<class 'pyteal.abi.Uint16TypeSpec'>
<class 'pyteal.abi.Uint8TypeSpec'>
<class 'pyteal.abi.ByteTypeSpec'>

@ahangsu ahangsu requested a review from michaeldiamant October 5, 2022 14:10
@ahangsu ahangsu closed this Oct 5, 2022
@ahangsu ahangsu reopened this Oct 5, 2022
@ahangsu ahangsu closed this Oct 5, 2022
@ahangsu ahangsu reopened this Oct 5, 2022
@ahangsu
Copy link
Contributor Author

ahangsu commented Oct 5, 2022

ugh the cla hanging test is biting me huh

@ahangsu ahangsu requested a review from barnjamin October 5, 2022 14:16
@ahangsu ahangsu closed this Oct 5, 2022
@ahangsu ahangsu reopened this Oct 5, 2022
@ahangsu ahangsu merged commit fdf10f7 into master Oct 5, 2022
@ahangsu ahangsu deleted the typo-fix branch October 5, 2022 14:57
barnjamin pushed a commit that referenced this pull request Oct 5, 2022
…ng (#551)

* Typo Fix for `abi.Uint64TypeSpec` (#549)

* minor suggestion on ABIReturnSubroutine API change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants