@@ -44,7 +44,7 @@ impl Actor {
4444 let sys_ref: & Address = & SYSTEM_ACTOR_ADDR ;
4545 rt. validate_immediate_caller_is ( std:: iter:: once ( sys_ref) ) ?;
4646 let state = State :: new ( rt. store ( ) , params. network_name ) . map_err ( |e| {
47- e. downcast_default ( ExitCode :: ErrIllegalState , "failed to construct init actor state" )
47+ e. downcast_default ( ExitCode :: USR_ILLEGAL_STATE , "failed to construct init actor state" )
4848 } ) ?;
4949
5050 rt. create ( & state) ?;
@@ -63,13 +63,13 @@ impl Actor {
6363 log:: trace!( "called exec; params.code_cid: {:?}" , & params. code_cid) ;
6464
6565 let caller_code = rt. get_actor_code_cid ( & rt. message ( ) . caller ( ) ) . ok_or_else ( || {
66- actor_error ! ( ErrIllegalState , "no code for caller as {}" , rt. message( ) . caller( ) )
66+ actor_error ! ( illegal_state , "no code for caller as {}" , rt. message( ) . caller( ) )
6767 } ) ?;
6868
6969 log:: trace!( "caller code CID: {:?}" , & caller_code) ;
7070
7171 if !can_exec ( rt, & caller_code, & params. code_cid ) {
72- return Err ( actor_error ! ( ErrForbidden ;
72+ return Err ( actor_error ! ( forbidden ;
7373 "called type {} cannot exec actor type {}" ,
7474 & caller_code, & params. code_cid
7575 ) ) ;
@@ -87,7 +87,7 @@ impl Actor {
8787 // Store mapping of pubkey or actor address to actor ID
8888 let id_address: ActorID = rt. transaction ( |s : & mut State , rt| {
8989 s. map_address_to_new_id ( rt. store ( ) , & robust_address) . map_err ( |e| {
90- e. downcast_default ( ExitCode :: ErrIllegalState , "failed to allocate ID address" )
90+ e. downcast_default ( ExitCode :: USR_ILLEGAL_STATE , "failed to allocate ID address" )
9191 } )
9292 } ) ?;
9393
@@ -126,7 +126,7 @@ impl ActorCode for Actor {
126126 let res = Self :: exec ( rt, cbor:: deserialize_params ( params) ?) ?;
127127 Ok ( RawBytes :: serialize ( res) ?)
128128 }
129- None => Err ( actor_error ! ( SysErrInvalidMethod ; "Invalid method" ) ) ,
129+ None => Err ( actor_error ! ( unhandled_message ; "Invalid method" ) ) ,
130130 }
131131 }
132132}
0 commit comments