Skip to content

Commit

Permalink
Fix types in ssz_static
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaRedHand committed Mar 14, 2024
1 parent 1c48901 commit 36436ee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
22 changes: 19 additions & 3 deletions test/spec/runners/ssz_static.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ defmodule SszStaticTestRunner do
alias LambdaEthereumConsensus.SszEx
alias LambdaEthereumConsensus.Utils.Diff
alias Ssz
alias Types.BeaconBlock
alias Types.BeaconBlockBody
alias Types.BeaconState
alias Types.ExecutionPayload
alias Types.ExecutionPayloadHeader
alias Types.SignedBeaconBlock

use HardForkAliasInjection

use ExUnit.CaseTemplate
use TestRunner
Expand Down Expand Up @@ -60,15 +68,23 @@ defmodule SszStaticTestRunner do
"SyncCommitteeMessage"
]

@type_map %{
"BeaconBlock" => BeaconBlock,
"BeaconBlockBody" => BeaconBlockBody,
"BeaconState" => BeaconState,
"ExecutionPayload" => ExecutionPayload,
"ExecutionPayloadHeader" => ExecutionPayloadHeader,
"SignedBeaconBlock" => SignedBeaconBlock
}

@impl TestRunner
def skip?(%SpecTestCase{fork: "capella", handler: handler}) do
Enum.member?(@disabled, handler)
end

def skip?(%SpecTestCase{fork: "deneb", handler: handler}) do
# TODO: fix types
# Enum.member?(@disabled, handler)
true
Enum.member?(@disabled, handler)
end

def skip?(_), do: true
Expand Down Expand Up @@ -115,6 +131,6 @@ defmodule SszStaticTestRunner do
end

defp parse_type(%SpecTestCase{handler: handler}) do
Module.concat(Types, handler)
Map.get(@type_map, handler, Module.concat(Types, handler))
end
end
2 changes: 1 addition & 1 deletion test/spec/runners/sync.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defmodule SyncTestRunner do
Enum.member?(@disabled_cases, testcase.case)
end

def skip?(%SpecTestCase{fork: "deneb"} = testcase) do
def skip?(%SpecTestCase{fork: "deneb"}) do
# TODO: update `EngineApiMock` to support the new `new_payload/3` function,
# and the runner to load the block's blobs if on deneb
true
Expand Down

0 comments on commit 36436ee

Please sign in to comment.