mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Migrate derivative to educe (#8125)
Fixes #7001. Mostly mechanical replacement of `derivative` attributes with `educe` ones. ### **Attribute Syntax Changes** ```rust // Bounds: = "..." → (...) #[derivative(Hash(bound = "E: EthSpec"))] #[educe(Hash(bound(E: EthSpec)))] // Ignore: = "ignore" → (ignore) #[derivative(PartialEq = "ignore")] #[educe(PartialEq(ignore))] // Default values: value = "..." → expression = ... #[derivative(Default(value = "ForkName::Base"))] #[educe(Default(expression = ForkName::Base))] // Methods: format_with/compare_with = "..." → method(...) #[derivative(Debug(format_with = "fmt_peer_set_as_len"))] #[educe(Debug(method(fmt_peer_set_as_len)))] // Empty bounds: removed entirely, educe can infer appropriate bounds #[derivative(Default(bound = ""))] #[educe(Default)] // Transparent debug: manual implementation (educe doesn't support it) #[derivative(Debug = "transparent")] // Replaced with manual Debug impl that delegates to inner field ``` **Note**: Some bounds use strings (`bound("E: EthSpec")`) for superstruct compatibility (`expected ','` errors). Co-Authored-By: Javier Chávarri <javier.chavarri@gmail.com> Co-Authored-By: Mac L <mjladson@pm.me>
This commit is contained in:
@@ -3,7 +3,7 @@ use crate::builder::{
|
||||
WITHDRAWAL_KEYSTORE_FILE, keystore_password_path,
|
||||
};
|
||||
use deposit_contract::decode_eth1_tx_data;
|
||||
use derivative::Derivative;
|
||||
use educe::Educe;
|
||||
use eth2_keystore::{Error as KeystoreError, Keystore, PlainText};
|
||||
use lockfile::{Lockfile, LockfileError};
|
||||
use std::fs::{File, read, write};
|
||||
@@ -56,11 +56,11 @@ pub struct Eth1DepositData {
|
||||
///
|
||||
/// Holds a lockfile in `self.dir` to attempt to prevent concurrent access from multiple
|
||||
/// processes.
|
||||
#[derive(Debug, Derivative)]
|
||||
#[derivative(PartialEq)]
|
||||
#[derive(Debug, Educe)]
|
||||
#[educe(PartialEq)]
|
||||
pub struct ValidatorDir {
|
||||
dir: PathBuf,
|
||||
#[derivative(PartialEq = "ignore")]
|
||||
#[educe(PartialEq(ignore))]
|
||||
_lockfile: Lockfile,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user