mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 03:31:45 +00:00
Enable lints for tests only running optimized (#6664)
* enable linting optimized-only tests * fix automatically fixable or obvious lints * fix suspicious_open_options by removing manual options * fix `await_holding_lock`s * avoid failing lint due to now disabled `#[cfg(debug_assertions)]` * reduce future sizes in tests * fix accidently flipped assert logic * restore holding lock for web3signer download * Merge branch 'unstable' into lint-opt-tests
This commit is contained in:
@@ -53,8 +53,10 @@ struct ApiTester {
|
||||
|
||||
impl ApiTester {
|
||||
pub async fn new() -> Self {
|
||||
let mut config = ValidatorStoreConfig::default();
|
||||
config.fee_recipient = Some(TEST_DEFAULT_FEE_RECIPIENT);
|
||||
let config = ValidatorStoreConfig {
|
||||
fee_recipient: Some(TEST_DEFAULT_FEE_RECIPIENT),
|
||||
..Default::default()
|
||||
};
|
||||
Self::new_with_config(config).await
|
||||
}
|
||||
|
||||
@@ -139,7 +141,7 @@ impl ApiTester {
|
||||
let (listening_socket, server) =
|
||||
super::serve(ctx, test_runtime.task_executor.exit()).unwrap();
|
||||
|
||||
tokio::spawn(async { server.await });
|
||||
tokio::spawn(server);
|
||||
|
||||
let url = SensitiveUrl::parse(&format!(
|
||||
"http://{}:{}",
|
||||
@@ -345,22 +347,21 @@ impl ApiTester {
|
||||
.set_nextaccount(s.key_derivation_path_offset)
|
||||
.unwrap();
|
||||
|
||||
for i in 0..s.count {
|
||||
for validator in response.iter().take(s.count) {
|
||||
let keypairs = wallet
|
||||
.next_validator(PASSWORD_BYTES, PASSWORD_BYTES, PASSWORD_BYTES)
|
||||
.unwrap();
|
||||
let voting_keypair = keypairs.voting.decrypt_keypair(PASSWORD_BYTES).unwrap();
|
||||
|
||||
assert_eq!(
|
||||
response[i].voting_pubkey,
|
||||
validator.voting_pubkey,
|
||||
voting_keypair.pk.clone().into(),
|
||||
"the locally generated voting pk should match the server response"
|
||||
);
|
||||
|
||||
let withdrawal_keypair = keypairs.withdrawal.decrypt_keypair(PASSWORD_BYTES).unwrap();
|
||||
|
||||
let deposit_bytes =
|
||||
serde_utils::hex::decode(&response[i].eth1_deposit_tx_data).unwrap();
|
||||
let deposit_bytes = serde_utils::hex::decode(&validator.eth1_deposit_tx_data).unwrap();
|
||||
|
||||
let (deposit_data, _) =
|
||||
decode_eth1_tx_data(&deposit_bytes, E::default_spec().max_effective_balance)
|
||||
|
||||
Reference in New Issue
Block a user