I’m currently writing a function that needs to treat canister- and user-principals differently. How might one check if msg.caller is a canister?
Principal are generic identifiers for canisters, users and possibly other concepts in the future. As far as most uses of the system are concerned they are opaque binary blobs with a length between 0 and 29 bytes, and there is intentionally no mechanism to tell canister id and users ids apart.
This is from the Interface specification
Ah missed this - thank you.
i had the same problem and this solution also helped me
Useful, thank you!
Useful, thank you!