Skip to content

Commit

Permalink
Fix linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
hwwhww committed Jun 18, 2020
1 parent a5d797f commit d5a922a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
4 changes: 3 additions & 1 deletion ssz/sedes/bitvector.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
class Bitvector(BitfieldCompositeSedes[BytesOrByteArray, bytes]):
def __init__(self, bit_count: int) -> None:
if bit_count < 1:
raise ValueError(f"Bitvector must have a size of 1 or greater, got {bit_count}")
raise ValueError(
f"Bitvector must have a size of 1 or greater, got {bit_count}"
)
self.bit_count = bit_count

#
Expand Down
4 changes: 3 additions & 1 deletion ssz/sedes/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class List(
):
def __init__(self, element_sedes: TSedes, max_length: int) -> None:
if max_length < 0:
raise ValueError(f"Lists must have a maximum length of 0 or greater, got {max_length}")
raise ValueError(
f"Lists must have a maximum length of 0 or greater, got {max_length}"
)
self.element_sedes = element_sedes
self.max_length = max_length

Expand Down
16 changes: 14 additions & 2 deletions tests/sedes/test_composite_sedes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@
from ssz.exceptions import DeserializationError
from ssz.hashable_list import HashableList
from ssz.hashable_vector import HashableVector
from ssz.sedes import Bitlist, Bitvector, Container, List, UInt, Vector, bytes32, uint8, uint256
from ssz.sedes import (
Bitlist,
Bitvector,
Container,
List,
UInt,
Vector,
bytes32,
uint8,
uint256,
)


@pytest.mark.parametrize(
Expand Down Expand Up @@ -175,7 +185,9 @@ def test_neq(sedes1, sedes2):
(Vector, uint8, 0, False),
),
)
def test_homogeneous_sequence_length_boundary(sedes_type, element_type, length, is_valid):
def test_homogeneous_sequence_length_boundary(
sedes_type, element_type, length, is_valid
):
if is_valid:
sedes_type(element_type, length)
else:
Expand Down

0 comments on commit d5a922a

Please sign in to comment.