diff --git a/components/brave_ads/core/internal/account/confirmations/refill_unblinded_tokens/refill_unblinded_tokens.cc b/components/brave_ads/core/internal/account/confirmations/refill_unblinded_tokens/refill_unblinded_tokens.cc index fde22b40c4bc..4d6cb933b644 100644 --- a/components/brave_ads/core/internal/account/confirmations/refill_unblinded_tokens/refill_unblinded_tokens.cc +++ b/components/brave_ads/core/internal/account/confirmations/refill_unblinded_tokens/refill_unblinded_tokens.cc @@ -74,22 +74,12 @@ void RefillUnblindedTokens::MaybeRefill(const WalletInfo& wallet) { if (!wallet.IsValid()) { BLOG(0, "Failed to refill unblinded tokens due to an invalid wallet"); - - if (delegate_) { - delegate_->OnFailedToRefillUnblindedTokens(); - } - - return; + return FailedToRefillUnblindedTokens(/*should_retry*/ false); } if (!HasIssuers()) { BLOG(0, "Failed to refill unblinded tokens due to missing issuers"); - - if (delegate_) { - delegate_->OnFailedToRefillUnblindedTokens(); - } - - return; + return FailedToRefillUnblindedTokens(/*should_retry*/ false); } if (!ShouldRefillUnblindedTokens()) { @@ -236,7 +226,7 @@ void RefillUnblindedTokens::GetSignedTokensCallback( delegate_->OnCaptchaRequiredToRefillUnblindedTokens(*captcha_id); } - return; + return FailedToRefillUnblindedTokens(/*should_retry*/ false); } // Get public key diff --git a/components/brave_ads/core/internal/account/confirmations/refill_unblinded_tokens/refill_unblinded_tokens_unittest.cc b/components/brave_ads/core/internal/account/confirmations/refill_unblinded_tokens/refill_unblinded_tokens_unittest.cc index 13dcb26654f4..9e735ffaafb5 100644 --- a/components/brave_ads/core/internal/account/confirmations/refill_unblinded_tokens/refill_unblinded_tokens_unittest.cc +++ b/components/brave_ads/core/internal/account/confirmations/refill_unblinded_tokens/refill_unblinded_tokens_unittest.cc @@ -112,8 +112,7 @@ TEST_F(BraveAdsRefillUnblindedTokensTest, .Times(0); EXPECT_CALL(refill_unblinded_tokens_delegate_mock_, - OnFailedToRefillUnblindedTokens()) - .Times(0); + OnFailedToRefillUnblindedTokens()); EXPECT_CALL(refill_unblinded_tokens_delegate_mock_, OnWillRetryRefillingUnblindedTokens(_))