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

Fix bucket bankruptcy #66

Merged
merged 6 commits into from
Sep 11, 2023
Merged

Fix bucket bankruptcy #66

merged 6 commits into from
Sep 11, 2023

Conversation

EdNoepel
Copy link
Contributor

updateBucketLends was pushing new items onto the collection itself, but was removing items from a copy of the collection which had no effect. Removed nullcheck for pool, which should never be null. Left a single log statement in which identifies the pool and bucket which went bankrupt.

Copy link
Contributor

@MikeHathaway MikeHathaway left a comment

Choose a reason for hiding this comment

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

LGTM

@EdNoepel
Copy link
Contributor Author

Investigating test failure.

@EdNoepel
Copy link
Contributor Author

The problem with the BucketBankruptcy test seems to be that the addQuoteToken call is not adding the Lend entity to Bucket.lends array. As a result, when the bankruptcy occurs, _handleBucketBankruptcy gets an empty array, so cannot remove the Lend.

@EdNoepel
Copy link
Contributor Author

Tests had caught a legitimate issue with my fix improperly using concat instead of push. Resolved and updated assertLendUpdate to check the pool address, since it was already in the arguments.

@EdNoepel EdNoepel merged commit a2619ae into develop Sep 11, 2023
@EdNoepel EdNoepel deleted the fix-bucket-bankruptcy branch September 11, 2023 18:39
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