Skip to content

Commit

Permalink
cargo fmt + clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
trusch committed Jan 8, 2025
1 parent dbe6254 commit 9501e71
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,9 @@ pub struct MsgRescheduleTask {

impl MsgRescheduleTaskBuilder {
pub fn into_message(&self) -> Result<gevulot::MsgRescheduleTask> {
let msg = self.build().map_err(|e| Error::EncodeError(e.to_string()))?;
let msg = self
.build()
.map_err(|e| Error::EncodeError(e.to_string()))?;
Ok(gevulot::MsgRescheduleTask {
creator: msg.creator,
id: msg.task_id,
Expand Down
2 changes: 1 addition & 1 deletion src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ mod tests {
assert_eq!(event.block_height, Height::from(1000u32));
assert_eq!(event.cid, "QmYwMXeEc3Z64vqcPXx8p8Y8Y5tE9Y5sYW42FZ1U87Y");
assert_eq!(event.worker_id, "worker1");
assert_eq!(event.success, true);
assert!(event.success);
assert_eq!(event.id, "123");
} else {
panic!("Unexpected event type");
Expand Down
2 changes: 1 addition & 1 deletion src/runtime_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ mod tests {
assert_eq!(result.mounts[0].fstype, None);
assert_eq!(result.mounts[0].flags, None);
assert_eq!(result.mounts[0].data, None);
assert_eq!(result.default_mounts, true);
assert!(result.default_mounts);
assert_eq!(result.kernel_modules, vec!["nvidia".to_string()]);
assert_eq!(result.debug_exit, Some(DebugExit::default_x86()));
assert_eq!(result.bootcmd, vec![vec!["echo", "booting"]]);
Expand Down
8 changes: 2 additions & 6 deletions src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,11 @@ impl Signer {
derivation: Option<&str>,
password: Option<&str>,
) -> Result<(SigningKey, PublicKey, AccountId)> {
let derivation = if let Some(derivation) = derivation {
derivation
} else {
"m/44'/118'/0'/0/0"
};
let derivation = derivation.unwrap_or("m/44'/118'/0'/0/0");

let mnemonic = Mnemonic::new(phrase, Language::English)?;
let pri = XPrv::derive_from_path(
&mnemonic.to_seed(password.unwrap_or("")),
mnemonic.to_seed(password.unwrap_or("")),
&derivation.parse()?,
)?;
let private_key = SigningKey::from(pri);
Expand Down
5 changes: 4 additions & 1 deletion src/task_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ impl TaskClient {
/// # Returns
///
/// A Result containing the response or an error.
pub async fn reschedule(&mut self, msg: MsgRescheduleTask) -> Result<MsgRescheduleTaskResponse> {
pub async fn reschedule(
&mut self,
msg: MsgRescheduleTask,
) -> Result<MsgRescheduleTaskResponse> {
let resp: MsgRescheduleTaskResponse = self
.base_client
.write()
Expand Down

0 comments on commit 9501e71

Please sign in to comment.