eosio.cdt
eosio.cdt copied to clipboard
check* intrinsics naming conventions
I was under the impression that the check* functions throw an assertion error like eosio::check does and a bit surprised that check_permission_authorization and check_transaction_authorization do not.
Instead, both functions return a boolean and to write secure code that aborts if not authorized, one has to write code that reads strangely:
check(
check_permission_authorization(get_self(), name("dummy"), provided_keys),
"wrong key"
);
Imo, renaming check_permission_authorization to has_permission_authorization(and check_transaction_authorization to has_transaction_authorization) would be helpful to avoid confusion and prevent bugs / security issues.