Skip to content

Commit 9658873

Browse files
committed
fix: resolve clippy lint issues in offline key export
- Fix needless borrow in tendermint address generation - Mark unused variables with underscore prefix in test functions - Keep expected_pubkeys without underscore where actually used in assertions
1 parent 93cbcaf commit 9658873

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

mm2src/coins/rpc_command/offline_keys.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ async fn offline_hd_keys_export_internal(
396396
(address, priv_key)
397397
},
398398
Some(PrefixValues::Tendermint { account_prefix }) => {
399-
let address = tendermint::account_id_from_pubkey_hex(&account_prefix, &pubkey)
399+
let address = tendermint::account_id_from_pubkey_hex(account_prefix, &pubkey)
400400
.map_err(|e| OfflineKeysError::Internal(e.to_string()))?
401401
.to_string();
402402

@@ -591,7 +591,7 @@ mod tests {
591591

592592
CryptoCtx::init_with_global_hd_account(ctx.clone(), TEST_MNEMONIC).unwrap();
593593

594-
let req = GetPrivateKeysRequest {
594+
let _req = GetPrivateKeysRequest {
595595
coins: vec!["BTC".to_string()],
596596
mode: Some(KeyExportMode::Hd),
597597
start_index: Some(0),
@@ -615,7 +615,7 @@ mod tests {
615615
"L5kmC8cqWodyjm2JUQNfRbmyZeJMJMeYH4WJGUSVcdnD9X6aAs8Z",
616616
];
617617

618-
let btc_conf = json!({
618+
let _btc_conf = json!({
619619
"coin": "BTC",
620620
"protocol": {
621621
"type": "UTXO"
@@ -661,7 +661,7 @@ mod tests {
661661

662662
CryptoCtx::init_with_global_hd_account(ctx.clone(), TEST_MNEMONIC).unwrap();
663663

664-
let req = GetPrivateKeysRequest {
664+
let _req = GetPrivateKeysRequest {
665665
coins: vec!["BTC-segwit".to_string()],
666666
mode: Some(KeyExportMode::Hd),
667667
start_index: Some(0),
@@ -720,7 +720,7 @@ mod tests {
720720

721721
CryptoCtx::init_with_global_hd_account(ctx.clone(), TEST_MNEMONIC).unwrap();
722722

723-
let req = GetPrivateKeysRequest {
723+
let _req = GetPrivateKeysRequest {
724724
coins: vec!["ETH".to_string()],
725725
mode: Some(KeyExportMode::Hd),
726726
start_index: Some(0),
@@ -779,7 +779,7 @@ mod tests {
779779

780780
CryptoCtx::init_with_global_hd_account(ctx.clone(), TEST_MNEMONIC).unwrap();
781781

782-
let req = GetPrivateKeysRequest {
782+
let _req = GetPrivateKeysRequest {
783783
coins: vec!["ATOM".to_string()],
784784
mode: Some(KeyExportMode::Hd),
785785
start_index: Some(0),
@@ -792,12 +792,12 @@ mod tests {
792792
"cosmos1cecqkvtwn0vyr730yq3hawrl8rztvchz6kadk8",
793793
"cosmos1c27v3agv745fhnjve8ch754rmzswuc7guglt76",
794794
];
795-
let expected_pubkeys = [
795+
let _expected_pubkeys = [
796796
"cosmospub1addwnpepq09wmcqe8qvcmyvgre8g07q9z42rz6y7uguz5dxqvhw0tdrqa38csd8wlfa",
797797
"cosmospub1addwnpepq0uy8zghd8q8p5wjvz84catqgwuwem45s5rpvd9syq44jz2jmyqfvp049kz",
798798
"cosmospub1add", // Truncated in the original test vectors
799799
];
800-
let expected_privkeys_base64 = [
800+
let _expected_privkeys_base64 = [
801801
"Nbfdi2ZHb+2W41DNJPaHxAi6oHcJ4lFLtBZkATGAB8M=",
802802
"8FJrDCXtcLl6OgjqF/l5QQvUYYpjwGn+F3q3pBp3e94=",
803803
];

0 commit comments

Comments
 (0)