use of tech.pegasys.teku.infrastructure.ssz.TestContainers.TestByteVectorContainer in project teku by ConsenSys.
the class SszListHintsTest method listTypesTestParameters.
static Stream<Arguments> listTypesTestParameters() {
Random random = new Random(1);
SszSchema<?> listElementType1 = TestContainer.SSZ_SCHEMA;
Supplier<TestContainer> elementSupplier1 = () -> {
Bytes32 bytes32 = Bytes32.random();
TestSubContainer subContainer = new TestSubContainer(UInt64.fromLongBits(random.nextLong()), bytes32);
return new TestContainer(subContainer, UInt64.fromLongBits(random.nextLong()));
};
SszSchema<?> listElementType2 = TestSmallContainer.SSZ_SCHEMA;
Supplier<TestSmallContainer> elementSupplier2 = () -> new TestSmallContainer(random.nextBoolean());
SszSchema<?> listElementType3 = TestByteVectorContainer.SSZ_SCHEMA;
Supplier<TestByteVectorContainer> elementSupplier3 = () -> TestByteVectorContainer.random(random);
SszSchema<?> listElementType4 = TestDoubleSuperContainer.SSZ_SCHEMA;
Supplier<TestDoubleSuperContainer> elementSupplier4 = () -> new TestDoubleSuperContainer(random.nextLong(), TestByteVectorContainer.random(random), random.nextLong(), TestByteVectorContainer.random(random), random.nextLong());
return Stream.of(Arguments.of(listElementType1, 3, elementSupplier1), Arguments.of(listElementType1, 4, elementSupplier1), Arguments.of(listElementType1, 5, elementSupplier1), Arguments.of(listElementType1, 15, elementSupplier1), Arguments.of(listElementType1, 16, elementSupplier1), Arguments.of(listElementType1, 17, elementSupplier1), Arguments.of(listElementType1, 100, elementSupplier1), Arguments.of(listElementType1, 127, elementSupplier1), Arguments.of(listElementType1, 128, elementSupplier1), Arguments.of(listElementType1, 129, elementSupplier1), Arguments.of(listElementType1, 255, elementSupplier1), Arguments.of(listElementType1, 256, elementSupplier1), Arguments.of(listElementType1, 257, elementSupplier1), Arguments.of(listElementType1, Integer.MAX_VALUE, elementSupplier1), Arguments.of(listElementType1, 16L * Integer.MAX_VALUE, elementSupplier1), Arguments.of(listElementType2, 15, elementSupplier2), Arguments.of(listElementType2, 16, elementSupplier2), Arguments.of(listElementType2, 17, elementSupplier2), Arguments.of(listElementType3, 15, elementSupplier3), Arguments.of(listElementType3, 16, elementSupplier3), Arguments.of(listElementType3, 17, elementSupplier3), Arguments.of(listElementType4, 15, elementSupplier4), Arguments.of(listElementType4, 16, elementSupplier4), Arguments.of(listElementType4, 17, elementSupplier4));
}
Aggregations