actors_runtime/runtime/actor_code.rs
1// Copyright 2019-2022 ChainSafe Systems
2// SPDX-License-Identifier: Apache-2.0, MIT
3
4use fvm_shared::blockstore::Blockstore;
5use fvm_shared::encoding::RawBytes;
6use fvm_shared::MethodNum;
7
8use crate::{ActorError, Runtime};
9
10/// Interface for invoking methods on an Actor
11pub trait ActorCode {
12 /// Invokes method with runtime on the actor's code. Method number will match one
13 /// defined by the Actor, and parameters will be serialized and used in execution
14 fn invoke_method<BS, RT>(
15 rt: &mut RT,
16 method: MethodNum,
17 params: &RawBytes,
18 ) -> Result<RawBytes, ActorError>
19 where
20 BS: Blockstore,
21 RT: Runtime<BS>;
22}