test: improve slow tests (#3487)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Bjerg
2023-07-02 12:46:16 +02:00
committed by GitHub
parent 9fc950697d
commit d14f995e1a
7 changed files with 63 additions and 7 deletions

View File

@ -68,11 +68,17 @@ impl From<Vec<H256>> for GetBlockBodies {
/// The response to [`GetBlockBodies`], containing the block bodies that the peer knows about if
/// any were found.
#[derive_arbitrary(rlp, 1)]
#[derive_arbitrary(rlp, 16)]
#[derive(Clone, Debug, PartialEq, Eq, RlpEncodableWrapper, RlpDecodableWrapper, Default)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct BlockBodies(
/// The requested block bodies, each of which should correspond to a hash in the request.
#[cfg_attr(
any(test, feature = "arbitrary"),
proptest(
strategy = "proptest::collection::vec(proptest::arbitrary::any::<BlockBody>(), 0..=20)"
)
)]
pub Vec<BlockBody>,
);

View File

@ -17,11 +17,17 @@ pub struct GetReceipts(
/// The response to [`GetReceipts`], containing receipt lists that correspond to each block
/// requested.
#[derive_arbitrary(rlp, 1)]
#[derive_arbitrary(rlp)]
#[derive(Clone, Debug, PartialEq, Eq, RlpEncodableWrapper, RlpDecodableWrapper, Default)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Receipts(
/// Each receipt hash should correspond to a block hash in the request.
#[cfg_attr(
any(test, feature = "arbitrary"),
proptest(
strategy = "proptest::collection::vec(proptest::collection::vec(proptest::arbitrary::any::<ReceiptWithBloom>(), 0..=50), 0..=5)"
)
)]
pub Vec<Vec<ReceiptWithBloom>>,
);