Function std::auth::caller_address
pub fn caller_address() -> Result<Address, AuthError> Expand description
Get the owner of the inputs (of type Input::Coin or Input::Message) to a
TransactionScript if they all share the same owner.
Returns
- [Result<Address, AuthError>] -
Ok(Address)if the single owner can be determined,Err(AuthError)otherwise.
Examples
use std::auth::caller_address;
fn foo() {
match caller_address() {
Ok(address) => log(address),
Err(AuthError::InputsNotAllOwnedBySameAddress) => log("Inputs not all owned by the same address."),
Err(AuthError::CallerIsInternal) => log("Hell froze over."),
}
}