Skip to content

Commit

Permalink
Added errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayanski committed Nov 27, 2024
1 parent a647229 commit b2f2d62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions framework/contracts/account/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ pub enum AccountError {
contract: String,
},

#[error("No auth methods capabilities on this account (xion feature disabled)")]
NoAuthMethods {},

#[error("Abstract Account don't have Authentication")]
AbsAccNoAuth {},

Expand Down
4 changes: 2 additions & 2 deletions framework/contracts/account/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub fn add_auth_method(
}
#[cfg(not(feature = "xion"))]
{
Ok(AccountResponse::action("add_auth"))
Err(AccountError::NoAuthMethods {})

Check warning on line 130 in framework/contracts/account/src/execution.rs

View check run for this annotation

Codecov / codecov/patch

framework/contracts/account/src/execution.rs#L130

Added line #L130 was not covered by tests
}
}

Expand All @@ -138,7 +138,7 @@ pub fn remove_auth_method(_deps: DepsMut, _env: Env, _id: u8) -> AccountResult {
}
#[cfg(not(feature = "xion"))]
{
Ok(AccountResponse::action("remove_auth"))
Err(AccountError::NoAuthMethods {})

Check warning on line 141 in framework/contracts/account/src/execution.rs

View check run for this annotation

Codecov / codecov/patch

framework/contracts/account/src/execution.rs#L141

Added line #L141 was not covered by tests
}
}

Expand Down

0 comments on commit b2f2d62

Please sign in to comment.