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

feat: Add Unit Tests for Mempool Functionality #1359

Merged
merged 8 commits into from
Sep 9, 2024

Conversation

eugypalu
Copy link
Collaborator

@eugypalu eugypalu commented Sep 2, 2024

Resolves: #1355

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Testing

What is the new behavior?

mempool unit tests

Does this introduce a breaking change?

  • Yes
  • No

@tcoratger
Copy link
Collaborator

@eugypalu Nice addition to our test suite. I would have two small remarks before merging:

  • I think we will wait to merge Add KakarotTransactions trait to upstream send_raw_transaction #1352 first because there will be a small change in the provider but normally it will just require to modify very slightly the way you call the pool which should be in the ethclient and no longer in the ethprovider (but it is not a big change for your tests).
  • On the other hand, I know that it is rather recommended to separate the tests to have unit test as much as possible and limit the scope of each test but in our case it is a little different. Each time we need to start Katana and the docker container so it still takes a little time. So I would be in favor of grouping some of your tests together, for example:
    • If I'm not mistaken, your test_mempool_pooled_transaction_hashes test checks the hashes of transactions added to the pool against the expected. So we could make these assertions directly at the end of your test_mempool_add_transactions test. This would add additional assertions but it would limit the number of tests.
    • I think you can do the same thing to group several tests together as soon as possible.

@eugypalu
Copy link
Collaborator Author

eugypalu commented Sep 3, 2024

On the other hand, I know that it is rather recommended to separate the tests to have unit test as much as possible and limit the scope of each test but in our case it is a little different. Each time we need to start Katana and the docker container so it still takes a little time. So I would be in favor of grouping some of your tests together, for example:

  • If I'm not mistaken, your test_mempool_pooled_transaction_hashes test checks the hashes of transactions added to the pool against the expected. So we could make these assertions directly at the end of your test_mempool_add_transactions test. This would add additional assertions but it would limit the number of tests.
  • I think you can do the same thing to group several tests together as soon as possible.

Fixed, thanks

tcoratger
tcoratger previously approved these changes Sep 4, 2024
@tcoratger
Copy link
Collaborator

Nice, lgtm, pending #1352 to be merged

tests/tests/mempool.rs Outdated Show resolved Hide resolved
tests/tests/mempool.rs Outdated Show resolved Hide resolved
tests/tests/mempool.rs Outdated Show resolved Hide resolved
tests/tests/mempool.rs Outdated Show resolved Hide resolved
tests/tests/mempool.rs Outdated Show resolved Hide resolved
tests/tests/mempool.rs Outdated Show resolved Hide resolved
tests/tests/mempool.rs Outdated Show resolved Hide resolved
@tcoratger
Copy link
Collaborator

@eugypalu Here I think that you will have some conflicts to solve after the merge of #1352 (comment). Can you rebase? The main thing is that now you have to call mempool() and send_raw_transaction() from the eth_client and not from the eth_provider anymore.

@eugypalu
Copy link
Collaborator Author

eugypalu commented Sep 6, 2024

@eugypalu Here I think that you will have some conflicts to solve after the merge of #1352 (comment). Can you rebase? The main thing is that now you have to call mempool() and send_raw_transaction() from the eth_client and not from the eth_provider anymore.

Hey @tcoratger, I've rebased and fixed the conflicts 👍

@greged93 greged93 added this pull request to the merge queue Sep 9, 2024
Merged via the queue into kkrt-labs:main with commit 4bb98c1 Sep 9, 2024
8 of 9 checks passed
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.

feat: Add Unit Tests for Mempool Functionality
3 participants