aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpukkamustard <pukkamustard@posteo.net>2021-03-22 07:57:24 +0000
committerpukkamustard <pukkamustard@posteo.net>2021-03-22 07:57:24 +0000
commit95bddf3fa733f17a4ba2864108e59f4b86e76ed3 (patch)
treed584ad75a434d98634880035ca1108855a68c455
parent4da4ac1d0aeb6f9cdb52bcffd3319c9e22281c30 (diff)
parentb196963b3d606f2684dee9f716118b6c5026c517 (diff)
Merge branch 'specs' into 'main'
Add specs See merge request openengiadina/elixir-eris!1
-rw-r--r--lib/eris.ex83
-rw-r--r--lib/eris/crypto.ex30
-rw-r--r--lib/eris/decode.ex76
-rw-r--r--lib/eris/encode.ex99
-rw-r--r--lib/eris/read_capability.ex17
-rw-r--r--test/eris_large_test.exs12
-rw-r--r--test/eris_test.exs2
7 files changed, 179 insertions, 140 deletions
diff --git a/lib/eris.ex b/lib/eris.ex
index 0cc8860..370f434 100644
--- a/lib/eris.ex
+++ b/lib/eris.ex
@@ -1,4 +1,5 @@
-# SPDX-FileCopyrightText: 2020 pukkamustard <pukkamustard@posteo.net>
+# SPDX-FileCopyrightText: 2020-2021 pukkamustard <pukkamustard@posteo.net>
+# SPDX-FileCopyrightText: 2020-2021 rustra <rustra@disroot.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -10,6 +11,8 @@ defmodule ERIS do
See http://purl.org/eris
"""
+ alias ERIS.{Decode, Encode, ReadCapability}
+
defprotocol BlockStorage do
@doc "Store some data and return the hash reference"
def put(bs, data)
@@ -21,7 +24,8 @@ defmodule ERIS do
defimpl BlockStorage, for: Map do
def put(map, data) do
ref = ERIS.Crypto.blake2b(data)
- {:ok, map |> Map.put(ref, data)}
+
+ {:ok, Map.put(map, ref, data)}
end
def get(map, ref) do
@@ -36,10 +40,15 @@ defmodule ERIS do
end
defmodule BlockStorage.Dummy do
- @moduledoc "A dummy block storage that doesn't store anything. Useful for computing the ERIS capability."
+ @moduledoc """
+ A dummy block storage that doesn't store anything. Useful for computing the
+ ERIS capability.
+ """
defstruct []
+ @type t :: %__MODULE__{}
+
def new, do: %__MODULE__{}
defimpl BlockStorage, for: __MODULE__ do
@@ -49,50 +58,30 @@ defmodule ERIS do
end
end
- defp chunk_binary(data, block_size) do
- Stream.resource(
- fn -> data end,
- fn data ->
- case data do
- <<>> ->
- {:halt, <<>>}
-
- <<head::binary-size(block_size), rest::binary>> ->
- {[head], rest}
-
- _ ->
- {[data], <<>>}
- end
- end,
- fn _ -> :ok end
- )
- end
-
@doc """
Encodes `data` using `block_size` and `convergence_secret` and store blocks in
`block_storage`.
Returns a tuple of the read capability and the block storage.
"""
+ @spec encode(String.t(), BlockStorage.t(), keyword) :: {ReadCapability.t(), BlockStorage.t()}
def encode(data, block_storage, opts \\ []) do
block_size = Keyword.get(opts, :block_size, 1024)
convergence_secret = Keyword.get(opts, :convergence_secret, <<0::256>>)
data
|> chunk_binary(block_size)
- |> ERIS.Encode.stream_encode(block_size: block_size, convergence_secret: convergence_secret)
+ |> Encode.stream_encode(block_size: block_size, convergence_secret: convergence_secret)
|> Enum.reduce(
{nil, block_storage},
fn block_or_root, {root, block_storage} ->
case block_or_root do
- %ERIS.ReadCapability{} ->
+ %ReadCapability{} ->
{block_or_root, block_storage}
_ ->
- case BlockStorage.put(block_storage, block_or_root) do
- {:ok, block_storage} ->
- {root, block_storage}
- end
+ with {:ok, block_storage} <- BlockStorage.put(block_storage, block_or_root),
+ do: {root, block_storage}
end
end
)
@@ -104,6 +93,7 @@ defmodule ERIS do
Returns the read capability as URN string.
"""
+ @spec encode_read_capability(String.t(), keyword) :: ReadCapability.t()
def encode_read_capability(data, opts \\ []) do
data
|> encode(BlockStorage.Dummy.new(), opts)
@@ -116,10 +106,11 @@ defmodule ERIS do
Returns the read capability as URN string.
"""
+ @spec encode_urn(String.t(), keyword) :: String.t()
def encode_urn(data, opts \\ []) do
data
|> encode_read_capability(opts)
- |> ERIS.ReadCapability.to_string()
+ |> ReadCapability.to_string()
end
@doc """
@@ -128,20 +119,38 @@ defmodule ERIS do
For access to the streaming interface use `ERIS.Decode.stream_decode`.
"""
- def decode(%ERIS.ReadCapability{} = read_capability, block_storage) do
- ERIS.Decode.stream_decode(read_capability, block_storage)
+ @spec decode(ReadCapability.t(), BlockStorage.t()) :: {:ok, binary} | {:error, atom}
+ def decode(%ReadCapability{} = read_capability, block_storage) do
+ read_capability
+ |> Decode.stream_decode(block_storage)
|> Enum.reduce({:ok, <<>>}, fn block, {:ok, acc} ->
- if is_binary(block) do
- {:ok, acc <> block}
- else
- block
- end
+ if is_binary(block), do: {:ok, acc <> block}, else: block
end)
end
def decode(read_capability, block_storage) do
- with {:ok, read_capability} <- ERIS.ReadCapability.parse(read_capability) do
+ with {:ok, read_capability} <- ReadCapability.parse(read_capability) do
decode(read_capability, block_storage)
end
end
+
+ @spec chunk_binary(String.t(), number) :: Enumerable.t()
+ defp chunk_binary(data, block_size) do
+ Stream.resource(
+ fn -> data end,
+ fn data ->
+ case data do
+ <<>> ->
+ {:halt, <<>>}
+
+ <<head::binary-size(block_size), rest::binary>> ->
+ {[head], rest}
+
+ _ ->
+ {[data], <<>>}
+ end
+ end,
+ fn _ -> :ok end
+ )
+ end
end
diff --git a/lib/eris/crypto.ex b/lib/eris/crypto.ex
index 841adb3..b5cc3e1 100644
--- a/lib/eris/crypto.ex
+++ b/lib/eris/crypto.ex
@@ -1,4 +1,5 @@
-# SPDX-FileCopyrightText: 2020 pukkamustard <pukkamustard@posteo.net>
+# SPDX-FileCopyrightText: 2020-2021 pukkamustard <pukkamustard@posteo.net>
+# SPDX-FileCopyrightText: 2020-2021 rustra <rustra@disroot.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -14,6 +15,7 @@ defmodule ERIS.Crypto do
@doc """
Returns the ChaCha20 cipher text of `data` given `key` (using null nonce).
"""
+ @spec chacha20(binary, keyword) :: binary
def chacha20(data, key: key) do
:monocypher.crypto_ietf_chacha20(data, key, <<0::96>>)
end
@@ -21,6 +23,7 @@ defmodule ERIS.Crypto do
@doc """
Returns the Blake2b-256 hash of `data`.
"""
+ @spec blake2b(binary) :: binary
def blake2b(data) do
:monocypher.crypto_blake2b_general(32, <<>>, data)
end
@@ -28,6 +31,7 @@ defmodule ERIS.Crypto do
@doc """
Returns the Blake2b-256 hash of `data` using the hashing key `key`.
"""
+ @spec blake2b(binary, keyword) :: binary
def blake2b(data, key: key) do
:monocypher.crypto_blake2b_general(32, key, data)
end
@@ -35,25 +39,18 @@ defmodule ERIS.Crypto do
@doc """
Returns `data` padded to a multiple of `block_size`.
"""
+ @spec pad(binary, keyword) :: binary
def pad(data, block_size: block_size) do
data_size = byte_size(data)
pad_len = ((div(data_size, block_size) + 1) * block_size - data_size - 1) * 8
- data <> <<0x80::8>> <> <<0::size(pad_len)>>
- end
-
- defp unpad_loop(data) do
- data_size = byte_size(data)
- case binary_part(data, data_size, -1) do
- <<0x00>> -> unpad_loop(binary_part(data, 0, data_size - 1))
- <<0x80>> -> {:ok, binary_part(data, 0, data_size - 1)}
- _ -> {:error, :invalid_padding}
- end
+ data <> <<0x80::8>> <> <<0::size(pad_len)>>
end
@doc """
Returns unpadded `data`.
"""
+ @spec unpad(binary, keyword) :: {:ok, binary} | {:error, any}
def unpad(data, block_size: block_size) do
data_size = byte_size(data)
@@ -63,4 +60,15 @@ defmodule ERIS.Crypto do
unpad_loop(data)
end
end
+
+ @spec unpad_loop(binary) :: {:ok, binary} | {:error, atom}
+ defp unpad_loop(data) do
+ data_size = byte_size(data)
+
+ case binary_part(data, data_size, -1) do
+ <<0x00>> -> unpad_loop(binary_part(data, 0, data_size - 1))
+ <<0x80>> -> {:ok, binary_part(data, 0, data_size - 1)}
+ _ -> {:error, :invalid_padding}
+ end
+ end
end
diff --git a/lib/eris/decode.ex b/lib/eris/decode.ex
index 6691e24..53c7c3a 100644
--- a/lib/eris/decode.ex
+++ b/lib/eris/decode.ex
@@ -1,4 +1,5 @@
-# SPDX-FileCopyrightText: 2020 pukkamustard <pukkamustard@posteo.net>
+# SPDX-FileCopyrightText: 2020-2021 pukkamustard <pukkamustard@posteo.net>
+# SPDX-FileCopyrightText: 2020-2021 rustra <rustra@disroot.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -6,6 +7,7 @@ defmodule ERIS.Decode do
@moduledoc """
ERIS stream decoder. Returns a stream that emits decoded blocks.
"""
+
alias ERIS.{BlockStorage, Crypto, ReadCapability}
defmodule Node do
@@ -24,9 +26,18 @@ defmodule ERIS.Decode do
defstruct level: 1, left: [], up: :top, right: [], last?: false
+ @type t :: %__MODULE__{
+ level: number,
+ left: [{binary, binary}],
+ up: :top | t,
+ right: [{binary, binary}],
+ last?: bool
+ }
+
@doc """
Create a node from a read capability.
"""
+ @spec from_read_capability(ReadCapability.t()) :: t
def from_read_capability(%ReadCapability{} = read_capability) do
%__MODULE__{
level: read_capability.level + 1,
@@ -88,6 +99,7 @@ defmodule ERIS.Decode do
@doc """
Get block from BlockStorage and traverse the tree down.
"""
+ @spec down(t, BlockStorage.t()) :: t
def down(%__MODULE__{level: level, right: [{reference, key} | tail]} = node, block_storage)
when level > 1 do
with {:ok, block} <- get_block(block_storage, reference) do
@@ -104,16 +116,41 @@ defmodule ERIS.Decode do
@doc """
Attempt to go right
"""
+ @spec right(t) :: t
def right(%__MODULE__{right: []} = node), do: node
def right(%__MODULE__{left: left, right: [head | tail]} = node) do
%{node | left: left ++ [head], right: tail}
end
+ @spec up(t) :: :top | t
def up(%__MODULE__{up: :top}), do: :top
def up(%__MODULE__{up: up}), do: up
end
+ @spec stream_decode(ReadCapability.t(), BlockStorage.t()) :: Enumerable.t()
+ def stream_decode(%ReadCapability{} = read_capability, block_storage) do
+ Stream.resource(
+ fn -> Node.from_read_capability(read_capability) end,
+ fn node ->
+ case traverse_tree(node, block_storage, read_capability.block_size) do
+ {_, %Node{}} = acc ->
+ acc
+
+ # Halt the stream.
+ :halt ->
+ {:halt, :halt}
+
+ # If traverse_tree does not return a blocks-node tuple return value as
+ # error and halt in next iteration.
+ error ->
+ {[error], :halt}
+ end
+ end,
+ fn _ -> :ok end
+ )
+ end
+
defp get_block(block_storage, reference) do
with {:ok, block} <- BlockStorage.get(block_storage, reference) do
if Crypto.blake2b(block) == reference do
@@ -150,51 +187,20 @@ defmodule ERIS.Decode do
_block_size
) do
with {:ok, block} <- get_block(block_storage, reference) do
- {[
- block
- |> Crypto.chacha20(key: key)
- ], Node.right(node)}
+ {[Crypto.chacha20(block, key: key)], Node.right(node)}
end
end
# reached end of a node. Go up, one right and continue there.
defp traverse_tree(%Node{right: []} = node, _, _) do
- {[],
- node
- |> Node.up()
- |> Node.right()}
+ {[], node |> Node.up() |> Node.right()}
end
# In the middle of a non leaf node, go down.
defp traverse_tree(%Node{} = node, block_storage, _) do
- {[], node |> Node.down(block_storage)}
+ {[], Node.down(node, block_storage)}
end
# handle error (non Node) by passing-trough
defp traverse_tree(error, _, _), do: error
-
- def stream_decode(%ReadCapability{} = read_capability, block_storage) do
- Stream.resource(
- fn ->
- read_capability
- |> Node.from_read_capability()
- end,
- fn node ->
- case traverse_tree(node, block_storage, read_capability.block_size) do
- {_, %Node{}} = acc ->
- acc
-
- # Halt the stream.
- :halt ->
- {:halt, :halt}
-
- # If traverse_tree does not return a blocks-node tuple return value as
- # error and halt in next iteration.
- error ->
- {[error], :halt}
- end
- end,
- fn _ -> :ok end
- )
- end
end
diff --git a/lib/eris/encode.ex b/lib/eris/encode.ex
index 443064e..68684b0 100644
--- a/lib/eris/encode.ex
+++ b/lib/eris/encode.ex
@@ -1,4 +1,5 @@
-# SPDX-FileCopyrightText: 2020 pukkamustard <pukkamustard@posteo.net>
+# SPDX-FileCopyrightText: 2020-2021 pukkamustard <pukkamustard@posteo.net>
+# SPDX-FileCopyrightText: 2020-2021 rustra <rustra@disroot.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -6,21 +7,59 @@ defmodule ERIS.Encode do
@moduledoc """
Stream encoding interface.
- These are low-level interfaces to the ERIS encoding that allow streams of data to be encoded.
+ These are low-level interfaces to the ERIS encoding that allow streams of data
+ to be encoded.
"""
+ alias ERIS.{Crypto, ReadCapability}
+
+ @doc """
+ Takes a stream of data block that are correctly chunked to `block_size` and
+ encodes them using ERIS using specified block size and convergence secret.
+
+ Returns a stream that emits encrypted blocks (of size `block_size`) and a
+ single `ERIS.ReadCapability`.
+
+ This is a low-level interface to the stream encoder and can be used to encode
+ content being read from some I/O device. For encoding in-memory data use `ERIS.encode`.
+ """
+ @spec stream_encode(Enumerable.t(), keyword) :: Enumerable.t()
+ def stream_encode(stream, block_size: block_size, convergence_secret: convergence_secret) do
+ arity = div(block_size, 64)
+
+ stream
+ |> stream_zip_with_last_bool
+ |> stream_pad_last(block_size: block_size)
+ |> Stream.transform(%{}, fn {data_block, last?}, levels ->
+ with {block, reference, key} <-
+ encrypt_block(data_block, convergence_secret: convergence_secret),
+ levels <- add_to_level(levels, 0, {reference, key}),
+ {collected_blocks, levels} <-
+ collect(levels, 0, arity: arity, convergence_secret: convergence_secret) do
+ if last? do
+ {[block] ++
+ collected_blocks ++
+ finalize(levels, 0, arity: arity, convergence_secret: convergence_secret), levels}
+ else
+ {[block], levels}
+ end
+ end
+ end)
+ end
+
# This transforms the stream into a stream of tuples of the original elements
# and a boolean indicating if element is last of stream
defp stream_zip_with_last_bool(stream) do
- stream
- |> Stream.zip(Stream.concat(Stream.drop(stream, 1), [nil]) |> Stream.map(&is_nil/1))
+ Stream.zip(
+ stream,
+ stream |> Stream.drop(1) |> Stream.concat([nil]) |> Stream.map(&is_nil/1)
+ )
end
defp stream_pad_last(stream, block_size: block_size) do
- stream
- |> Stream.flat_map(fn {block, last?} ->
+ Stream.flat_map(stream, fn {block, last?} ->
if last? do
- with padded <- ERIS.Crypto.pad(block, block_size: block_size) do
+ with padded <- Crypto.pad(block, block_size: block_size) do
if byte_size(padded) > block_size do
[
{binary_part(padded, 0, block_size), false},
@@ -37,9 +76,9 @@ defmodule ERIS.Encode do
end
defp encrypt_block(unencrypted, convergence_secret: convergence_secret) do
- with key <- ERIS.Crypto.blake2b(unencrypted, key: convergence_secret),
- block <- ERIS.Crypto.chacha20(unencrypted, key: key),
- reference <- ERIS.Crypto.blake2b(block) do
+ with key <- Crypto.blake2b(unencrypted, key: convergence_secret),
+ block <- Crypto.chacha20(unencrypted, key: key),
+ reference <- Crypto.blake2b(block) do
{block, reference, key}
end
end
@@ -89,7 +128,7 @@ defmodule ERIS.Encode do
level_number === top_level(levels) && length(levels[top_level(levels)]) === 1 ->
with [{reference, key}] <- levels[level_number] do
[
- %ERIS.ReadCapability{
+ %ReadCapability{
block_size: arity * 64,
level: level_number,
reference: reference,
@@ -112,7 +151,7 @@ defmodule ERIS.Encode do
blocks ++ blocks_from_above
end
- length(Map.get(levels, level_number, [])) === 0 ->
+ Enum.empty?(Map.get(levels, level_number, [])) ->
finalize(levels, level_number + 1, arity: arity, convergence_secret: convergence_secret)
end
end
@@ -124,40 +163,6 @@ defmodule ERIS.Encode do
end
defp add_to_level(levels, level_number, {reference, key}) do
- levels
- |> Map.update(level_number, [{reference, key}], &(&1 ++ [{reference, key}]))
- end
-
- @doc """
- Takes a stream of data block that are correctly chunked to `block_size` and
- encodes them using ERIS using specified block size and convergence secret.
-
- Returns a stream that emits encrypted blocks (of size `block_size`) and a
- single `ERIS.ReadCapability`.
-
- This is a low-level interface to the stream encoder and can be used to encode
- content being read from some I/O device. For encoding in-memory data use `ERIS.encode`.
- """
- def stream_encode(stream, block_size: block_size, convergence_secret: convergence_secret) do
- arity = div(block_size, 64)
-
- stream
- |> stream_zip_with_last_bool
- |> stream_pad_last(block_size: block_size)
- |> Stream.transform(%{}, fn {data_block, last?}, levels ->
- with {block, reference, key} <-
- encrypt_block(data_block, convergence_secret: convergence_secret),
- levels <- add_to_level(levels, 0, {reference, key}),
- {collected_blocks, levels} <-
- collect(levels, 0, arity: arity, convergence_secret: convergence_secret) do
- if last? do
- {[block] ++
- collected_blocks ++
- finalize(levels, 0, arity: arity, convergence_secret: convergence_secret), levels}
- else
- {[block], levels}
- end
- end
- end)
+ Map.update(levels, level_number, [{reference, key}], &(&1 ++ [{reference, key}]))
end
end
diff --git a/lib/eris/read_capability.ex b/lib/eris/read_capability.ex
index abdd33f..0a3b0b4 100644
--- a/lib/eris/read_capability.ex
+++ b/lib/eris/read_capability.ex
@@ -1,4 +1,5 @@
-# SPDX-FileCopyrightText: 2020 pukkamustard <pukkamustard@posteo.net>
+# SPDX-FileCopyrightText: 2020-2021 pukkamustard <pukkamustard@posteo.net>
+# SPDX-FileCopyrightText: 2020-2021 rustra <rustra@disroot.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -9,17 +10,25 @@ defmodule ERIS.ReadCapability do
defstruct block_size: nil, level: nil, reference: nil, key: nil
+ @type t :: %__MODULE__{
+ block_size: number,
+ level: number,
+ reference: binary,
+ key: binary
+ }
+
@doc """
Encode ERIS read capability `read_capability` as binary.
See http://purl.org/eris#_binary_encoding_of_read_capability
"""
+ @spec to_binary(t) :: binary
def to_binary(%__MODULE__{} = read_capability) do
case read_capability.block_size do
1024 ->
<<0>> <> <<read_capability.level>> <> read_capability.reference <> read_capability.key
- 32768 ->
+ 32_768 ->
<<1>> <> <<read_capability.level>> <> read_capability.reference <> read_capability.key
end
end
@@ -29,6 +38,7 @@ defmodule ERIS.ReadCapability do
See http://purl.org/eris#_urn
"""
+ @spec to_string(t) :: String.t()
def to_string(%__MODULE__{} = read_capability) do
"urn:erisx2:" <>
(read_capability
@@ -39,6 +49,7 @@ defmodule ERIS.ReadCapability do
@doc """
Parse an ERIS read capability from a URN (string representaiton) or binary encoding.
"""
+ @spec parse(any) :: {:ok, t} | {:error, atom}
def parse(%__MODULE__{} = read_capability), do: {:ok, read_capability}
def parse(urn) when is_binary(urn) do
@@ -52,7 +63,7 @@ defmodule ERIS.ReadCapability do
{:ok, %__MODULE__{block_size: 1024, level: level, reference: reference, key: key}}
<<1>> <> <<level>> <> <<reference::binary-size(32)>> <> <<key::binary-size(32)>> ->
- {:ok, %__MODULE__{block_size: 32768, level: level, reference: reference, key: key}}
+ {:ok, %__MODULE__{block_size: 32_768, level: level, reference: reference, key: key}}
_ ->
{:error, :invalid_read_capability}
diff --git a/test/eris_large_test.exs b/test/eris_large_test.exs
index b37b0a3..8f0222f 100644
--- a/test/eris_large_test.exs
+++ b/test/eris_large_test.exs
@@ -37,10 +37,10 @@ defmodule ERISLargeTest do
test "1GiB (block size 32KiB)" do
assert "urn:erisx2:AEBFG37LU5BM5N3LXNPNMGAOQPZ5QTJAV22XEMX3EMSAMTP7EWOSD2I7AGEEQCTEKDQX7WCKGM6KQ5ALY5XJC4LMOYQPB2ZAFTBNDB6FAA" =
Stream.take(
- chacha20_stream("1GiB (block size 32KiB)", 32768),
- div(1024 * 1024 * 1024, 32768)
+ chacha20_stream("1GiB (block size 32KiB)", 32_768),
+ div(1024 * 1024 * 1024, 32_768)
)
- |> ERIS.Encode.stream_encode(block_size: 32768, convergence_secret: <<0::256>>)
+ |> ERIS.Encode.stream_encode(block_size: 32_768, convergence_secret: <<0::256>>)
|> Stream.filter(&is_read_capability/1)
|> Enum.map(&ERIS.ReadCapability.to_string/1)
|> List.first()
@@ -51,10 +51,10 @@ defmodule ERISLargeTest do
test "256GiB (block size 32KiB)" do
assert "urn:erisx2:AEBZHI55XJYINGLXWKJKZHBIXN6RSNDU233CY3ELFSTQNSVITBSVXGVGBKBCS4P4M5VSAUOZSMVAEC2VDFQTI5SEYVX4DN53FTJENWX4KU" =
Stream.take(
- chacha20_stream("256GiB (block size 32KiB)", 32768),
- div(1024 * 1024 * 1024 * 256, 32768)
+ chacha20_stream("256GiB (block size 32KiB)", 32_768),
+ div(1024 * 1024 * 1024 * 256, 32_768)
)
- |> ERIS.Encode.stream_encode(block_size: 32768, convergence_secret: <<0::256>>)
+ |> ERIS.Encode.stream_encode(block_size: 32_768, convergence_secret: <<0::256>>)
|> Stream.filter(&is_read_capability/1)
|> Enum.map(&ERIS.ReadCapability.to_string/1)
|> List.first()
diff --git a/test/eris_test.exs b/test/eris_test.exs
index 6bedda3..4d325cf 100644
--- a/test/eris_test.exs
+++ b/test/eris_test.exs
@@ -18,7 +18,7 @@ defmodule ERISTest do
:blocks
]
- def get_all() do
+ def get_all do
File.ls!("test/test-vectors/")
|> Enum.filter(fn file_name -> String.ends_with?(file_name, ".json") end)
|> Stream.chunk_every(1)