Returns a Ok(Identity)
, or Err(AuthError)
if an identity cannot be determined.
Returns an AuthError::InputsNotAllOwnedBySameAddress
if the caller is external and the inputs to the transaction are not all owned by the same address.
Should not return an AuthError::CallerIsInternal
under any circumstances.
Ok(Identity)
if the identity can be determined, Err(AuthError)
otherwise.fn foo() {
match msg_sender() {
Ok(Identity::Address(address)) => log(address),
Ok(Identity::ContractId(contract_id)) => log(contract_id),
Err(AuthError::InputsNotAllOwnedBySameAddress) => log("Inputs not all owned by same address."),
Err(AuthError::CallerIsInternal) => log("Hell froze over."),
}
}