We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Reporting this on behalf of one of our users @ErikHasselwander. Discord thread: https://discord.com/channels/491256308461207573/1143656409905504406 PyTeal source mapper seems to apparently generate incorrect mapping while on Windows but correct elsewhere.
Windows and WSL.
from feature_gates import FeatureGates FeatureGates.set_sourcemap_enabled(True) import pyteal as pt def approval_program() -> pt.Expr: def create() -> pt.Expr: return pt.Return(pt.Int(1)) def call() -> pt.Expr: return pt.Seq( pt.Pop(pt.Sha256(pt.Txn.sender())), pt.Return(pt.Int(1)) ) return pt.Cond( [pt.Global.current_application_id() == pt.Int(0), create()], [pt.Int(1), call()] ) if __name__ == "__main__": print(pt.Compilation(approval_program(), pt.Mode.Application, version=4).compile( with_sourcemap=True, annotate_teal=True, pcs_in_sourcemap=True, annotate_teal_headers=True, annotate_teal_concise=True, ).sourcemap.annotated_teal)
python -m venv venv ./venv/bin/activate.ps1 pip install pyteal=0.25.0 python ./test.py
// GENERATED TEAL // PC PYTEAL #pragma version 4 // (0) pt.Compilation(approval_program(), pt.Mode.Application, version=4).compile(with_sourcemap=True, annotate_teal=True, pcs_in_sourcemap=True, annotate_teal_headers=True, annotate_teal_concise=True) global CurrentApplicationID // (4) pt.Global.current_application_id() int 0 // (6) pt.Int(0) == // (8) pt.Global.current_application_id() == pt.Int(0) bnz main_l4 // (9) int 1 // (12) pt.Int(1) bnz main_l3 // (13) err // (16) pt.Cond([pt.Global.current_application_id() == pt.Int(0), create()], [pt.Int(1), call()]) main_l3: // pt.Int(1) txn Sender // (17) pt.Txn.sender() sha256 // (19) pt.Sha256(pt.Txn.sender()) pop // (20) pt.Pop(pt.Sha256(pt.Txn.sender())) int 1 // (21) pt.Int(1) return // (22) pt.Return(pt.Int(1)) main_l4: // pt.Global.current_application_id() == pt.Int(0) int 1 // (23) pt.Int(1) return // (24) pt.Return(pt.Int(1))
// GENERATED TEAL // PC PYTEAL #pragma version 4 // (0) super().__init__(None) global CurrentApplicationID // (4) super().__init__() int 0 // (6) super().__init__() == // (8) super().__init__() bnz main_l4 // (9) int 1 // (12) super().__init__() bnz main_l3 // (13) err // (16) super().__init__() main_l3: // super().__init__() txn Sender // (17) super().__init__() sha256 // (19) super().__init__() pop // (20) int 1 // (21) super().__init__() return // (22) super().__init__() main_l4: // super().__init__() int 1 // (23) super().__init__() return // (24) super().__init__()
The text was updated successfully, but these errors were encountered:
Thanks! This doesn't completely surprise me. We'll take a look.
Sorry, something went wrong.
tzaffi
No branches or pull requests
Reporting this on behalf of one of our users @ErikHasselwander.
Discord thread: https://discord.com/channels/491256308461207573/1143656409905504406
PyTeal source mapper seems to apparently generate incorrect mapping while on Windows but correct elsewhere.
Your environment
Windows and WSL.
Steps to reproduce
PyTeal code in both cases
Expected behaviour (captured on WSL)
Actual behaviour (captured on Windows)
The text was updated successfully, but these errors were encountered: