Skip to content

Commit

Permalink
fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
alenmestrov committed Nov 14, 2024
1 parent 3e76e39 commit 8030f45
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
23 changes: 16 additions & 7 deletions contracts/proxy-lib/tests/sandbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ async fn test_view_proposal() -> Result<()> {
assert_eq!(result_proposal.actions, vec![]);
assert_eq!(
result_proposal.author_id,
alice_sk.verifying_key().rt().expect("infallible conversion")
alice_sk
.verifying_key()
.rt()
.expect("infallible conversion")
);

let non_existent_proposal_id = proxy_helper.generate_proposal_id();
Expand Down Expand Up @@ -642,15 +645,18 @@ async fn test_view_proposals() -> Result<()> {
assert_eq!(proposals.len(), 3, "Expected to retrieve 3 proposals");

assert_eq!(
proposals[0].id, proposal1_id.rt().expect("infallible conversion"),
proposals[0].id,
proposal1_id.rt().expect("infallible conversion"),
"Expected first proposal to have proposal_id 1"
);
assert_eq!(
proposals[1].id, proposal2_id.rt().expect("infallible conversion"),
proposals[1].id,
proposal2_id.rt().expect("infallible conversion"),
"Expected second proposal to have proposal_id 2"
);
assert_eq!(
proposals[2].id, proposal3_id.rt().expect("infallible conversion"),
proposals[2].id,
proposal3_id.rt().expect("infallible conversion"),
"Expected third proposal to have proposal_id 3"
);

Expand All @@ -677,11 +683,13 @@ async fn test_view_proposals() -> Result<()> {
);

assert_eq!(
proposals[0].id, proposal2_id.rt().expect("infallible conversion"),
proposals[0].id,
proposal2_id.rt().expect("infallible conversion"),
"Expected the first returned proposal to have proposal_id 2"
);
assert_eq!(
proposals[1].id, proposal3_id.rt().expect("infallible conversion"),
proposals[1].id,
proposal3_id.rt().expect("infallible conversion"),
"Expected the second returned proposal to have proposal_id 3"
);

Expand All @@ -703,7 +711,8 @@ async fn test_view_proposals() -> Result<()> {
"Expected to retrieve 1 proposal starting from offset 3"
);
assert_eq!(
single_proposal[0].id, proposal3_id.rt().expect("infallible conversion"),
single_proposal[0].id,
proposal3_id.rt().expect("infallible conversion"),
"Expected the proposal to have proposal id 3"
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::Serialize;
use std::mem;

use serde::Serialize;

use super::ProposalId;
use crate::client::env::Method;
use crate::client::protocol::near::Near;
Expand Down Expand Up @@ -30,9 +31,8 @@ impl Method<Near> for ProposalApproversRequest {
clippy::transmute_undefined_repr,
reason = "Repr<T> is a transparent wrapper around T"
)]
let members = unsafe {
mem::transmute::<Vec<Repr<ContextIdentity>>, Vec<ContextIdentity>>(members)
};
let members =
unsafe { mem::transmute::<Vec<Repr<ContextIdentity>>, Vec<ContextIdentity>>(members) };

Ok(members)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/server/src/admin/handlers/proposals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,4 @@ pub async fn get_proposal_approvers_handler(
.into_response(),
Err(err) => parse_api_error(err).into_response(),
}
}
}

0 comments on commit 8030f45

Please sign in to comment.