Skip to content

Commit 7c670a0

Browse files
committed
fix tests
1 parent 1d7afdf commit 7c670a0

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

rust/catalyst-voting/src/crypto/zk_unit_vector/decoding.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ impl ResponseRandomness {
144144

145145
#[cfg(test)]
146146
mod tests {
147-
use std::io::Cursor;
148-
149147
use test_strategy::proptest;
150148

151149
use super::*;
@@ -156,7 +154,7 @@ mod tests {
156154
) {
157155
let bytes = p1.to_bytes();
158156
assert_eq!(bytes.len(), p1.bytes_size());
159-
let p2 = UnitVectorProof::from_bytes(&mut Cursor::new(bytes), p1.size()).unwrap();
157+
let p2 = UnitVectorProof::from_bytes(&mut bytes.as_slice(), p1.size()).unwrap();
160158
assert_eq!(p1, p2);
161159
}
162160

rust/catalyst-voting/src/txs/v1/decoding.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ impl Tx {
154154

155155
#[cfg(test)]
156156
mod tests {
157-
use std::io::Cursor;
158-
159157
use proptest::prelude::{any, any_with, Arbitrary, BoxedStrategy, Strategy};
160158
use test_strategy::proptest;
161159

@@ -211,7 +209,7 @@ mod tests {
211209
let size = u32::from_be_bytes(bytes[0..4].try_into().unwrap());
212210
assert_eq!(size as usize, bytes.len() - 4);
213211

214-
let t2 = Tx::from_bytes(&mut Cursor::new(bytes)).unwrap();
212+
let t2 = Tx::from_bytes(&mut bytes.as_slice()).unwrap();
215213
assert_eq!(t1, t2);
216214
}
217215
}

0 commit comments

Comments
 (0)