Skip to content

Commit caac588

Browse files
committed
rename methods to snake case
1 parent 46ce500 commit caac588

File tree

27 files changed

+541
-525
lines changed

27 files changed

+541
-525
lines changed

actors/account/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl Actor {
4343
match address.protocol() {
4444
Protocol::Secp256k1 | Protocol::BLS => {}
4545
protocol => {
46-
return Err(actor_error!(ErrIllegalArgument;
46+
return Err(actor_error!(illegal_argument;
4747
"address must use BLS or SECP protocol, got {}", protocol));
4848
}
4949
}
@@ -82,7 +82,7 @@ impl ActorCode for Actor {
8282
let addr = Self::pubkey_address(rt)?;
8383
Ok(RawBytes::serialize(addr)?)
8484
}
85-
None => Err(actor_error!(ErrUnhandledMessage; "Invalid method")),
85+
None => Err(actor_error!(unhandled_message; "Invalid method")),
8686
}
8787
}
8888
}

actors/cron/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl ActorCode for Actor {
100100
Self::epoch_tick(rt)?;
101101
Ok(RawBytes::default())
102102
}
103-
None => Err(actor_error!(ErrUnhandledMessage; "Invalid method")),
103+
None => Err(actor_error!(unhandled_message; "Invalid method")),
104104
}
105105
}
106106
}

actors/init/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
));
@@ -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!(ErrUnhandledMessage; "Invalid method")),
129+
None => Err(actor_error!(unhandled_message; "Invalid method")),
130130
}
131131
}
132132
}

0 commit comments

Comments
 (0)