class StateBlob(ABC):
def __init__(self, num_keys: int):
self.num_keys = num_keys
while
class AccountStateBlob(StateBlob):
def __init__(self, keys: Optional[int | list[int]] = None):
and
class ApplicationStateBlob(StateBlob):
def __init__(self, keys: Optional[int | list[int]] = None):
makes it hard to use StateBlob in an abstract way and then substitute with whatever implementation (signature on the abstract should match signatures on the concrete).
Furthermore, I think
class Blob(ABC):
def __init__(self, key_limit: int, /, *, keys: Optional[int | list[int]] = None):
could be much simpler. Maybe always accepting just a int | Tuple[int, int] is enough?
I'm thinking of the case where a single global/local space could be storing multiple blobs so it makes sense to either specify the size or a range of slots.
while
and
makes it hard to use
StateBlobin an abstract way and then substitute with whatever implementation (signature on the abstract should match signatures on the concrete).Furthermore, I think
could be much simpler. Maybe always accepting just a
int | Tuple[int, int]is enough?I'm thinking of the case where a single global/local space could be storing multiple blobs so it makes sense to either specify the size or a range of slots.