Skip to content

Commit

Permalink
feat: allow int literals with algopy.op functions that take a BigUInt…
Browse files Browse the repository at this point in the history
… (currently just bsqrt)
  • Loading branch information
achidlow committed Apr 15, 2024
1 parent 1eb3bee commit a8e14c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/generate_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _get_imported_name(typ: wtypes.WType) -> str:
wtypes.bytes_wtype: bytes,
wtypes.uint64_wtype: int,
wtypes.account_wtype: None, # could be str
wtypes.biguint_wtype: None, # could be int
wtypes.biguint_wtype: int,
wtypes.bool_wtype: None, # already a Python type
# below are covered transitively with respect to STACK_TYPE_MAPPING
wtypes.application_wtype: None, # maybe could be int? but also covered transitively anyway
Expand Down
2 changes: 1 addition & 1 deletion stubs/algopy-stubs/op.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def bitlen(a: Bytes | UInt64 | bytes | int, /) -> UInt64:
Native TEAL opcode: [`bitlen`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#bitlen)
"""

def bsqrt(a: BigUInt, /) -> BigUInt:
def bsqrt(a: BigUInt | int, /) -> BigUInt:
"""
The largest integer I such that I^2 <= A. A and I are interpreted as big-endian unsigned integers
Expand Down

0 comments on commit a8e14c3

Please sign in to comment.