@@ -34,22 +34,10 @@ impl CgoExterns {
34
34
}
35
35
36
36
impl Rand3 for CgoExterns {
37
- fn get_chain_randomness (
38
- & self ,
39
- pers : i64 ,
40
- round : ChainEpoch ,
41
- entropy : & [ u8 ] ,
42
- ) -> anyhow:: Result < [ u8 ; 32 ] > {
37
+ fn get_chain_randomness ( & self , round : ChainEpoch ) -> anyhow:: Result < [ u8 ; 32 ] > {
43
38
unsafe {
44
39
let mut buf = [ 0u8 ; 32 ] ;
45
- match cgo_extern_get_chain_randomness (
46
- self . handle ,
47
- pers,
48
- round,
49
- entropy. as_ptr ( ) ,
50
- entropy. len ( ) as i32 ,
51
- & mut buf,
52
- ) {
40
+ match cgo_extern_get_chain_randomness ( self . handle , round, & mut buf) {
53
41
0 => Ok ( buf) ,
54
42
r @ 1 .. => panic ! ( "invalid return value from has: {}" , r) ,
55
43
x if x == FvmError :: InvalidHandle as i32 => {
@@ -63,22 +51,10 @@ impl Rand3 for CgoExterns {
63
51
}
64
52
}
65
53
66
- fn get_beacon_randomness (
67
- & self ,
68
- pers : i64 ,
69
- round : ChainEpoch ,
70
- entropy : & [ u8 ] ,
71
- ) -> anyhow:: Result < [ u8 ; 32 ] > {
54
+ fn get_beacon_randomness ( & self , round : ChainEpoch ) -> anyhow:: Result < [ u8 ; 32 ] > {
72
55
unsafe {
73
56
let mut buf = [ 0u8 ; 32 ] ;
74
- match cgo_extern_get_beacon_randomness (
75
- self . handle ,
76
- pers,
77
- round,
78
- entropy. as_ptr ( ) ,
79
- entropy. len ( ) as i32 ,
80
- & mut buf,
81
- ) {
57
+ match cgo_extern_get_beacon_randomness ( self . handle , round, & mut buf) {
82
58
0 => Ok ( buf) ,
83
59
r @ 1 .. => panic ! ( "invalid return value from has: {}" , r) ,
84
60
x if x == FvmError :: InvalidHandle as i32 => {
@@ -94,22 +70,12 @@ impl Rand3 for CgoExterns {
94
70
}
95
71
96
72
impl Rand2 for CgoExterns {
97
- fn get_chain_randomness (
98
- & self ,
99
- pers : i64 ,
100
- round : ChainEpoch ,
101
- entropy : & [ u8 ] ,
102
- ) -> anyhow:: Result < [ u8 ; 32 ] > {
103
- Rand3 :: get_chain_randomness ( self , pers, round, entropy)
73
+ fn get_chain_randomness ( & self , round : ChainEpoch ) -> anyhow:: Result < [ u8 ; 32 ] > {
74
+ Rand3 :: get_chain_randomness ( self , round)
104
75
}
105
76
106
- fn get_beacon_randomness (
107
- & self ,
108
- pers : i64 ,
109
- round : ChainEpoch ,
110
- entropy : & [ u8 ] ,
111
- ) -> anyhow:: Result < [ u8 ; 32 ] > {
112
- Rand3 :: get_beacon_randomness ( self , pers, round, entropy)
77
+ fn get_beacon_randomness ( & self , round : ChainEpoch ) -> anyhow:: Result < [ u8 ; 32 ] > {
78
+ Rand3 :: get_beacon_randomness ( self , round)
113
79
}
114
80
}
115
81
0 commit comments