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

Replace AccountsBalanceTracker with accounting deltas #1787

Merged
merged 3 commits into from
Jun 28, 2024

Conversation

azarovh
Copy link
Member

@azarovh azarovh commented Jun 27, 2024

AccountsBalanceTracker was used to check if multiple account spend in a single tx won't underflow the balance. To avoid duplicating code when adding support for Orders I use Deltas now. They already implement all the constraint check and are easily reusable for the job.

@@ -113,6 +121,34 @@ impl<'a> PoSAccountingView for PoSAccountingAdapterToCheckFees<'a> {
}
}

struct StubTokensAccounting;
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we used the word "Mock" instead of "Stub"... it's a matter of convention.

Copy link
Member Author

Choose a reason for hiding this comment

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

Idk it's actually a stub with hardcoded state to satisfy function signature. It doesn't have any logic or expectation as mocks

Base automatically changed from feat/orders_accounting to master June 28, 2024 10:10
@azarovh azarovh merged commit 14032a1 into master Jun 28, 2024
14 checks passed
@azarovh azarovh deleted the fix/remove_account_balance_tracker branch June 28, 2024 10:10
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