Skip to content

Commit b2a5337

Browse files
committed
Educe migration
1 parent 0feede4 commit b2a5337

File tree

5 files changed

+19
-23
lines changed

5 files changed

+19
-23
lines changed

consensus/types/src/execution_payload_bid.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
use crate::{test_utils::TestRandom, *};
2-
use derivative::Derivative;
2+
use educe::Educe;
33
use serde::{Deserialize, Serialize};
44
use ssz_derive::{Decode, Encode};
55
use test_random_derive::TestRandom;
66
use tree_hash_derive::TreeHash;
77

88
#[derive(
9-
Default, Debug, Clone, Serialize, Encode, Decode, Deserialize, TreeHash, Derivative, TestRandom,
9+
Default, Debug, Clone, Serialize, Encode, Decode, Deserialize, TreeHash, Educe, TestRandom,
1010
)]
1111
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
12-
#[derivative(PartialEq, Hash)]
12+
#[educe(PartialEq, Hash)]
1313
#[context_deserialize(ForkName)]
1414
// https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md#executionpayloadbid
1515
pub struct ExecutionPayloadBid {

consensus/types/src/execution_payload_envelope.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::test_utils::TestRandom;
22
use crate::*;
33
use beacon_block_body::KzgCommitments;
4-
use derivative::Derivative;
4+
use educe::Educe;
55
use serde::de::{Deserializer, Error as _};
66
use serde::{Deserialize, Serialize};
77
use ssz_derive::{Decode, Encode};
@@ -22,10 +22,10 @@ use tree_hash_derive::TreeHash;
2222
Decode,
2323
TreeHash,
2424
TestRandom,
25-
Derivative
25+
Educe
2626
),
2727
cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary)),
28-
derivative(PartialEq, Hash(bound = "E: EthSpec")),
28+
educe(PartialEq, Hash(bound(E: EthSpec))),
2929
serde(bound = "E: EthSpec", deny_unknown_fields),
3030
cfg_attr(feature = "arbitrary", arbitrary(bound = "E: EthSpec"))
3131
),
@@ -36,8 +36,8 @@ use tree_hash_derive::TreeHash;
3636
cast_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant"),
3737
partial_getter_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant")
3838
)]
39-
#[derive(Debug, Clone, Serialize, Encode, Deserialize, TreeHash, Derivative)]
40-
#[derivative(PartialEq, Hash(bound = "E: EthSpec"))]
39+
#[derive(Debug, Clone, Serialize, Encode, Deserialize, TreeHash, Educe)]
40+
#[educe(PartialEq, Hash(bound(E: EthSpec)))]
4141
#[serde(bound = "E: EthSpec", untagged)]
4242
#[ssz(enum_behaviour = "transparent")]
4343
#[tree_hash(enum_behaviour = "transparent")]

consensus/types/src/payload_attestation.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
use crate::test_utils::TestRandom;
22
use crate::*;
3-
use derivative::Derivative;
3+
use educe::Educe;
44
use serde::{Deserialize, Serialize};
55
use ssz_derive::{Decode, Encode};
66
use test_random_derive::TestRandom;
77
use tree_hash_derive::TreeHash;
88

9-
#[derive(
10-
TestRandom, TreeHash, Debug, Clone, Encode, Decode, Serialize, Deserialize, Derivative,
11-
)]
9+
#[derive(TestRandom, TreeHash, Debug, Clone, Encode, Decode, Serialize, Deserialize, Educe)]
1210
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1311
#[serde(bound = "E: EthSpec", deny_unknown_fields)]
1412
#[cfg_attr(feature = "arbitrary", arbitrary(bound = "E: EthSpec"))]
15-
#[derivative(PartialEq, Hash)]
13+
#[educe(PartialEq, Hash)]
1614
#[context_deserialize(ForkName)]
1715
pub struct PayloadAttestation<E: EthSpec> {
1816
pub aggregation_bits: BitList<E::PTCSize>,

consensus/types/src/signed_execution_payload_bid.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
use crate::test_utils::TestRandom;
22
use crate::*;
3-
use derivative::Derivative;
3+
use educe::Educe;
44
use serde::{Deserialize, Serialize};
55
use ssz_derive::{Decode, Encode};
66
use test_random_derive::TestRandom;
77
use tree_hash_derive::TreeHash;
88

9-
#[derive(
10-
TestRandom, TreeHash, Debug, Clone, Encode, Decode, Serialize, Deserialize, Derivative,
11-
)]
9+
#[derive(TestRandom, TreeHash, Debug, Clone, Encode, Decode, Serialize, Deserialize, Educe)]
1210
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
13-
#[derivative(PartialEq, Hash)]
11+
#[educe(PartialEq, Hash)]
1412
#[context_deserialize(ForkName)]
1513
// https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md#signedexecutionpayloadbid
1614
pub struct SignedExecutionPayloadBid {

consensus/types/src/signed_execution_payload_envelope.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::test_utils::TestRandom;
22
use crate::*;
3-
use derivative::Derivative;
3+
use educe::Educe;
44
use serde::de::{Deserializer, Error as _};
55
use serde::{Deserialize, Serialize};
66
use ssz_derive::{Decode, Encode};
@@ -20,10 +20,10 @@ use tree_hash_derive::TreeHash;
2020
Decode,
2121
TreeHash,
2222
TestRandom,
23-
Derivative
23+
Educe
2424
),
2525
cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary)),
26-
derivative(PartialEq, Hash(bound = "E: EthSpec")),
26+
educe(PartialEq, Hash(bound(E: EthSpec))),
2727
serde(bound = "E: EthSpec", deny_unknown_fields),
2828
cfg_attr(feature = "arbitrary", arbitrary(bound = "E: EthSpec"))
2929
),
@@ -34,8 +34,8 @@ use tree_hash_derive::TreeHash;
3434
cast_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant"),
3535
partial_getter_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant")
3636
)]
37-
#[derive(Debug, Clone, Serialize, Encode, Deserialize, TreeHash, Derivative)]
38-
#[derivative(PartialEq, Hash(bound = "E: EthSpec"))]
37+
#[derive(Debug, Clone, Serialize, Encode, Deserialize, TreeHash, Educe)]
38+
#[educe(PartialEq, Hash(bound(E: EthSpec)))]
3939
#[serde(bound = "E: EthSpec", untagged)]
4040
#[ssz(enum_behaviour = "transparent")]
4141
#[tree_hash(enum_behaviour = "transparent")]

0 commit comments

Comments
 (0)