Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
BlaineHeffron committed Jun 5, 2024
1 parent 044934a commit a42bfd0
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl CustomAccountInterface for Contract {
#[allow(non_snake_case)]
fn __check_auth(
env: Env,
_signature_payload: Hash<32>,
signature_payload: Hash<32>,
signature: Signature,
auth_contexts: Vec<Context>,
) -> Result<(), Error> {
Expand All @@ -55,16 +55,14 @@ impl CustomAccountInterface for Contract {
&& (c.fn_name == Symbol::new(&env, "add_sig")
|| c.fn_name == Symbol::new(&env, "rm_sig")
|| c.fn_name == Symbol::new(&env, "resudo"))
{
if signature.id
&& signature.id
!= env
.storage()
.instance()
.get::<Symbol, BytesN<32>>(&SUDO_SIGNER)
.ok_or(Error::NotFound)?
{
return Err(Error::NotPermitted);
}
{
return Err(Error::NotPermitted);
}
}
Context::CreateContractHostFn(_) => return Err(Error::InvalidContext),
Expand All @@ -76,6 +74,9 @@ impl CustomAccountInterface for Contract {
.persistent()
.get::<BytesN<32>, Bytes>(&signature.id)
.ok_or(Error::NotFound)?;
if signature_payload.to_bytes().len() != 32 {
return Err(Error::NotPermitted);
}

let client_data = ClientDataJson {
challenge: "dummy_challenge",
Expand Down

0 comments on commit a42bfd0

Please sign in to comment.