From the offsite notes:
Difficult to “query” if something was valid
- We wanted to query the is_valid method in an account contract from a private function
- is_valid should return a boolean (based on the name) but it asserts it’s true
- Related, document why
is_valid returns IS_VALID_SELECTOR
- Even after changing it to return true, we cannot query it, because it depends on get_auth_witness, which fails if there is no auth wit registered.
- We’d need a try_get_auth_witness oracle method, and in general be able to try to do things and let the caller decide whether to assert or do something else.
- Alternatively, we could have a try_call to a function called in an unconstrained way, so we can try calling a function and see what would happen.
- It’s also not possible to call an unconstrained function in another contract from a private function.
From the offsite notes:
Difficult to “query” if something was valid
is_validreturns IS_VALID_SELECTOR