Skip to content

Commit 5c8a7ab

Browse files
committed
Merge remote-tracking branch 'origin/main' into iamquang95/implement-eth2util-signing
2 parents ffcbefb + 112d9a2 commit 5c8a7ab

File tree

36 files changed

+249
-248
lines changed

36 files changed

+249
-248
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ cast_precision_loss = "deny"
129129
cast_sign_loss = "deny"
130130
needless_return = "deny"
131131
panicking_overflow_checks = "deny"
132+
redundant_test_prefix = "deny"
132133
unwrap_used = "deny"
133134

134135
# Optimize crypto dependencies in test builds for faster tests

crates/app/src/featureset.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ mod tests {
295295
use super::*;
296296

297297
#[test]
298-
fn test_all_feature_status() {
298+
fn all_feature_status() {
299299
let featureset = FeatureSet::new();
300300

301301
let features = Feature::all();
@@ -312,7 +312,7 @@ mod tests {
312312
}
313313

314314
#[test]
315-
fn test_status_display() {
315+
fn status_display() {
316316
assert_eq!(Status::Disable.to_string(), "disable");
317317
assert_eq!(Status::Alpha.to_string(), "alpha");
318318
assert_eq!(Status::Beta.to_string(), "beta");
@@ -322,7 +322,7 @@ mod tests {
322322
}
323323

324324
#[test]
325-
fn test_custom_enabled_all() {
325+
fn custom_enabled_all() {
326326
let featureset = FeatureSet::new();
327327

328328
// Initially no custom enabled features
@@ -343,7 +343,7 @@ mod tests {
343343
}
344344

345345
#[test]
346-
fn test_config() {
346+
fn config() {
347347
let featureset = FeatureSet::new();
348348
assert_eq!(featureset.min_status, Status::Stable);
349349

@@ -359,7 +359,7 @@ mod tests {
359359
}
360360

361361
#[test]
362-
fn test_enable_feature() {
362+
fn enable_feature() {
363363
let featureset = FeatureSet::new();
364364

365365
// Initially disabled (MockAlpha is Alpha status, min_status is Stable)
@@ -377,7 +377,7 @@ mod tests {
377377
}
378378

379379
#[test]
380-
fn test_disable_feature() {
380+
fn disable_feature() {
381381
// First create with a stable feature (EagerDoubleLinear is Stable by default)
382382
let featureset = FeatureSet::from_config(Config {
383383
min_status: Status::Stable,
@@ -404,7 +404,7 @@ mod tests {
404404
// Verifies FeatureSet::new() matches Go's
405405
// featureset.Init(featureset.DefaultConfig()) Reference:
406406
// app/featureset/featureset.go and app/featureset/config.go
407-
fn test_default_matches_go_implementation() {
407+
fn default_matches_go_implementation() {
408408
// Verify Config::default() matches Go's DefaultConfig()
409409
let config = Config::default();
410410
assert_eq!(config.min_status, Status::Stable);
@@ -446,7 +446,7 @@ mod tests {
446446
}
447447

448448
#[test]
449-
fn test_enable_gnosis_block_hotfix_if_not_disabled() {
449+
fn enable_gnosis_block_hotfix_if_not_disabled() {
450450
// Test method when not disabled explicitly
451451
let config = Config::default();
452452
let mut featureset =

crates/app/src/obolapi/client.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ mod tests {
218218
}
219219

220220
#[test]
221-
fn test_new_client_valid_url() {
221+
fn new_client_valid_url() {
222222
assert!(
223223
Client::new(
224224
"https://api.obol.tech",
@@ -231,12 +231,12 @@ mod tests {
231231
}
232232

233233
#[test]
234-
fn test_new_client_invalid_url() {
234+
fn new_client_invalid_url() {
235235
assert!(Client::new("not-a-url", ClientOptions::default()).is_err());
236236
}
237237

238238
#[test]
239-
fn test_base_url_normalization() {
239+
fn base_url_normalization() {
240240
let c1 = Client::new("https://api.obol.tech", ClientOptions::default()).unwrap();
241241
assert_eq!(c1.base_url.as_str(), "https://api.obol.tech/");
242242

@@ -251,7 +251,7 @@ mod tests {
251251
}
252252

253253
#[test]
254-
fn test_build_url_root_base() {
254+
fn build_url_root_base() {
255255
let client = Client::new("https://api.obol.tech", ClientOptions::default()).unwrap();
256256
assert_eq!(
257257
client.build_url("definition").unwrap().as_str(),
@@ -271,7 +271,7 @@ mod tests {
271271
}
272272

273273
#[test]
274-
fn test_build_url_versioned_base() {
274+
fn build_url_versioned_base() {
275275
let client = Client::new("https://api.obol.tech/v1", ClientOptions::default()).unwrap();
276276
assert_eq!(
277277
client.build_url("definition").unwrap().as_str(),
@@ -291,13 +291,13 @@ mod tests {
291291
}
292292

293293
#[test]
294-
fn test_launchpad_url_path() {
294+
fn launchpad_url_path_works() {
295295
let lock = test_lock_with_hash(vec![0x12, 0x34, 0xab, 0xcd]);
296296
assert_eq!(launchpad_url_path(&lock), "/lock/0x1234ABCD/launchpad");
297297
}
298298

299299
#[test]
300-
fn test_launchpad_url_for_lock() {
300+
fn launchpad_url_for_lock() {
301301
let lock = test_lock_with_hash(vec![0x12, 0x34, 0xab, 0xcd]);
302302

303303
let c1 = Client::new("https://api.obol.tech", ClientOptions::default()).unwrap();

crates/app/src/obolapi/exit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,27 +430,27 @@ mod tests {
430430
use super::*;
431431

432432
#[test]
433-
fn test_submit_partial_exit_url() {
433+
fn submit_partial_exit_url_works() {
434434
let url = submit_partial_exit_url("0xabcd1234");
435435
assert_eq!(url, "/exp/partial_exits/0xabcd1234");
436436
}
437437

438438
#[test]
439-
fn test_delete_partial_exit_url() {
439+
fn delete_partial_exit_url_works() {
440440
let url = delete_partial_exit_url("0xpubkey", "0xlockhash", 5);
441441
assert_eq!(url, "/exp/partial_exits/0xlockhash/5/0xpubkey");
442442
}
443443

444444
#[test]
445-
fn test_fetch_full_exit_url() {
445+
fn fetch_full_exit_url_works() {
446446
let url = fetch_full_exit_url("0xpubkey", "0xlockhash", 5);
447447
assert_eq!(url, "/exp/exit/0xlockhash/5/0xpubkey");
448448
}
449449

450450
/// These test vectors were generated from Go `charon/app/obolapi` using
451451
/// fastssz
452452
#[test]
453-
fn test_ssz_root_parity_exit_models() -> std::result::Result<(), Box<dyn std::error::Error>> {
453+
fn ssz_root_parity_exit_models() -> std::result::Result<(), Box<dyn std::error::Error>> {
454454
fn decode_hex(s: &str) -> std::result::Result<Vec<u8>, hex::FromHexError> {
455455
hex::decode(s)
456456
}

crates/app/src/obolapi/helper.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,31 @@ mod tests {
1919
use super::*;
2020

2121
#[test]
22-
fn test_from_0x_with_prefix() {
22+
fn from_0x_with_prefix() {
2323
let bytes = from_0x("0x1234", 2).unwrap();
2424
assert_eq!(bytes, vec![0x12, 0x34]);
2525
}
2626

2727
#[test]
28-
fn test_from_0x_without_prefix() {
28+
fn from_0x_without_prefix() {
2929
let bytes = from_0x("1234", 2).unwrap();
3030
assert_eq!(bytes, vec![0x12, 0x34]);
3131
}
3232

3333
#[test]
34-
fn test_from_0x_empty_string() {
34+
fn from_0x_empty_string() {
3535
let result = from_0x("", 2);
3636
assert!(matches!(result, Err(Error::EmptyHex)));
3737
}
3838

3939
#[test]
40-
fn test_from_0x_wrong_length() {
40+
fn from_0x_wrong_length() {
4141
let result = from_0x("0x1234", 3);
4242
assert!(result.is_err());
4343
}
4444

4545
#[test]
46-
fn test_bearer_string() {
46+
fn bearer_string_works() {
4747
let bearer = bearer_string(&[0x12, 0x34, 0xab, 0xcd]);
4848
assert_eq!(bearer, "Bearer 0x1234abcd");
4949
}

crates/app/src/privkeylock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ mod tests {
159159
use std::path::PathBuf;
160160

161161
#[tokio::test]
162-
async fn test_service() {
162+
async fn service() {
163163
let dir = tempfile::tempdir().expect("failed to create temp dir");
164164
let path: PathBuf = dir.path().join("privkeylocktest");
165165

crates/cli/src/commands/create_dkg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ mod tests {
576576
}
577577

578578
#[tokio::test]
579-
async fn test_create_dkg_valid() {
579+
async fn create_dkg_valid() {
580580
let dir = temp_dir();
581581
let args = CreateDkgArgs {
582582
output_dir: dir.path().to_path_buf(),
@@ -707,7 +707,7 @@ mod tests {
707707
}
708708

709709
#[tokio::test]
710-
async fn test_dkg_cli_no_threshold() {
710+
async fn dkg_cli_no_threshold() {
711711
let dir = temp_dir();
712712
let enr = "enr:-JG4QG472ZVvl8ySSnUK9uNVDrP_hjkUrUqIxUC75aayzmDVQedXkjbqc7QKyOOS71VmlqnYzri_taV8ZesFYaoQSIOGAYHtv1WsgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQKwwq_CAld6oVKOrixE-JzMtvvNgb9yyI-_rwq4NFtajIN0Y3CCDhqDdWRwgg4u";
713713
let enrs: Vec<String> = (0..MIN_NODES).map(|_| enr.to_string()).collect();
@@ -728,7 +728,7 @@ mod tests {
728728
}
729729

730730
#[tokio::test]
731-
async fn test_existing_cluster_definition() {
731+
async fn existing_cluster_definition() {
732732
let dir = temp_dir();
733733
tokio::fs::write(
734734
dir.path().join("cluster-definition.json"),

crates/cli/src/commands/test/beacon.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,7 +2232,7 @@ mod tests {
22322232
}
22332233

22342234
#[tokio::test]
2235-
async fn test_beacon_default_scenario() {
2235+
async fn beacon_default_scenario() {
22362236
let server = start_healthy_mocked_beacon_node().await;
22372237
let url = server.uri();
22382238
let args = default_beacon_args(vec![url.clone()]);
@@ -2245,7 +2245,7 @@ mod tests {
22452245
}
22462246

22472247
#[tokio::test]
2248-
async fn test_beacon_connection_refused() {
2248+
async fn beacon_connection_refused() {
22492249
let port1 = 19876;
22502250
let port2 = 19877;
22512251
let endpoint1 = format!("http://localhost:{port1}");
@@ -2277,7 +2277,7 @@ mod tests {
22772277
}
22782278

22792279
#[tokio::test]
2280-
async fn test_beacon_timeout() {
2280+
async fn beacon_timeout() {
22812281
let endpoint1 = "http://localhost:19878".to_string();
22822282
let endpoint2 = "http://localhost:19879".to_string();
22832283
let mut args = default_beacon_args(vec![endpoint1.clone(), endpoint2.clone()]);
@@ -2295,7 +2295,7 @@ mod tests {
22952295
}
22962296

22972297
#[tokio::test]
2298-
async fn test_beacon_quiet() {
2298+
async fn beacon_quiet() {
22992299
let dir = tempfile::tempdir().unwrap();
23002300
let json_path = dir.path().join("output.json");
23012301

@@ -2313,7 +2313,7 @@ mod tests {
23132313
}
23142314

23152315
#[tokio::test]
2316-
async fn test_beacon_unsupported_test() {
2316+
async fn beacon_unsupported_test() {
23172317
let args = TestBeaconArgs {
23182318
test_config: TestConfigArgs {
23192319
test_cases: Some(vec!["notSupportedTest".to_string()]),
@@ -2333,7 +2333,7 @@ mod tests {
23332333
}
23342334

23352335
#[tokio::test]
2336-
async fn test_beacon_custom_test_cases() {
2336+
async fn beacon_custom_test_cases() {
23372337
let endpoint1 = "http://localhost:19883".to_string();
23382338
let endpoint2 = "http://localhost:19884".to_string();
23392339
let mut args = default_beacon_args(vec![endpoint1.clone(), endpoint2.clone()]);
@@ -2351,7 +2351,7 @@ mod tests {
23512351
}
23522352

23532353
#[tokio::test]
2354-
async fn test_beacon_write_to_file() {
2354+
async fn beacon_write_to_file() {
23552355
let dir = tempfile::tempdir().unwrap();
23562356
let file_path = dir.path().join("beacon-test-output.json");
23572357

@@ -2377,7 +2377,7 @@ mod tests {
23772377
}
23782378

23792379
#[tokio::test]
2380-
async fn test_beacon_basic_auth_with_credentials() {
2380+
async fn beacon_basic_auth_with_credentials() {
23812381
let server = MockServer::start().await;
23822382

23832383
Mock::given(method("GET"))
@@ -2398,7 +2398,7 @@ mod tests {
23982398
}
23992399

24002400
#[tokio::test]
2401-
async fn test_beacon_basic_auth_without_credentials() {
2401+
async fn beacon_basic_auth_without_credentials() {
24022402
let server = MockServer::start().await;
24032403

24042404
Mock::given(method("GET"))

crates/cli/src/commands/test/helpers.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ mod tests {
788788
}
789789

790790
#[tokio::test]
791-
async fn test_write_result_to_file_creates_new_file() {
791+
async fn write_result_to_file_creates_new_file() {
792792
let dir = tempfile::tempdir().unwrap();
793793
let path = dir.path().join("output.json");
794794

@@ -812,7 +812,7 @@ mod tests {
812812
}
813813

814814
#[tokio::test]
815-
async fn test_write_result_to_file_merges_categories() {
815+
async fn write_result_to_file_merges_categories() {
816816
let dir = tempfile::tempdir().unwrap();
817817
let path = dir.path().join("output.json");
818818

@@ -843,7 +843,7 @@ mod tests {
843843
}
844844

845845
#[tokio::test]
846-
async fn test_write_result_to_file_overwrites_same_category() {
846+
async fn write_result_to_file_overwrites_same_category() {
847847
let dir = tempfile::tempdir().unwrap();
848848
let path = dir.path().join("output.json");
849849

@@ -903,7 +903,7 @@ mod tests {
903903

904904
#[cfg(unix)]
905905
#[tokio::test]
906-
async fn test_write_result_to_file_sets_permissions() {
906+
async fn write_result_to_file_sets_permissions() {
907907
use std::os::unix::fs::PermissionsExt as _;
908908

909909
let dir = tempfile::tempdir().unwrap();
@@ -917,7 +917,7 @@ mod tests {
917917
}
918918

919919
#[tokio::test]
920-
async fn test_write_result_to_file_all_categories() {
920+
async fn write_result_to_file_all_categories() {
921921
let dir = tempfile::tempdir().unwrap();
922922
let path = dir.path().join("output.json");
923923

crates/cli/src/commands/test/mev.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ mod tests {
702702
use super::*;
703703

704704
#[test]
705-
fn test_format_mev_relay_name() {
705+
fn format_mev_relay_name_works() {
706706
assert_eq!(
707707
format_mev_relay_name(
708708
"https://0xac6e77dfe25ecd6110b8e780608cce0dab71fdd5ebea22a16c0205200f2f8e2e3ad3b71d3499c54ad14d6c21b41a37ae@boost-relay.flashbots.net"
@@ -732,7 +732,7 @@ mod tests {
732732
}
733733

734734
#[test]
735-
fn test_get_validator_pk_for_slot() {
735+
fn get_validator_pk_for_slot_works() {
736736
let duties = vec![
737737
ProposerDutiesData {
738738
pubkey: "0xabc".to_string(),

0 commit comments

Comments
 (0)