Skip to content
New issue

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

fix misspelling of uint #431

Merged
merged 2 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pyteal/ast/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def clearStateProgram(cls, app: Expr) -> MaybeValue:
)

@classmethod
def globalNumUnit(cls, app: Expr) -> MaybeValue:
def globalNumUint(cls, app: Expr) -> MaybeValue:
"""Get the number of uint64 values allowed in Global State for the application.

Args:
Expand All @@ -260,7 +260,7 @@ def globalNumUnit(cls, app: Expr) -> MaybeValue:
return MaybeValue(
Op.app_params_get,
TealType.uint64,
immediate_args=["AppGlobalNumUnit"],
immediate_args=["AppGlobalNumUint"],
args=[app],
)

Expand All @@ -281,7 +281,7 @@ def globalNumByteSlice(cls, app: Expr) -> MaybeValue:
)

@classmethod
def localNumUnit(cls, app: Expr) -> MaybeValue:
def localNumUint(cls, app: Expr) -> MaybeValue:
"""Get the number of uint64 values allowed in Local State for the application.

Args:
Expand All @@ -292,7 +292,7 @@ def localNumUnit(cls, app: Expr) -> MaybeValue:
return MaybeValue(
Op.app_params_get,
TealType.uint64,
immediate_args=["AppLocalNumUnit"],
immediate_args=["AppLocalNumUint"],
args=[app],
)

Expand Down
20 changes: 10 additions & 10 deletions pyteal/ast/app_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,16 +480,16 @@ def test_app_param_clear_state_program_invalid():
pt.AppParam.clearStateProgram(pt.Txn.sender())


def test_app_param_global_num_unit_valid():
def test_app_param_global_num_uint_valid():
arg = pt.Int(1)
expr = pt.AppParam.globalNumUnit(arg)
expr = pt.AppParam.globalNumUint(arg)
assert expr.type_of() == pt.TealType.none
assert expr.value().type_of() == pt.TealType.uint64

expected = pt.TealSimpleBlock(
[
pt.TealOp(arg, pt.Op.int, 1),
pt.TealOp(expr, pt.Op.app_params_get, "AppGlobalNumUnit"),
pt.TealOp(expr, pt.Op.app_params_get, "AppGlobalNumUint"),
pt.TealOp(None, pt.Op.store, expr.slotOk),
pt.TealOp(None, pt.Op.store, expr.slotValue),
]
Expand All @@ -503,9 +503,9 @@ def test_app_param_global_num_unit_valid():
assert actual == expected


def test_app_param_global_num_unit_invalid():
def test_app_param_global_num_uint_invalid():
with pytest.raises(pt.TealTypeError):
pt.AppParam.globalNumUnit(pt.Txn.sender())
pt.AppParam.globalNumUint(pt.Txn.sender())


def test_app_param_global_num_byte_slice_valid():
Expand Down Expand Up @@ -536,16 +536,16 @@ def test_app_param_global_num_byte_slice_invalid():
pt.AppParam.globalNumByteSlice(pt.Txn.sender())


def test_app_param_local_num_unit_valid():
def test_app_param_local_num_uint_valid():
arg = pt.Int(1)
expr = pt.AppParam.localNumUnit(arg)
expr = pt.AppParam.localNumUint(arg)
assert expr.type_of() == pt.TealType.none
assert expr.value().type_of() == pt.TealType.uint64

expected = pt.TealSimpleBlock(
[
pt.TealOp(arg, pt.Op.int, 1),
pt.TealOp(expr, pt.Op.app_params_get, "AppLocalNumUnit"),
pt.TealOp(expr, pt.Op.app_params_get, "AppLocalNumUint"),
pt.TealOp(None, pt.Op.store, expr.slotOk),
pt.TealOp(None, pt.Op.store, expr.slotValue),
]
Expand All @@ -559,9 +559,9 @@ def test_app_param_local_num_unit_valid():
assert actual == expected


def test_app_param_local_num_unit_invalid():
def test_app_param_local_num_uint_invalid():
with pytest.raises(pt.TealTypeError):
pt.AppParam.localNumUnit(pt.Txn.sender())
pt.AppParam.localNumUint(pt.Txn.sender())


def test_app_param_local_num_byte_slice_valid():
Expand Down