-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
166 additions
and
16 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
lib/spec/runners/helpers/ssz_static_containers/fixed_test_struct.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
defmodule Helpers.SszStaticContainers.FixedTestStruct do | ||
@moduledoc """ | ||
Struct definition for `FixedTestStruct`. | ||
""" | ||
@behaviour LambdaEthereumConsensus.Container | ||
|
||
fields = [ | ||
:A, | ||
:B, | ||
:C | ||
] | ||
|
||
@type uint32 :: 0..unquote(2 ** 32 - 1) | ||
|
||
@enforce_keys fields | ||
defstruct fields | ||
|
||
@type t :: %__MODULE__{ | ||
A: SszTypes.uint8(), | ||
B: SszTypes.uint64(), | ||
C: uint32() | ||
} | ||
|
||
@impl LambdaEthereumConsensus.Container | ||
def schema do | ||
[ | ||
{:A, {:int, 8}}, | ||
{:B, {:int, 64}}, | ||
{:C, {:int, 32}} | ||
] | ||
end | ||
end |
24 changes: 24 additions & 0 deletions
24
lib/spec/runners/helpers/ssz_static_containers/single_field_test_struct.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
defmodule Helpers.SszStaticContainers.SingleFieldTestStruct do | ||
@moduledoc """ | ||
Struct definition for `SingleFieldTestStruct`. | ||
""" | ||
@behaviour LambdaEthereumConsensus.Container | ||
|
||
fields = [ | ||
:A | ||
] | ||
|
||
@enforce_keys fields | ||
defstruct fields | ||
|
||
@type t :: %__MODULE__{ | ||
A: SszTypes.uint8() | ||
} | ||
|
||
@impl LambdaEthereumConsensus.Container | ||
def schema do | ||
[ | ||
{:A, {:int, 8}} | ||
] | ||
end | ||
end |
29 changes: 29 additions & 0 deletions
29
lib/spec/runners/helpers/ssz_static_containers/small_test_struct.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
defmodule Helpers.SszStaticContainers.SmallTestStruct do | ||
@moduledoc """ | ||
Struct definition for `SmallTestStruct`. | ||
""" | ||
@behaviour LambdaEthereumConsensus.Container | ||
|
||
fields = [ | ||
:A, | ||
:B | ||
] | ||
|
||
@type uint16 :: 0..unquote(2 ** 16 - 1) | ||
|
||
@enforce_keys fields | ||
defstruct fields | ||
|
||
@type t :: %__MODULE__{ | ||
A: uint16(), | ||
B: uint16() | ||
} | ||
|
||
@impl LambdaEthereumConsensus.Container | ||
def schema do | ||
[ | ||
{:A, {:int, 16}}, | ||
{:B, {:int, 16}} | ||
] | ||
end | ||
end |
32 changes: 32 additions & 0 deletions
32
lib/spec/runners/helpers/ssz_static_containers/var_test_struct.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
defmodule Helpers.SszStaticContainers.VarTestStruct do | ||
@moduledoc """ | ||
Struct definition for `VarTestStruct`. | ||
""" | ||
@behaviour LambdaEthereumConsensus.Container | ||
|
||
fields = [ | ||
:A, | ||
:B, | ||
:C | ||
] | ||
|
||
@type uint16 :: 0..unquote(2 ** 16 - 1) | ||
|
||
@enforce_keys fields | ||
defstruct fields | ||
|
||
@type t :: %__MODULE__{ | ||
A: uint16(), | ||
B: list(uint16()), | ||
C: SszTypes.uint8() | ||
} | ||
|
||
@impl LambdaEthereumConsensus.Container | ||
def schema do | ||
[ | ||
{:A, {:int, 16}}, | ||
{:B, {:list, {:int, 16}, 1024}}, | ||
{:C, {:int, 8}} | ||
] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters