31 lines
765 B
Rust
31 lines
765 B
Rust
#[cfg(not(test))]
|
|
use tracing::warn;
|
|
|
|
use crate::{request_context::RequestContext, state::AppState};
|
|
|
|
pub async fn grant_new_user_registration_wallet_reward(
|
|
state: &AppState,
|
|
request_context: &RequestContext,
|
|
user_id: &str,
|
|
) {
|
|
#[cfg(test)]
|
|
{
|
|
let _ = (state, request_context, user_id);
|
|
}
|
|
|
|
#[cfg(not(test))]
|
|
if let Err(error) = state
|
|
.spacetime_client()
|
|
.grant_new_user_registration_wallet_reward(user_id.to_string())
|
|
.await
|
|
{
|
|
warn!(
|
|
request_id = request_context.request_id(),
|
|
operation = request_context.operation(),
|
|
user_id = user_id,
|
|
error = %error,
|
|
"新用户注册光点赠送失败,注册流程继续"
|
|
);
|
|
}
|
|
}
|