1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use cid::Cid;

use super::{Machine, MachineContext, Manifest};
use crate::kernel::Result;
use crate::state_tree::StateTree;

type Type = MachineContext;

impl<M: Machine> Machine for Box<M> {
    type Blockstore = M::Blockstore;
    type Externs = M::Externs;
    type Limiter = M::Limiter;

    #[inline(always)]
    fn blockstore(&self) -> &Self::Blockstore {
        (**self).blockstore()
    }

    #[inline(always)]
    fn context(&self) -> &Type {
        (**self).context()
    }

    #[inline(always)]
    fn externs(&self) -> &Self::Externs {
        (**self).externs()
    }

    #[inline(always)]
    fn builtin_actors(&self) -> &Manifest {
        (**self).builtin_actors()
    }

    #[inline(always)]
    fn state_tree(&self) -> &StateTree<Self::Blockstore> {
        (**self).state_tree()
    }

    #[inline(always)]
    fn state_tree_mut(&mut self) -> &mut StateTree<Self::Blockstore> {
        (**self).state_tree_mut()
    }

    #[inline(always)]
    fn flush(&mut self) -> Result<Cid> {
        (**self).flush()
    }

    #[inline(always)]
    fn into_store(self) -> Self::Blockstore {
        (*self).into_store()
    }

    #[inline(always)]
    fn machine_id(&self) -> &str {
        (**self).machine_id()
    }

    #[inline(always)]
    fn new_limiter(&self) -> Self::Limiter {
        (**self).new_limiter()
    }
}