Refactor + Implement saving referrals data#1
Conversation
…into feat/referral-system-new
| }, | ||
| }; | ||
|
|
||
| // Make the enum public so it can be used throughout your crate |
There was a problem hiding this comment.
Maybe remove AI comments.
I added this to my AI instructions, it's better now...
| // Define the result type using the public AppError | ||
| pub type AppResult<T> = Result<T, AppError>; | ||
|
|
||
| // NEW: Implement IntoResponse for AppError |
| assert_eq!(response.status(), StatusCode::OK); | ||
| } | ||
| } | ||
| // #[cfg(test)] |
There was a problem hiding this comment.
Change request
1 - remove commented code
2 - Add unit tests that test everything
| #[derive(Debug, Serialize, Deserialize, Clone)] | ||
| pub struct Address { | ||
| pub quan_address: QuanAddress, | ||
| pub eth_address: ETHAddress, |
There was a problem hiding this comment.
We may have more than just eth address, not sure that's the best place to store this in the main object.
Probably better in a separate table?
There was a problem hiding this comment.
Make sense, we are not limiting the option then. I’m extending what Chris design so I thought we will not need it
n13
left a comment
There was a problem hiding this comment.
Add unit test coverage for all functions. Too much code to just check in without any tests.
|
Okay, I will address the feedback first! |
|
I have updated with unit tests and some integration tests. There are two service that I can't fully test well which are reverser.rs and signature_verifications.rs. |
n13
left a comment
There was a problem hiding this comment.
Thanks lets add tests for verify signature later.
IDK what reverser is?
Anyway this can be merged.
I have finished the base functionalities. We only need to add authentication now to prevent abuse on the post request to /api endpoint