Skip to content

Commit b03cdd4

Browse files
committed
try fix for test
1 parent 5724e6a commit b03cdd4

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

test/unit/blobs_test.exs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ defmodule Unit.BlobsTest do
1010
setup %{tmp_dir: tmp_dir} do
1111
start_link_supervised!({LambdaEthereumConsensus.Store.Db, dir: tmp_dir})
1212
start_link_supervised!(LambdaEthereumConsensus.Store.Blocks)
13-
:ok
13+
14+
# Blob sidecar from spec test
15+
blob_sidecar =
16+
SpecTestUtils.read_ssz_from_file!(
17+
"test/fixtures/blobs/blob_sidecar.ssz_snappy",
18+
BlobSidecar
19+
)
20+
21+
{:ok, blob_sidecar: blob_sidecar}
1422
end
1523

1624
defp new_block_info() do
@@ -19,15 +27,8 @@ defmodule Unit.BlobsTest do
1927

2028
describe "Blobs unit tests" do
2129
@tag :tmp_dir
22-
test "Basic blobs saving and loading" do
23-
# Blob sidecar from spec test
24-
blob_sidecar =
25-
SpecTestUtils.read_ssz_from_file!(
26-
"test/fixtures/blobs/blob_sidecar.ssz_snappy",
27-
BlobSidecar
28-
)
29-
30-
Blobs.process_blobs(nil, {:ok, [blob_sidecar]})
30+
test "Basic blobs saving and loading", %{blob_sidecar: blob_sidecar} do
31+
Blobs.add_blob(blob_sidecar)
3132
block_root = Ssz.hash_tree_root!(blob_sidecar.signed_block_header.message)
3233
index = blob_sidecar.index
3334
{:ok, recovered_blob} = BlobDb.get_blob_sidecar(block_root, index)
@@ -36,13 +37,9 @@ defmodule Unit.BlobsTest do
3637
end
3738

3839
@tag :tmp_dir
39-
test "One missing blob from block, then add, then no missing blobs" do
40-
blob_sidecar =
41-
SpecTestUtils.read_ssz_from_file!(
42-
"test/fixtures/blobs/blob_sidecar.ssz_snappy",
43-
BlobSidecar
44-
)
45-
40+
test "One missing blob from block, then add, then no missing blobs", %{
41+
blob_sidecar: blob_sidecar
42+
} do
4643
blob_sidecar = %BlobSidecar{blob_sidecar | index: 0}
4744

4845
# Create random block info
@@ -64,7 +61,7 @@ defmodule Unit.BlobsTest do
6461
missing = Blobs.missing_for_block(block_info)
6562
assert(length(missing) == 1)
6663
# add blob to db
67-
Blobs.add_blob(nil, blob_sidecar)
64+
Blobs.add_blob(blob_sidecar)
6865
# check that the blob is not missing
6966
missing = Blobs.missing_for_block(block_info)
7067
assert(Enum.empty?(missing))

0 commit comments

Comments
 (0)