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

Relax ABI Subroutine argument type checking #530

Closed
barnjamin opened this issue Sep 12, 2022 · 0 comments
Closed

Relax ABI Subroutine argument type checking #530

barnjamin opened this issue Sep 12, 2022 · 0 comments
Assignees
Labels
new-bug Bug report that needs triage Team Scytale

Comments

@barnjamin
Copy link
Contributor

If a subroutine is declared as

@Subroutine(TealType.none)
def txn_checks(txn: abi.Transaction):
    # ...

and called with

@router.method
def payme(ptxn: abi.PaymentTransaction):
    return Seq(
         txn_checks(ptxn)
         # ...

Pyteal will complain with:

pyteal.TealInputError: supplied argument pay at index 0 should have ABI typespec txn but got pay

We should add a check for whether or not the arg_type is a Transaction type and allow more specific Transaction types to be passed here: https://github.com/algorand/pyteal/blob/master/pyteal/ast/subroutine.py#L285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-bug Bug report that needs triage Team Scytale
Projects
None yet
Development

No branches or pull requests

3 participants