Skip to content

Commit 8eedb3f

Browse files
committed
style(core): hoist mid-module use statements in validatorapi tests
The tests module had a second `use` block in the middle of the file (line ~1259, just before the plumbing-tests section) for std::sync::Mutex, pluto_crypto/testutil/serde_json, and a re-import of SignedRandao / SyncContribution / VersionedAggregatedAttestation / PubKey from `crate`. Rust style places all `use` declarations at the top of each module. Fold the mid-block imports into the existing top-of-module `use` block. Drop the now-redundant `pluto_eth2util::signing::DomainName` test-mod import — the parent module already brings it in via `use super::*`.
1 parent 0195b05 commit 8eedb3f

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

crates/core/src/validatorapi/component.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,12 @@ fn format_bls_pubkey(pubkey: &BLSPubKey) -> String {
810810

811811
#[cfg(test)]
812812
mod tests {
813+
use std::sync::Mutex;
814+
813815
use chrono::{DateTime, Utc};
816+
use pluto_crypto::{blst_impl::BlstImpl, tbls::Tbls};
817+
use pluto_testutil::BeaconMock;
818+
use serde_json::json;
814819
use tokio::sync::mpsc;
815820
use tokio_util::sync::CancellationToken;
816821

@@ -820,9 +825,10 @@ mod tests {
820825
dutydb::{UnsignedDataSet, UnsignedDutyData},
821826
signeddata::{
822827
AttestationData as SignedAttestationData, AttesterDuty as SignedAttesterDuty,
828+
SignedRandao, SyncContribution, VersionedAggregatedAttestation,
823829
},
824830
testutils::random_core_pub_key,
825-
types::{Duty, DutyType, SlotNumber},
831+
types::{Duty, DutyType, PubKey, SlotNumber},
826832
validatorapi::types::AttestationDataOpts,
827833
};
828834

@@ -1256,18 +1262,6 @@ mod tests {
12561262
// Plumbing tests — Subscribe / Register* / verify_partial_sig
12571263
// ====================================================================
12581264

1259-
use std::sync::Mutex;
1260-
1261-
use pluto_crypto::{blst_impl::BlstImpl, tbls::Tbls};
1262-
use pluto_eth2util::signing::DomainName;
1263-
use pluto_testutil::BeaconMock;
1264-
use serde_json::json;
1265-
1266-
use crate::{
1267-
signeddata::{SignedRandao, SyncContribution, VersionedAggregatedAttestation},
1268-
types::PubKey,
1269-
};
1270-
12711265
fn dv_pubkey(byte: u8) -> BLSPubKey {
12721266
[byte; 48]
12731267
}

0 commit comments

Comments
 (0)