Skip to content

Commit

Permalink
Deprecate enum_behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhauner committed Oct 18, 2022
1 parent 3c51f6e commit 89b64a6
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 54 deletions.
45 changes: 29 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion consensus/ssz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ license = "Apache-2.0"
name = "ssz"

[dev-dependencies]
eth2_ssz_derive = "0.3.1"
eth2_ssz_derive = "0.4.0"

[dependencies]
ethereum-types = "0.12.1"
Expand Down
22 changes: 4 additions & 18 deletions consensus/ssz/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ mod derive_macro {
}

#[derive(PartialEq, Debug, Encode, Decode)]
#[ssz(enum_behaviour = "union")]
#[ssz(union)]
enum TwoFixedUnion {
U8(u8),
U16(u16),
Expand Down Expand Up @@ -422,16 +422,9 @@ mod derive_macro {
b: u8,
}

#[derive(PartialEq, Debug, Encode)]
#[ssz(enum_behaviour = "transparent")]
enum TwoVariableTrans {
A(VariableA),
B(VariableB),
}

#[derive(PartialEq, Debug, Encode)]
#[ssz(transparent)]
enum TwoVariableTransDirectTag {
enum TwoVariableTrans {
A(VariableA),
B(VariableB),
}
Expand All @@ -441,16 +434,9 @@ mod derive_macro {
a: TwoVariableTrans,
}

#[derive(PartialEq, Debug, Encode, Decode)]
#[ssz(enum_behaviour = "union")]
enum TwoVariableUnion {
A(VariableA),
B(VariableB),
}

#[derive(PartialEq, Debug, Encode, Decode)]
#[ssz(union)]
enum TwoVariableUnionDirectTag {
enum TwoVariableUnion {
A(VariableA),
B(VariableB),
}
Expand Down Expand Up @@ -509,7 +495,7 @@ mod derive_macro {
}

#[derive(PartialEq, Debug, Encode, Decode)]
#[ssz(enum_behaviour = "union")]
#[ssz(union)]
enum TwoVecUnion {
A(Vec<u8>),
B(Vec<u8>),
Expand Down
3 changes: 2 additions & 1 deletion consensus/ssz_derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "eth2_ssz_derive"
version = "0.3.1"
version = "0.4.0"
authors = ["Paul Hauner <paul@sigmaprime.io>"]
edition = "2021"
description = "Procedural derive macros to accompany the eth2_ssz crate."
Expand All @@ -17,3 +17,4 @@ quote = "1.0.7"
darling = "0.13.0"

[dev-dependencies]
eth2_ssz = "0.4.1"
Loading

0 comments on commit 89b64a6

Please sign in to comment.