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

[Rust] - Add Comprehensive Integration Tests for Rust Code #4

Closed
3 tasks
julienbrs opened this issue Nov 19, 2024 · 12 comments
Closed
3 tasks

[Rust] - Add Comprehensive Integration Tests for Rust Code #4

julienbrs opened this issue Nov 19, 2024 · 12 comments
Assignees
Labels

Comments

@julienbrs
Copy link
Collaborator

Description

Develop integration tests to validate the interoperability between allocation.rs, node.rs, and merkle_tree.rs under realistic scenarios. The goal is to simulate and test real-world use cases, such as creating a Merkle tree and verifying proofs.

Acceptance Criteria

  • Write integration tests to validate full Merkle tree creation:
    • Use data from mock_allocations_first_wave.json and mock_allocations_second_wave.json.
    • Compare root hashes with expected values.
  • Verify proofs generated by build_address_calldata():
    • Validate the correctness of proofs using known allocations.
    • Test proof generation for invalid allocations and ensure graceful error handling.
  • Simulate merging two trees:
    • Combine first and second wave allocations.
    • Validate the resulting tree's root hash and allocation integrity.

Additional Context

  • The tests should mimic real scenarios.
  • Focus on end-to-end flows to catch potential integration bugs.

[Medium Difficulty - Rust]

@martinvibes
Copy link
Contributor

Can I take care of this issue?
i'm a frontend dev and a blockchain dev kindly assign :)

@Gerson2102
Copy link


Hey! I'm Gerson. 👋

I'm a member of Dojo Coding and have previously contributed to other projects like:

  • kakarot-rpc
  • ef-tests
  • kakarot-ssj
  • Raito
  • Starknet-Phone

I'd like to work on this issue.

Check my OnlyDust profile for my contributions: Profile


Plan to Solve the Issue:

  1. Understand the Codebase:

    • Review allocation.rs, node.rs, and merkle_tree.rs to grasp their functionalities and interactions.
    • Familiarize myself with existing test setups and conventions.
  2. Set Up Test Environment:

    • Ensure all dependencies are installed.
    • Prepare mock data using mock_allocations_first_wave.json and mock_allocations_second_wave.json.
  3. Write Integration Tests for Merkle Tree Creation:

    • Use the mock data to create full Merkle trees.
    • Compare the generated root hashes with the expected values to validate correctness.
  4. Verify Proofs from build_address_calldata():

    • Write tests to validate proof correctness using known allocations.
    • Test with invalid allocations to ensure errors are handled gracefully.
  5. Simulate Merging Two Trees:

    • Combine allocations from the first and second waves.
    • Create a merged Merkle tree and validate the root hash and allocation integrity.
  6. Run and Validate Tests:

    • Execute all new and existing tests to ensure they pass.
    • Address any issues that arise during testing.
  7. Commit Changes with a clear message

  8. Open a Pull Request and await feedback.


@CollinsC1O
Copy link

Is it okay if I take this?

@julienbrs
Copy link
Collaborator Author

julienbrs commented Nov 21, 2024

Hi, I'm assigning it to @martinvibes as he was the first one to ask, please tag me if needed. Please join TG to discuss about it if needed: https://t.me/carbonableOD
Issue might be reassigned during ODHack if the contributor drops the issue.

@petersdt
Copy link

May I pick this up?

@Unickhub
Copy link

May I try my hand at this?

@Supa-mega
Copy link

Can I work on this, please?

@martinvibes
Copy link
Contributor

Can I take care of this issue?
i'm a frontend dev and a blockchain dev kindly assign :)

@JoE11-y
Copy link

JoE11-y commented Nov 21, 2024

I'd like to handle this task.

@Benjtalkshow
Copy link

Can I take this issue?

@ryzen-xp
Copy link

Hi, I am proficient Blockchain developer expert in Cairo , Rust and Solidity and also in web development.
I have contributed many Rust ,Cairo projects like chainevents , arkprojects , starknet etc . please /assign this issue .
Thank You

@DanielEmmanuel1
Copy link

Could I grab this task?
How I hope to tackle this

  • Write integration tests combining allocation.rs, node.rs, and merkle_tree.rs.

  • Use mock JSON files for realistic Merkle tree creation; compare root hashes to expected values.

  • Validate proofs from build_address_calldata() for both valid and invalid cases.

  • Simulate merging two trees; ensure correct root hash and allocation consistency.

  • Mimic end-to-end flows to catch integration issues.

ETA: 48 hrs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests