Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Andrei <92177534+andrei-21@users.noreply.github.com>
  • Loading branch information
dleutenegger and andrei-21 committed Dec 4, 2023
1 parent 2722e92 commit 687bef9
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions honey-badger/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ impl TryInto<TermsAndConditions> for ServiceProviderEnum {
match self {
ServiceProviderEnum::LIPA_WALLET => Ok(TermsAndConditions::Lipa),
ServiceProviderEnum::POCKET_EXCHANGE => Ok(TermsAndConditions::Pocket),
ServiceProviderEnum::Other(v) => Err(runtime_error(
ServiceProviderEnum::Other(v) => runtime_error!(
GraphQlRuntimeErrorCode::CorruptData,
format!("Unknown service provider: {v:?}"),
)),
"Unknown service provider: {v:?}",
),
}
}
}
Expand Down Expand Up @@ -145,11 +145,12 @@ impl AuthProvider {
terms: TermsAndConditions,
) -> Result<TermsAndConditionsStatus> {
info!("Requesting T&C status ({terms:?})...");
if self.auth_level != AuthLevel::Pseudonymous {
return Err(invalid_input(
"Requesting T&C status not supported for auth levels other than Pseudonymous",
));
}
ensure!(
self.auth_level == AuthLevel::Pseudonymous,
invalid_input(
"Requesting T&C status not supported for auth levels other than Pseudonymous"
)
);

let variables = get_terms_and_conditions_status::Variables {
service_provider: terms.into(),
Expand Down

0 comments on commit 687bef9

Please sign in to comment.