Skip to content

Commit a23d136

Browse files
authored
fix: no unimplemented! panics in RPC methods (#6495)
1 parent 03f4c56 commit a23d136

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/rpc/methods/state.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,10 @@ impl RpcMethod<2> for StateLookupRobustAddress {
382382
let init_state: init::State = state_tree.get_actor_state()?;
383383
let mut robust_addr = Address::default();
384384
match init_state {
385-
init::State::V0(_) => unimplemented!(),
385+
init::State::V0(_) => Err(ServerError::internal_error(
386+
"StateLookupRobustAddress is not implemented for init state v0",
387+
None,
388+
)),
386389
init::State::V8(state) => get_robust_address!(
387390
store,
388391
id_addr_decoded,
@@ -2765,7 +2768,9 @@ impl StateGetAllocations {
27652768
if addresses.is_empty() {
27662769
let init_state: init::State = state_tree.get_actor_state()?;
27672770
match init_state {
2768-
init::State::V0(_) => unimplemented!(),
2771+
init::State::V0(_) => {
2772+
anyhow::bail!("StateGetAllocations is not implemented for init state v0");
2773+
}
27692774
init::State::V8(s) => {
27702775
let map =
27712776
fil_actors_shared::v8::make_map_with_root::<_, u64>(&s.address_map, store)?;

0 commit comments

Comments
 (0)