You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@
3
3
## Added
4
4
5
5
## Changed
6
+
* Improved Router clear state program generation. ([#636](https://github.com/algorand/pyteal/pull/636))
7
+
* NOTE: a backwards incompatable change was imposed in this PR: previous Clear State Program (CSP) can be constructed in router by registering ABI methods or bare app calls, now one has to use `clear_state` argument in `Router.__init__` to construct the CSP.
Copy file name to clipboardExpand all lines: docs/abi.rst
+7-2
Original file line number
Diff line number
Diff line change
@@ -732,13 +732,16 @@ The AVM supports 6 types of OnCompletion options that may be specified on an app
732
732
#. **Update application**, which updates an app, represented by :any:`OnComplete.UpdateApplication`
733
733
#. **Delete application**, which deletes an app, represented by :any:`OnComplete.DeleteApplication`
734
734
735
-
In PyTeal, you have the ability to register a bare app call handler for each of these actions. Additionally, a bare app call handler must also specify whether the handler can be invoking during an **app creation transaction** (:any:`CallConfig.CREATE`), during a **non-creation app call** (:any:`CallConfig.CALL`), or during **either** (:any:`CallConfig.ALL`).
735
+
.. note::
736
+
While **clear state** is a valid OnCompletion action, its behavior differs significantly from the others. For this reason, the :any:`Router` does not support bare app calls or methods to be called during clear state. Instead, you may use the :code:`clear_state` argument in :any:`Router.__init__` to do work during clear state.
737
+
738
+
In PyTeal, you have the ability to register a bare app call handler for each of these actions, except for clear state. Additionally, a bare app call handler must also specify whether the handler can be invoking during an **app creation transaction** (:any:`CallConfig.CREATE`), during a **non-creation app call** (:any:`CallConfig.CALL`), or during **either** (:any:`CallConfig.ALL`).
736
739
737
740
The :any:`BareCallActions` class is used to define a bare app call handler for on completion actions. Each bare app call handler must be an instance of the :any:`OnCompleteAction` class.
738
741
739
742
The :any:`OnCompleteAction` class is responsible for holding the actual code for the bare app call handler (an instance of either :code:`Expr` or a subroutine that takes no args and returns nothing) as well as a :any:`CallConfig` option that indicates whether the action is able to be called during a creation app call, a non-creation app call, or either.
740
743
741
-
All the bare app calls that an application wishes to support must be provided to the :any:`Router.__init__` method.
744
+
All the bare app calls that an application wishes to support must be provided to the :any:`Router.__init__` method. Additionally, if you wish to perform actions during clear state, you can specify the :code:`clear_state` argument.
0 commit comments