Skip to content
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

Refactor models files and db models conversions #3318

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

3shv
Copy link

@3shv 3shv commented Mar 9, 2025

Description

Related to issue 2110

Tried to remove the redundancy of full_order_into_model_order and made use of traits from std::convert.
Let me know if I should follow a different approach.

@3shv 3shv requested a review from a team as a code owner March 9, 2025 13:10
@3shv
Copy link
Author

3shv commented Mar 9, 2025

        // Filled - sell (filled - 100%)
        let status: OrderStatus = (&FullOrder {
            kind: DbOrderKind::Sell,
            sell_amount: BigDecimal::from(2),
            sum_sell: BigDecimal::from(3),
            sum_fee: BigDecimal::from(1),
            ..order_row()
        })
            .into();
        assert_eq!(status, OrderStatus::Fulfilled);

This test case is failing after refactor.. not sure why 🤔

Edit: Fixed after using sum_fee instead of executed_fee inside the function is_sell_order_filled

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.

1 participant