diff --git a/pyteal/ast/abi/array_dynamic.py b/pyteal/ast/abi/array_dynamic.py index edb40a718..41e8e802b 100644 --- a/pyteal/ast/abi/array_dynamic.py +++ b/pyteal/ast/abi/array_dynamic.py @@ -60,7 +60,8 @@ def set( self, values: Union[Sequence[T], "DynamicArray[T]", ComputedValue["DynamicArray[T]"]], ) -> Expr: - """Set the ABI dynamic array with one of the following + """Set the ABI dynamic array with one of the following: + * a sequence of ABI type variables * or another ABI static array * or a ComputedType with same TypeSpec @@ -69,10 +70,15 @@ def set( from ComputedType to store the internal ABI encoding into this StaticArray. This function determines if the argument `values` is an ABI dynamic array: + * if so: + * checks whether `values` is same type as this ABI dynamic array. + * stores the encoding of `values`. + * if not: + * calls the inherited `set` function and stores `values`. Args: diff --git a/pyteal/ast/abi/array_static.py b/pyteal/ast/abi/array_static.py index 51f938228..c88daed22 100644 --- a/pyteal/ast/abi/array_static.py +++ b/pyteal/ast/abi/array_static.py @@ -85,6 +85,7 @@ def set( ], ) -> Expr: """Set the ABI static array with one of the following: + * a sequence of ABI type variables * or another ABI static array * or a ComputedType with same TypeSpec @@ -93,11 +94,17 @@ def set( from ComputedType to store the internal ABI encoding into this StaticArray. This function determines if the argument `values` is an ABI static array: + * if so: + * checks whether `values` is same type as this ABI staic array. + * stores the encoding of `values`. + * if not: + * checks whether static array length matches sequence length. + * calls the inherited `set` function and stores `values`. Args: diff --git a/pyteal/ir/tealblock.py b/pyteal/ir/tealblock.py index 5fd2d5a42..7ce6259bc 100644 --- a/pyteal/ir/tealblock.py +++ b/pyteal/ir/tealblock.py @@ -255,8 +255,10 @@ def MatchScratchSlotReferences( A mapping is defined as follows: * The actual and expected lists must have the same length. * For every ScratchSlot referenced by either list: + * If the slot appears in both lists, it must appear the exact same number of times and at the exact same indexes in both lists. + * If the slot appears only in one list, for each of its appearances in that list, there must be a ScratchSlot in the other list that appears the exact same number of times and at the exact same indexes.