You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let step = BigInt::from(5000_i64).shl(u128::BITS) - BigInt::from(77_777_777_777_i64);// offset from full integers
164
+
let delta = BigInt::from(1_i64).shl(u128::BITS) - BigInt::from(33_333_333_333_i64);// offset from full integers
165
+
166
+
letmut prev_theta = BigInt::from(0i64);
167
+
letmut theta = delta;
168
+
169
+
letmut b = String::from("t0, t1, y\n");
170
+
let simple = compute_reward(
171
+
0,
172
+
BigInt::from(0i64),
173
+
BigInt::from(0i64),
174
+
&SIMPLE_TOTAL,
175
+
&BASELINE_TOTAL,
176
+
);
177
+
178
+
for _ in0..512{
179
+
letmut reward = compute_reward(
180
+
0,
181
+
prev_theta.clone(),
182
+
theta.clone(),
183
+
&SIMPLE_TOTAL,
184
+
&BASELINE_TOTAL,
185
+
);
186
+
reward -= &simple;
187
+
188
+
let prev_theta_str = &prev_theta.to_string();
189
+
let theta_str = &theta.to_string();
190
+
let reward_str = &reward.to_string();
191
+
b.push_str(prev_theta_str);
192
+
b.push(',');
193
+
b.push_str(theta_str);
194
+
b.push(',');
195
+
b.push_str(reward_str);
196
+
b.push('\n');
197
+
198
+
prev_theta += &step;
199
+
theta += &step;
200
+
}
201
+
202
+
// compare test output to golden file used for golang tests; file originally located at filecoin-project/specs-actors/actors/builtin/reward/testdata/TestBaselineReward.golden (current link: https://github.com/filecoin-project/specs-actors/blob/d56b240af24517443ce1f8abfbdab7cb22d331f1/actors/builtin/reward/testdata/TestBaselineReward.golden)
203
+
let filename = "testdata/TestBaselineReward.golden";
204
+
let golden_contents =
205
+
fs::read_to_string(filename).expect("Something went wrong reading the file");
0 commit comments