Skip to content

Refactor + Implement saving referrals data#1

Merged
dewabisma merged 26 commits into
mainfrom
feat/referral-system-new
Oct 8, 2025
Merged

Refactor + Implement saving referrals data#1
dewabisma merged 26 commits into
mainfrom
feat/referral-system-new

Conversation

@dewabisma

Copy link
Copy Markdown
Contributor

I have finished the base functionalities. We only need to add authentication now to prevent abuse on the post request to /api endpoint

Comment thread src/errors.rs Outdated
},
};

// Make the enum public so it can be used throughout your crate

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe remove AI comments.

I added this to my AI instructions, it's better now...

Comment thread src/errors.rs Outdated
// Define the result type using the public AppError
pub type AppResult<T> = Result<T, AppError>;

// NEW: Implement IntoResponse for AppError

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same remove ai comment

Comment thread src/http_server.rs
assert_eq!(response.status(), StatusCode::OK);
}
}
// #[cfg(test)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change request
1 - remove commented code
2 - Add unit tests that test everything

Comment thread src/models/address.rs
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Address {
pub quan_address: QuanAddress,
pub eth_address: ETHAddress,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense, we are not limiting the option then. I’m extending what Chris design so I thought we will not need it

@n13 n13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add unit test coverage for all functions. Too much code to just check in without any tests.

@dewabisma

Copy link
Copy Markdown
Contributor Author

Okay, I will address the feedback first!

@dewabisma

Copy link
Copy Markdown
Contributor Author

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.

@dewabisma dewabisma requested a review from n13 October 7, 2025 08:46

@n13 n13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks lets add tests for verify signature later.

IDK what reverser is?

Anyway this can be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants