Skip to content

Commit 44c6b1d

Browse files
committed
fix: remove uneeded vars, clone
1 parent 12a282a commit 44c6b1d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

adapter/src/ethereum.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ impl Adapter for EthereumAdapter {
226226
fn get_auth(&self, validator: &ValidatorId) -> AdapterResult<String> {
227227
let wallet = self
228228
.wallet
229-
.clone()
229+
.as_ref()
230230
.ok_or_else(|| AdapterError::Configuration("failed to unlock wallet".to_string()))?;
231231

232232
let era = Utc::now().timestamp_millis() as f64 / 60000.0;
@@ -236,10 +236,9 @@ impl Adapter for EthereumAdapter {
236236
identity: None,
237237
address: self.whoami().to_hex_checksummed_string(),
238238
};
239-
let token = ewt_sign(&wallet, &self.keystore_pwd, &payload)
240-
.map_err(|_| map_error("Failed to sign token"))?;
241239

242-
Ok(token)
240+
ewt_sign(&wallet, &self.keystore_pwd, &payload)
241+
.map_err(|_| map_error("Failed to sign token"))
243242
}
244243
}
245244

0 commit comments

Comments
 (0)