@@ -44,7 +44,7 @@ impl Actor {
44
44
let sys_ref: & Address = & SYSTEM_ACTOR_ADDR ;
45
45
rt. validate_immediate_caller_is ( std:: iter:: once ( sys_ref) ) ?;
46
46
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" )
48
48
} ) ?;
49
49
50
50
rt. create ( & state) ?;
@@ -63,13 +63,13 @@ impl Actor {
63
63
log:: trace!( "called exec; params.code_cid: {:?}" , & params. code_cid) ;
64
64
65
65
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( ) )
67
67
} ) ?;
68
68
69
69
log:: trace!( "caller code CID: {:?}" , & caller_code) ;
70
70
71
71
if !can_exec ( rt, & caller_code, & params. code_cid ) {
72
- return Err ( actor_error ! ( ErrForbidden ;
72
+ return Err ( actor_error ! ( forbidden ;
73
73
"called type {} cannot exec actor type {}" ,
74
74
& caller_code, & params. code_cid
75
75
) ) ;
@@ -87,7 +87,7 @@ impl Actor {
87
87
// Store mapping of pubkey or actor address to actor ID
88
88
let id_address: ActorID = rt. transaction ( |s : & mut State , rt| {
89
89
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" )
91
91
} )
92
92
} ) ?;
93
93
@@ -126,7 +126,7 @@ impl ActorCode for Actor {
126
126
let res = Self :: exec ( rt, cbor:: deserialize_params ( params) ?) ?;
127
127
Ok ( RawBytes :: serialize ( res) ?)
128
128
}
129
- None => Err ( actor_error ! ( SysErrInvalidMethod ; "Invalid method" ) ) ,
129
+ None => Err ( actor_error ! ( unhandled_message ; "Invalid method" ) ) ,
130
130
}
131
131
}
132
132
}
0 commit comments