mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +00:00
Educe migration
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
use crate::{test_utils::TestRandom, *};
|
use crate::{test_utils::TestRandom, *};
|
||||||
use derivative::Derivative;
|
use educe::Educe;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use ssz_derive::{Decode, Encode};
|
use ssz_derive::{Decode, Encode};
|
||||||
use test_random_derive::TestRandom;
|
use test_random_derive::TestRandom;
|
||||||
use tree_hash_derive::TreeHash;
|
use tree_hash_derive::TreeHash;
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Default, Debug, Clone, Serialize, Encode, Decode, Deserialize, TreeHash, Derivative, TestRandom,
|
Default, Debug, Clone, Serialize, Encode, Decode, Deserialize, TreeHash, Educe, TestRandom,
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
|
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
|
||||||
#[derivative(PartialEq, Hash)]
|
#[educe(PartialEq, Hash)]
|
||||||
#[context_deserialize(ForkName)]
|
#[context_deserialize(ForkName)]
|
||||||
// https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md#executionpayloadbid
|
// https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md#executionpayloadbid
|
||||||
pub struct ExecutionPayloadBid {
|
pub struct ExecutionPayloadBid {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use crate::test_utils::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use crate::*;
|
use crate::*;
|
||||||
use beacon_block_body::KzgCommitments;
|
use beacon_block_body::KzgCommitments;
|
||||||
use derivative::Derivative;
|
use educe::Educe;
|
||||||
use serde::de::{Deserializer, Error as _};
|
use serde::de::{Deserializer, Error as _};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use ssz_derive::{Decode, Encode};
|
use ssz_derive::{Decode, Encode};
|
||||||
@@ -22,10 +22,10 @@ use tree_hash_derive::TreeHash;
|
|||||||
Decode,
|
Decode,
|
||||||
TreeHash,
|
TreeHash,
|
||||||
TestRandom,
|
TestRandom,
|
||||||
Derivative
|
Educe
|
||||||
),
|
),
|
||||||
cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary)),
|
cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary)),
|
||||||
derivative(PartialEq, Hash(bound = "E: EthSpec")),
|
educe(PartialEq, Hash(bound(E: EthSpec))),
|
||||||
serde(bound = "E: EthSpec", deny_unknown_fields),
|
serde(bound = "E: EthSpec", deny_unknown_fields),
|
||||||
cfg_attr(feature = "arbitrary", arbitrary(bound = "E: EthSpec"))
|
cfg_attr(feature = "arbitrary", arbitrary(bound = "E: EthSpec"))
|
||||||
),
|
),
|
||||||
@@ -36,8 +36,8 @@ use tree_hash_derive::TreeHash;
|
|||||||
cast_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant"),
|
cast_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant"),
|
||||||
partial_getter_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant")
|
partial_getter_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant")
|
||||||
)]
|
)]
|
||||||
#[derive(Debug, Clone, Serialize, Encode, Deserialize, TreeHash, Derivative)]
|
#[derive(Debug, Clone, Serialize, Encode, Deserialize, TreeHash, Educe)]
|
||||||
#[derivative(PartialEq, Hash(bound = "E: EthSpec"))]
|
#[educe(PartialEq, Hash(bound(E: EthSpec)))]
|
||||||
#[serde(bound = "E: EthSpec", untagged)]
|
#[serde(bound = "E: EthSpec", untagged)]
|
||||||
#[ssz(enum_behaviour = "transparent")]
|
#[ssz(enum_behaviour = "transparent")]
|
||||||
#[tree_hash(enum_behaviour = "transparent")]
|
#[tree_hash(enum_behaviour = "transparent")]
|
||||||
|
|||||||
@@ -1,18 +1,16 @@
|
|||||||
use crate::test_utils::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use crate::*;
|
use crate::*;
|
||||||
use derivative::Derivative;
|
use educe::Educe;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use ssz_derive::{Decode, Encode};
|
use ssz_derive::{Decode, Encode};
|
||||||
use test_random_derive::TestRandom;
|
use test_random_derive::TestRandom;
|
||||||
use tree_hash_derive::TreeHash;
|
use tree_hash_derive::TreeHash;
|
||||||
|
|
||||||
#[derive(
|
#[derive(TestRandom, TreeHash, Debug, Clone, Encode, Decode, Serialize, Deserialize, Educe)]
|
||||||
TestRandom, TreeHash, Debug, Clone, Encode, Decode, Serialize, Deserialize, Derivative,
|
|
||||||
)]
|
|
||||||
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
|
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
|
||||||
#[serde(bound = "E: EthSpec", deny_unknown_fields)]
|
#[serde(bound = "E: EthSpec", deny_unknown_fields)]
|
||||||
#[cfg_attr(feature = "arbitrary", arbitrary(bound = "E: EthSpec"))]
|
#[cfg_attr(feature = "arbitrary", arbitrary(bound = "E: EthSpec"))]
|
||||||
#[derivative(PartialEq, Hash)]
|
#[educe(PartialEq, Hash)]
|
||||||
#[context_deserialize(ForkName)]
|
#[context_deserialize(ForkName)]
|
||||||
pub struct PayloadAttestation<E: EthSpec> {
|
pub struct PayloadAttestation<E: EthSpec> {
|
||||||
pub aggregation_bits: BitList<E::PTCSize>,
|
pub aggregation_bits: BitList<E::PTCSize>,
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
use crate::test_utils::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use crate::*;
|
use crate::*;
|
||||||
use derivative::Derivative;
|
use educe::Educe;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use ssz_derive::{Decode, Encode};
|
use ssz_derive::{Decode, Encode};
|
||||||
use test_random_derive::TestRandom;
|
use test_random_derive::TestRandom;
|
||||||
use tree_hash_derive::TreeHash;
|
use tree_hash_derive::TreeHash;
|
||||||
|
|
||||||
#[derive(
|
#[derive(TestRandom, TreeHash, Debug, Clone, Encode, Decode, Serialize, Deserialize, Educe)]
|
||||||
TestRandom, TreeHash, Debug, Clone, Encode, Decode, Serialize, Deserialize, Derivative,
|
|
||||||
)]
|
|
||||||
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
|
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
|
||||||
#[derivative(PartialEq, Hash)]
|
#[educe(PartialEq, Hash)]
|
||||||
#[context_deserialize(ForkName)]
|
#[context_deserialize(ForkName)]
|
||||||
// https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md#signedexecutionpayloadbid
|
// https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md#signedexecutionpayloadbid
|
||||||
pub struct SignedExecutionPayloadBid {
|
pub struct SignedExecutionPayloadBid {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use crate::test_utils::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use crate::*;
|
use crate::*;
|
||||||
use derivative::Derivative;
|
use educe::Educe;
|
||||||
use serde::de::{Deserializer, Error as _};
|
use serde::de::{Deserializer, Error as _};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use ssz_derive::{Decode, Encode};
|
use ssz_derive::{Decode, Encode};
|
||||||
@@ -20,10 +20,10 @@ use tree_hash_derive::TreeHash;
|
|||||||
Decode,
|
Decode,
|
||||||
TreeHash,
|
TreeHash,
|
||||||
TestRandom,
|
TestRandom,
|
||||||
Derivative
|
Educe
|
||||||
),
|
),
|
||||||
cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary)),
|
cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary)),
|
||||||
derivative(PartialEq, Hash(bound = "E: EthSpec")),
|
educe(PartialEq, Hash(bound(E: EthSpec))),
|
||||||
serde(bound = "E: EthSpec", deny_unknown_fields),
|
serde(bound = "E: EthSpec", deny_unknown_fields),
|
||||||
cfg_attr(feature = "arbitrary", arbitrary(bound = "E: EthSpec"))
|
cfg_attr(feature = "arbitrary", arbitrary(bound = "E: EthSpec"))
|
||||||
),
|
),
|
||||||
@@ -34,8 +34,8 @@ use tree_hash_derive::TreeHash;
|
|||||||
cast_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant"),
|
cast_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant"),
|
||||||
partial_getter_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant")
|
partial_getter_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant")
|
||||||
)]
|
)]
|
||||||
#[derive(Debug, Clone, Serialize, Encode, Deserialize, TreeHash, Derivative)]
|
#[derive(Debug, Clone, Serialize, Encode, Deserialize, TreeHash, Educe)]
|
||||||
#[derivative(PartialEq, Hash(bound = "E: EthSpec"))]
|
#[educe(PartialEq, Hash(bound(E: EthSpec)))]
|
||||||
#[serde(bound = "E: EthSpec", untagged)]
|
#[serde(bound = "E: EthSpec", untagged)]
|
||||||
#[ssz(enum_behaviour = "transparent")]
|
#[ssz(enum_behaviour = "transparent")]
|
||||||
#[tree_hash(enum_behaviour = "transparent")]
|
#[tree_hash(enum_behaviour = "transparent")]
|
||||||
|
|||||||
Reference in New Issue
Block a user