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

Settlement Engine #9

Merged
merged 24 commits into from
Jul 11, 2024
Merged

Settlement Engine #9

merged 24 commits into from
Jul 11, 2024

Conversation

ankurdubey521
Copy link
Collaborator

No description provided.

@ankurdubey521 ankurdubey521 added the enhancement New feature or request label Jul 1, 2024
@ankurdubey521 ankurdubey521 requested a review from AmanRaj1608 July 1, 2024 02:51
@ankurdubey521 ankurdubey521 self-assigned this Jul 1, 2024
@ankurdubey521 ankurdubey521 marked this pull request as draft July 1, 2024 02:53
AmanRaj1608 and others added 3 commits July 4, 2024 05:21
fix: update api interface

fix: remove graceful shhutdown
fix: update api interface

fix: remove graceful shhutdown
Comment on lines +107 to +108
let (direct_assets, non_direct_assets): (Vec<_>, _) =
user_balances.into_iter().partition(|balance| balance.token == to_token);
Copy link
Collaborator

Choose a reason for hiding this comment

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

🙇🏻‍♂️

feat: add user address to extract_balance_data
Comment on lines +157 to +158
user_address: sender_address.unwrap_or(&ADDRESS_ZERO.to_string()).clone(),
recipient: recipient_address.unwrap_or(&ADDRESS_ZERO.to_string()).clone(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't this a problem, it should return error here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

right, will fix it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah so this is by design actually, notice that I accept Option<String> as parameters for the addresses. The reason for this being this same function is used by the indexer to build Estimators, and at that time we don't know the sender/receiver addresses. The good thing is that socket APIs work well even if the account does not hold any funds, so address zero is ideal when running the indexer and building Estimators.

@ankurdubey521
Copy link
Collaborator Author

Had to migrate everything from &'config F to Arc<F> to fix some issues with lifetimes and have added Send + Sync to most structs.

@ankurdubey521 ankurdubey521 marked this pull request as ready for review July 11, 2024 09:23
@AmanRaj1608 AmanRaj1608 merged commit e6cfc91 into dev Jul 11, 2024
1 check passed
@AmanRaj1608 AmanRaj1608 deleted the feat/settlement-engine branch July 11, 2024 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants