diff --git a/actors/init/src/lib.rs b/actors/init/src/lib.rs index de54b07fe..97c69b6fb 100644 --- a/actors/init/src/lib.rs +++ b/actors/init/src/lib.rs @@ -148,10 +148,10 @@ where BS: Blockstore, RT: Runtime, { - rt.is_builtin_actor(exec) + rt.resolve_builtin_actor_type(exec) .map(|typ| match typ { Type::Multisig | Type::PaymentChannel => true, - Type::Miner if rt.is_builtin_actor(caller) == Some(Type::Power) => true, + Type::Miner if rt.resolve_builtin_actor_type(caller) == Some(Type::Power) => true, _ => false, }) .unwrap_or(false) diff --git a/actors/market/src/lib.rs b/actors/market/src/lib.rs index 3a4f2286b..b79c4e8fe 100644 --- a/actors/market/src/lib.rs +++ b/actors/market/src/lib.rs @@ -252,7 +252,7 @@ impl Actor { actor_error!(ErrIllegalArgument, "no code ID for address {}", provider) })?; - if rt.is_builtin_actor(&code_id) != Some(Type::Miner) { + if rt.resolve_builtin_actor_type(&code_id) != Some(Type::Miner) { return Err(actor_error!( ErrIllegalArgument, "deal provider is not a storage miner actor" @@ -1404,7 +1404,7 @@ where .get_actor_code_cid(&nominal) .ok_or_else(|| actor_error!(ErrIllegalArgument, "no code for address {}", nominal))?; - if rt.is_builtin_actor(&code_id) == Some(Type::Miner) { + if rt.resolve_builtin_actor_type(&code_id) == Some(Type::Miner) { // Storage miner actor entry; implied funds recipient is the associated owner address. let (owner_addr, worker_addr, _) = request_miner_control_addrs(rt, nominal)?; return Ok((nominal, owner_addr, vec![owner_addr, worker_addr])); diff --git a/actors/miner/src/lib.rs b/actors/miner/src/lib.rs index 91130138a..1e79f6248 100644 --- a/actors/miner/src/lib.rs +++ b/actors/miner/src/lib.rs @@ -3730,7 +3730,7 @@ where .ok_or_else(|| actor_error!(ErrIllegalArgument, "no code for address: {}", resolved))?; let is_principal = rt - .is_builtin_actor(&owner_code) + .resolve_builtin_actor_type(&owner_code) .map(is_principal) .unwrap_or(false); @@ -3759,7 +3759,7 @@ where let worker_code = rt .get_actor_code_cid(&resolved) .ok_or_else(|| actor_error!(ErrIllegalArgument, "no code for address: {}", resolved))?; - if rt.is_builtin_actor(&worker_code) != Some(Type::Account) { + if rt.resolve_builtin_actor_type(&worker_code) != Some(Type::Account) { return Err(actor_error!( ErrIllegalArgument, "worker actor type must be an account, was {}", diff --git a/actors/paych/src/lib.rs b/actors/paych/src/lib.rs index 827fdf33d..e574cbcc0 100644 --- a/actors/paych/src/lib.rs +++ b/actors/paych/src/lib.rs @@ -83,7 +83,7 @@ impl Actor { .get_actor_code_cid(&resolved) .ok_or_else(|| actor_error!(ErrIllegalArgument, "no code for address {}", resolved))?; - let typ = rt.is_builtin_actor(&code_cid); + let typ = rt.resolve_builtin_actor_type(&code_cid); if typ != Some(Type::Account) { Err(actor_error!( diff --git a/actors/runtime/src/runtime/fvm.rs b/actors/runtime/src/runtime/fvm.rs index 3e3fb73da..17e279f71 100644 --- a/actors/runtime/src/runtime/fvm.rs +++ b/actors/runtime/src/runtime/fvm.rs @@ -131,7 +131,7 @@ where .expect("failed to lookup caller code") }; - match self.is_builtin_actor(&caller_cid) { + match self.resolve_builtin_actor_type(&caller_cid) { Some(typ) if types.into_iter().any(|t| *t == typ) => Ok(()), _ => Err(actor_error!(SysErrForbidden; "caller cid type {} not one of supported", caller_cid) @@ -151,8 +151,8 @@ where fvm::actor::get_actor_code_cid(addr) } - fn is_builtin_actor(&self, code_id: &Cid) -> Option { - fvm::actor::is_builtin_actor(code_id) + fn resolve_builtin_actor_type(&self, code_id: &Cid) -> Option { + fvm::actor::resolve_builtin_actor_type(code_id) } fn get_code_cid_for_type(&self, typ: Type) -> Cid { diff --git a/actors/runtime/src/runtime/mod.rs b/actors/runtime/src/runtime/mod.rs index 8502af76f..5df918c15 100644 --- a/actors/runtime/src/runtime/mod.rs +++ b/actors/runtime/src/runtime/mod.rs @@ -137,7 +137,7 @@ pub trait Runtime: Syscalls { fn delete_actor(&mut self, beneficiary: &Address) -> Result<(), ActorError>; /// Returns whether the specified CodeCID belongs to a built-in actor. - fn is_builtin_actor(&self, code_id: &Cid) -> Option; + fn resolve_builtin_actor_type(&self, code_id: &Cid) -> Option; /// Returns the CodeCID for a built-in actor type. The kernel will abort /// if the supplied type is invalid. diff --git a/actors/runtime/src/test_utils.rs b/actors/runtime/src/test_utils.rs index 67be3dfd9..2999fc375 100644 --- a/actors/runtime/src/test_utils.rs +++ b/actors/runtime/src/test_utils.rs @@ -706,7 +706,7 @@ impl Runtime for MockRuntime { Ok(()) } - fn is_builtin_actor(&self, code_id: &Cid) -> Option { + fn resolve_builtin_actor_type(&self, code_id: &Cid) -> Option { self.require_in_call(); (*ACTOR_TYPES).get(code_id).cloned() } diff --git a/actors/runtime/src/util/chaos/mod.rs b/actors/runtime/src/util/chaos/mod.rs index 459c7f1c6..34a17e3f9 100644 --- a/actors/runtime/src/util/chaos/mod.rs +++ b/actors/runtime/src/util/chaos/mod.rs @@ -107,7 +107,7 @@ impl Actor { let types: Vec = args .types .iter() - .map(|typ| rt.is_builtin_actor(typ).unwrap()) + .map(|typ| rt.resolve_builtin_actor_type(typ).unwrap()) .collect(); rt.validate_immediate_caller_type(&types)?; }