mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-19 12:56:12 +00:00
Remove consensus/types re-exports (#8540)
There are certain crates which we re-export within `types` which creates a fragmented DevEx, where there are various ways to import the same crates.
```rust
// consensus/types/src/lib.rs
pub use bls::{
AggregatePublicKey, AggregateSignature, Error as BlsError, Keypair, PUBLIC_KEY_BYTES_LEN,
PublicKey, PublicKeyBytes, SIGNATURE_BYTES_LEN, SecretKey, Signature, SignatureBytes,
get_withdrawal_credentials,
};
pub use context_deserialize::{ContextDeserialize, context_deserialize};
pub use fixed_bytes::FixedBytesExtended;
pub use milhouse::{self, List, Vector};
pub use ssz_types::{BitList, BitVector, FixedVector, VariableList, typenum, typenum::Unsigned};
pub use superstruct::superstruct;
```
This PR removes these re-exports and makes it explicit that these types are imported from a non-`consensus/types` crate.
Co-Authored-By: Mac L <mjladson@pm.me>
This commit is contained in:
@@ -10,6 +10,7 @@ lighthouse = ["proto_array", "eth2_keystore", "eip_3076", "zeroize"]
|
||||
events = ["reqwest-eventsource", "futures", "futures-util"]
|
||||
|
||||
[dependencies]
|
||||
bls = { workspace = true }
|
||||
context_deserialize = { workspace = true }
|
||||
educe = { workspace = true }
|
||||
eip_3076 = { workspace = true, optional = true }
|
||||
@@ -28,6 +29,7 @@ sensitive_url = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
ssz_types = { workspace = true }
|
||||
superstruct = { workspace = true }
|
||||
types = { workspace = true }
|
||||
zeroize = { workspace = true, optional = true }
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ pub use sensitive_url::SensitiveUrl;
|
||||
|
||||
use self::mixin::{RequestAccept, ResponseOptional};
|
||||
use self::types::*;
|
||||
use bls::SignatureBytes;
|
||||
use context_deserialize::ContextDeserialize;
|
||||
use educe::Educe;
|
||||
#[cfg(feature = "events")]
|
||||
use futures::Stream;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use super::types::*;
|
||||
use crate::{Error, success_or_error};
|
||||
use bls::PublicKeyBytes;
|
||||
use reqwest::{
|
||||
IntoUrl,
|
||||
header::{HeaderMap, HeaderValue},
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use bls::PublicKeyBytes;
|
||||
use eth2_keystore::Keystore;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use types::{Address, Graffiti, PublicKeyBytes};
|
||||
use types::{Address, Graffiti};
|
||||
use zeroize::Zeroizing;
|
||||
|
||||
pub use eip_3076::Interchange;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
pub use crate::lighthouse::Health;
|
||||
pub use crate::lighthouse_vc::std_types::*;
|
||||
pub use crate::types::{GenericResponse, VersionData};
|
||||
use bls::{PublicKey, PublicKeyBytes};
|
||||
use eth2_keystore::Keystore;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::path::PathBuf;
|
||||
|
||||
@@ -7,6 +7,8 @@ use crate::{
|
||||
CONSENSUS_BLOCK_VALUE_HEADER, CONSENSUS_VERSION_HEADER, EXECUTION_PAYLOAD_BLINDED_HEADER,
|
||||
EXECUTION_PAYLOAD_VALUE_HEADER, Error as ServerError,
|
||||
};
|
||||
use bls::{PublicKeyBytes, SecretKey, Signature, SignatureBytes};
|
||||
use context_deserialize::ContextDeserialize;
|
||||
use mediatype::{MediaType, MediaTypeList, names};
|
||||
use reqwest::header::HeaderMap;
|
||||
use serde::{Deserialize, Deserializer, Serialize};
|
||||
@@ -18,6 +20,7 @@ use std::fmt::{self, Display};
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use superstruct::superstruct;
|
||||
|
||||
#[cfg(test)]
|
||||
use test_random_derive::TestRandom;
|
||||
|
||||
Reference in New Issue
Block a user