algorand / algorand/pyteal

Compilation check if MaybeValue was evaluated before accessing it's value

オープン
#108 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
external contribution new-feature-request Team Scytale
主要言語
Python
スター
288
フォーク
138
PR マージ指標
30日以内にマージされた PR はありません

説明

## Problem

Using a MaybeValue.value() (for ex. from AssetHolding.balance()) without evaluating it first causes a very unintuitive error message.
Currently:
```
pyteal.TealInternalError: Encountered 1 error during compilation
```
Investigating the value of `errors` in compileTeal:
```
[TealCompileError('Scratch slot load occurs before store', )]
```

The desired behaviour would be to raise an exception that mentions a MaybeValue used without evaluating it first (or remove slot dependency).

## Solution

With TEAL 4 it's possible to use `select` opcode to choose the desired parameter (ok, value) and avoid slot usage inside MaybeValue completely.

## Dependencies

None

## Urgency

Low, mostly for convenience and simpler debugging

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。