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

Support logs, dynamic arg indexes, and other improvements #117

Merged
merged 5 commits into from
Sep 20, 2021

Conversation

jasonpaulos
Copy link
Member

This PR adds:

  • Support for logging with the Log expression
  • Support for dynamic indexes into the Arg expression
  • Support for single-element NaryExpr, e.g. And(Int(1))
  • Support for creating Bytes expressions directly from bytes and bytearray objects, e.g. Bytes(b"value")

Closes #113.

Copy link
Contributor

@shiqizng shiqizng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks good to me. But I don't see why support for single-element naryExpr is needed. why is Arg(Int(1)) or Concat(Bytes("a")) useful?

@jasonpaulos
Copy link
Member Author

Single element NaryExpr was a request from #80. The use case is to write something like And(*[validate(thing) for thing in things]) without worrying about a special case if the array has only 1 element.

Copy link
Contributor

@algochoi algochoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code and tests look good to me 🚢
Just one small suggestion on formatting strings with f-strings if we are Python 3.6+.

pyteal/ast/bytes.py Show resolved Hide resolved
@jasonpaulos jasonpaulos merged commit 208d0f9 into master Sep 20, 2021
@jasonpaulos jasonpaulos deleted the more-teal-5-improvements branch September 20, 2021 15:52
@jasonpaulos jasonpaulos mentioned this pull request Sep 27, 2021
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.

Support for logging
3 participants