Skip to content

Commit 6ff38bf

Browse files
committed
fix: validator_worker/lib test case
1 parent 01fb66f commit 6ff38bf

File tree

2 files changed

+19
-34
lines changed

2 files changed

+19
-34
lines changed

validator_worker/src/core/fees.rs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,7 @@ mod test {
210210
("a".to_string(), 990.into()),
211211
("b".to_string(), 1_188.into()),
212212
(IDS.get("leader").unwrap().to_string(), 11.into()),
213-
(
214-
IDS.get("follower").unwrap().to_string(),
215-
11.into(),
216-
),
213+
(IDS.get("follower").unwrap().to_string(), 11.into()),
217214
]
218215
.into_iter()
219216
.collect();
@@ -236,25 +233,16 @@ mod test {
236233
let balances_map = vec![
237234
("a".to_string(), 100.into()),
238235
("b".to_string(), 2_000.into()),
239-
(
240-
IDS.get("leader").unwrap().to_string(),
241-
200.into(),
242-
),
236+
(IDS.get("leader").unwrap().to_string(), 200.into()),
243237
]
244238
.into_iter()
245239
.collect();
246240

247241
let expected_balances: BalancesMap = vec![
248242
("a".to_string(), 99.into()),
249243
("b".to_string(), 1_980.into()),
250-
(
251-
IDS.get("leader").unwrap().to_string(),
252-
209.into(),
253-
),
254-
(
255-
IDS.get("follower").unwrap().to_string(),
256-
11.into(),
257-
),
244+
(IDS.get("leader").unwrap().to_string(), 209.into()),
245+
(IDS.get("follower").unwrap().to_string(), 11.into()),
258246
]
259247
.into_iter()
260248
.collect();
@@ -292,10 +280,7 @@ mod test {
292280
("d".to_string(), 4_950.into()),
293281
("e".to_string(), 3_960.into()),
294282
(IDS.get("leader").unwrap().to_string(), 51.into()),
295-
(
296-
IDS.get("follower").unwrap().to_string(),
297-
50.into(),
298-
),
283+
(IDS.get("follower").unwrap().to_string(), 50.into()),
299284
]
300285
.into_iter()
301286
.collect();

validator_worker/src/lib.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,22 +98,22 @@ mod test {
9898
);
9999
}
100100

101-
// #[test]
102-
// fn get_state_root_hash_returns_correct_hash_for_fake_channel_aligning_with_js_impl() {
103-
// let channel = DUMMY_CHANNEL.clone();
101+
#[test]
102+
fn get_state_root_hash_returns_correct_hash_for_fake_channel_aligning_with_js_impl() {
103+
let channel = DUMMY_CHANNEL.clone();
104104

105-
// let iface = setup_iface(&channel);
105+
let iface = setup_iface(&channel);
106106

107-
// let balances: BalancesMap = vec![(IDS["publisher"].clone(), 0.into())]
108-
// .into_iter()
109-
// .collect();
107+
let balances: BalancesMap = vec![(IDS["publisher"].to_string(), 0.into())]
108+
.into_iter()
109+
.collect();
110110

111-
// let actual_hash =
112-
// get_state_root_hash(&iface, &balances).expect("should get state root hash");
111+
let actual_hash =
112+
get_state_root_hash(&iface, &balances).expect("should get state root hash");
113113

114-
// assert_eq!(
115-
// "4fad5375c3ef5f8a9d23a8276fed0151164dea72a5891cec8b43e1d190ed430e",
116-
// hex::encode(actual_hash)
117-
// );
118-
// }
114+
assert_eq!(
115+
"4fad5375c3ef5f8a9d23a8276fed0151164dea72a5891cec8b43e1d190ed430e",
116+
hex::encode(actual_hash)
117+
);
118+
}
119119
}

0 commit comments

Comments
 (0)