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: unit test for receipts WithOtherFields #1464

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

Conversation

eugypalu
Copy link
Collaborator

@eugypalu eugypalu commented Oct 16, 2024

Resolves: #1457

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?

Added test to verify WithOtherFields behavior in eth_provider.

Does this introduce a breaking change?

  • Yes
  • No

tests/tests/eth_provider.rs Outdated Show resolved Hide resolved
src/providers/eth_provider/database/ethereum.rs Outdated Show resolved Hide resolved
.insert("run out of resources".to_string(), serde_json::Value::from("run out of resources"));

// Insert the modified receipt into the database
katana.eth_provider().database().upsert_transaction_receipt(receipt_with_other_fields.clone()).await.unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally I would rather have a way to add these on the startup of the katana instance

Copy link
Collaborator Author

@eugypalu eugypalu Oct 18, 2024

Choose a reason for hiding this comment

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

I’m not sure if I understood what you mean. Do you mean adding a isRunOutOfResources receipt at Katana’s startup?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, the point mentioned here by @greged93 is that it is a bit "useless" to add an upsert_transaction_receipt function in the database implementation knowing that we only use this call for a test.

So what you could do is that when launching Katana, in the same way that we add logs and block headers, you add a single receipt with a run out of resources and this way it is already present in the database when you use the katana fixture, you don't need to insert it here.

tests/tests/eth_provider.rs Outdated Show resolved Hide resolved
tests/tests/eth_provider.rs Outdated Show resolved Hide resolved
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: unit test for receipts WithOtherFields
3 participants