Skip to content

Commit 3348152

Browse files
committed
fix tests
1 parent 7b37a42 commit 3348152

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

src/lotus_json/receipt.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ fn shapshots() {
9898
///
9999
/// See <https://github.com/ChainSafe/forest/issues/3459>.
100100
#[test]
101-
#[should_panic = "cannot serialize to v2 AND v3 from the same input"]
102101
fn cannot_call_arbitrary_tests_on_receipt() {
103102
use pretty_assertions::assert_eq;
104103

@@ -130,19 +129,9 @@ fn cannot_call_arbitrary_tests_on_receipt() {
130129
json
131130
);
132131

133-
// both of these cannot pass at the same time...
134-
assert_eq!(
135-
v2,
136-
serde_json::from_value::<LotusJson<_>>(json.clone())
137-
.unwrap()
138-
.into_inner(),
139-
"cannot serialize to v2 AND v3 from the same input"
140-
);
141-
assert_eq!(
142-
v3,
143-
serde_json::from_value::<LotusJson<_>>(json)
144-
.unwrap()
145-
.into_inner(),
146-
"cannot serialize to v2 AND v3 from the same input"
147-
);
132+
let deserialized = serde_json::from_value::<LotusJson<Receipt>>(json)
133+
.unwrap()
134+
.into_inner();
135+
assert!(matches!(deserialized, Receipt::V3(_)));
136+
assert_eq!(v3, deserialized);
148137
}

0 commit comments

Comments
 (0)