File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change
1
+ [workspace ]
2
+
3
+ members = [
4
+ " fvm_dispatch"
5
+ ]
Original file line number Diff line number Diff line change @@ -26,10 +26,13 @@ pub struct MethodHasher<T: Hasher> {
26
26
impl < T : Hasher > MethodHasher < T > {
27
27
const CONSTRUCTOR_METHOD_NAME : & ' static str = "Constructor" ;
28
28
const CONSTRUCTOR_METHOD_NUMBER : u64 = 1_u64 ;
29
+
30
+ /// Create a new MethodHasher using the given hash algorithm
29
31
pub fn new ( hasher : T ) -> Self {
30
32
Self { hasher }
31
33
}
32
34
35
+ /// Generate the conventional method number based off an exported name
33
36
pub fn method_number ( & self , method_name : & str ) -> u64 {
34
37
if method_name == Self :: CONSTRUCTOR_METHOD_NAME {
35
38
Self :: CONSTRUCTOR_METHOD_NUMBER
Original file line number Diff line number Diff line change @@ -10,12 +10,14 @@ pub struct MethodDispatcher<T: Hasher> {
10
10
}
11
11
12
12
impl < T : Hasher > MethodDispatcher < T > {
13
+ /// Create a new MethodDispatcher with a given hasher
13
14
pub fn new ( hasher : T ) -> Self {
14
15
Self {
15
16
method_hasher : MethodHasher :: new ( hasher) ,
16
17
}
17
18
}
18
19
20
+ /// Call a method on another actor by conventional name
19
21
pub fn call_method (
20
22
& self ,
21
23
to : & Address ,
You can’t perform that action at this time.
0 commit comments