Skip to content

Commit 0462441

Browse files
committed
fix
1 parent 97436ef commit 0462441

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

rust/vote-tx-v2/src/decoding.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ impl Encode<()> for PropId {
240240

241241
#[cfg(test)]
242242
mod tests {
243+
use proptest::{prelude::any_with, sample::size_range};
243244
use test_strategy::proptest;
244245

245246
use super::*;
@@ -250,7 +251,18 @@ mod tests {
250251

251252
#[proptest]
252253
fn generalized_tx_from_bytes_to_bytes_test(
253-
vote_type: Vec<u8>, votes: Vec<PropVote>, voter_data: Vec<u8>,
254+
vote_type: Vec<u8>,
255+
// generates a votes in range from 1 to 10, and choices in range from 1 to 10
256+
#[strategy(any_with::<Vec<PropVote>>((
257+
size_range(1..10usize),
258+
(
259+
(size_range(1..10usize), Default::default()),
260+
Default::default(),
261+
Default::default(),
262+
),
263+
)))]
264+
votes: Vec<PropVote>,
265+
voter_data: Vec<u8>,
254266
) {
255267
let generalized_tx = GeneralizedTx {
256268
tx_body: TxBody {

0 commit comments

Comments
 (0)