Hi jjEvans,
This trips up a lot of folks. It has to do with the AppGlobalGetEx returning a MaybeValue which needs to be included in a Seq (or some other expression) prior to calling hasValue
You may try something like
myStatus = App.globalGetEx(0, Bytes("Count"))
handle_noop = Seq(
myStatus,
Cond(
[And(
Global.group_size() == Int(1),
Txn.application_args[0] == Bytes("Add"),
myStatus.hasValue()
),add],
[And(
Global.group_size() == Int(1),
Txn.application_args[0] == Bytes("Deduct"),
), deduct]
)
)
This is a strange way to offer this functionality so I hope will be tweaked in upcoming versions of PyTEAL.
Ben