-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add endpoint to get the timestamp of the last client auto allocation #224
Add endpoint to get the timestamp of the last client auto allocation #224
Conversation
use chrono::{DateTime, FixedOffset}; | ||
use sea_orm::{entity::*, query::*, DbErr}; | ||
|
||
pub async fn get_last_calient_autoallocation( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub async fn get_last_calient_autoallocation( | |
pub async fn get_last_client_autoallocation( |
Typo.
.filter(Column::EvmWalletAddress.contains(client_evm_address.into())) | ||
.one(&conn) | ||
.await? | ||
.ok_or_else(|| DbErr::Custom("Autoallocation not found.".to_string())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing autoallocation isn't an error, it will be a relatively normal occurrence.
Returning Error here should be reserved for real errors (db connection issue, db schema mismatch). If there's no autoallocation found, we should return Option::None.
#[serde(rename = "EVM Wallet Address")] | ||
pub evm_wallet_address: Address, | ||
#[serde(rename = "Last Allocation")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why rename like this?
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Serialize, Deserialize, Debug, Clone)] | ||
pub struct Autoallocation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this struct for, I don't see it used.
Also, why this file is named file.rs
?
No description provided.