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

[test] Unit Tests for Legacy Map #328

Open
EmmanuelAR opened this issue Jan 22, 2025 · 24 comments
Open

[test] Unit Tests for Legacy Map #328

EmmanuelAR opened this issue Jan 22, 2025 · 24 comments
Assignees
Labels
good first issue Good for newcomers ODBoost

Comments

@EmmanuelAR
Copy link
Collaborator

EmmanuelAR commented Jan 22, 2025

This issue will be part of ODBoost, please apply via Onlydust app

•⁠ ⁠Please read contributors guide before asking for an issue.


Description

Develop unit tests to validate the functionality introduced in ticket #327 , which adds a legacy map to the fund contract.

Requirements

  1. Test Cases for Legacy Map:

• Verify that a new donator is correctly registered in the legacy map with their initial donation amount.

• Verify that an existing donator’s total donation amount is updated correctly upon subsequent donations.

  1. Update Test Cases for update_receive_donation Method:

• Ensure the method updates the legacy map before emitting the donation event.

• Validate that the donation event is emitted with the correct parameters.

  1. Boundary and Edge Cases:

• Test with a new donator contributing a small amount.

• Test with an existing donator contributing a large amount.

• Verify behavior when multiple donations are made in rapid succession.


Important Notes

  1. The commit message should follow this format: #(issue) + clear and concise description of the change.

Example:

#69 Add new label to main page

@EmmanuelAR EmmanuelAR added good first issue Good for newcomers ODBoost labels Jan 22, 2025
@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 stark net project and more . please /assign this issue .
Thank You

@crood-xp
Copy link

Could I grab this task?

1 similar comment
@Supa-mega
Copy link

Could I grab this task?

@martinvibes
Copy link

Holla i'm Martin, I'm a frontend developer who enjoys building smooth applications to pixel perfect and engaging websites using JavaScript, typescript and frameworks(React, nextjs, tailwindcss etc.) and i have contributed to other projects that have been merged.
Am also experienced in working and writing smart contracts.
Kindly assign :)

@Wendyalbert
Copy link

May I pick this up?

@CollinsC1O
Copy link
Contributor

CollinsC1O commented Jan 22, 2025

I'd love to work on this!
I have experience writing several tests for different project even here on onlyDust .

@josephchimebuka
Copy link
Contributor

Hello, I am Joseph Chimebuka and I am an active software developer and a Diamond contributor on Onlydust I can handle this task can you please assign. I will create a PR in 24-48hrs. I have experience writing test for some projects in only dust as well

@Emmanex01
Copy link

Can I contribute to this one?
I'm Emmanuel Tochukwu, frontend and smart contract developer. I have experience building projects using JavaScript, Cairo, Tailwindcss, Typescript and Nextjs. If given this issue, I will deliver as soon as possible.

@SoarinSkySagar
Copy link
Contributor

may i start working on this @EmmanuelAR ?

background: cairo dev with 5 months of experience and regular contributor at @keep-starknet-strange

eta: 2 days

@aguilar1x
Copy link
Contributor

Is it okay if I take this?

Hi, my name is Matías Aguilar. I am a software development engineer with 1 year of experience in backend and some frontend. I am a maintainer of projects like RevolutionaryFarmers and StarShop, focusing on Smart Contracts using Rust, and I also have experience with Cairo. I am passionate about design, which is why I enjoy UI/UX, and I have a natural ability to create effects or design anything that might be needed. Along with my team, I won first place in one of the tracks at the Eth Pura Vida hackathon. My experience in both frontend and backend enables me to carry out a wide variety of tasks to achieve set goals.

I am also skilled in documentation, ensuring that the reading experience is clean, concise, and enjoyable for the reader. I apply various visual techniques to make the content engaging and appealing. I am a member of Dojo Coding, and I would really love to participate in the project with this issue.

@Ilialtes
Copy link

Hi I'm a full-stack developer from Costa Rica and member of Dojo coding. I've worked on projects using React, Solidity, Cairo, and blockchain tools. My skills in both front-end and back-end development allow me to build scalable and secure solutions for web3 ecosystems.

@FrankiePower
Copy link

Hello Team

My name is SuperFranky, and I am excited to be participating in the first edition of ODBoost. I am a returning contributor on OnlyDust, and I have contributed to a variety of interesting projects. I am a frontend and blockchain developer with over 3+ years of experience My expertise in React, Next.js, solidity, cairo, responsive design and an array of other programming languages makes me confident in delivering high-quality solutions.

I am passionate about contributing to open-source Web3 projects and committed to delivering exceptional results.

Thank you for considering my application.

@1nonlypiece
Copy link

Application for Contribution

I am excited about the opportunity to contribute to this issue and am confident that my expertise aligns well with the requirements. With a strong background in Cairo programming and decentralized application development on StarkNet, I bring a well-rounded skill set to deliver an effective solution.

Relevant Expertise

  • Blockchain & Smart Contracts: Extensive experience with StarkNet, Stellar, and Rust, specializing in developing secure and optimized smart contracts, blockchain integrations, and high-performance backend infrastructure.
  • Backend Development: Well-versed in API design, server-side logic, and scalable system architecture, ensuring efficient and seamless backend performance.
  • Frontend Engineering: Skilled in crafting interactive and responsive UI components using React and Next.js, enhancing the user experience for blockchain-based platforms.

Why Consider My Application?

My proven track record of delivering high-quality, optimized solutions in blockchain and full-stack development sets me apart. I have a deep understanding of smart contract security, decentralized architectures, and the synergy between frontend, backend, and blockchain layers—ensuring a seamless and efficient implementation.

ETA

I expect to have a working solution ready within 48 hours. Please let me know if I can proceed with the implementation.

@emarc99
Copy link

emarc99 commented Jan 23, 2025

Can I jump on this task?

@ChrisFernandezVivas
Copy link
Contributor

Proposed Solution for Issue #327

Introduction

Hello, I'm Christopher from Dojo Coding. I'd like to work on implementing the test suite for the legacy map functionality.

Developer Information

  • Name: Christopher
  • Organization: Dojo Coding
  • Experience: Cairo/Starknet development
  • ETA: 2 days
  • Availability: Immediate start

Proposed Solution Path

1. Test Environment Setup

  • Initialize test environment with necessary imports
  • Create helper functions for contract deployment
  • Setup mock addresses and test amounts

2. Core Test Implementation

// Pseudo structure for core tests

#[test]
mod legacy_map_tests {
   // Setup and helper functions
   // Core test cases
   // Event verification
}

@Jagadeeshftw
Copy link

Proposal to Work on the Issue

I am eager to contribute to this issue and believe I am well-suited for the task, given my extensive experience in Cairo programming and building decentralized applications on StarkNet. My expertise spans across multiple domains crucial for this implementation:

  • Smart Contracts & Blockchain Development: Proven expertise in StarkNet, Stellar, and Rust, with hands-on experience in developing secure and efficient smart contracts, blockchain integrations, and high-performance backend systems.
  • Backend Engineering: Strong background in designing and managing scalable APIs, handling server-side operations, and ensuring robust backend performance for blockchain applications.
  • Frontend Development: Proficient in building intuitive and responsive frontend interfaces using React and Next.js, ensuring seamless interaction between users and blockchain-based applications.

Why Assign This to Me?

I have a track record of delivering high-quality solutions efficiently, with a deep understanding of smart contract security, decentralized architectures, and full-stack development. My ability to bridge frontend, backend, and blockchain components ensures a well-rounded, optimized solution.

Estimated Timeline

I anticipate delivering a fully functional solution within 2 days. Please let me know if I can proceed.

I am excited about the opportunity to contribute and look forward to collaborating!

Best regards,
Jagadeesh B

@Utilitycoder
Copy link

Could I take over this issue?

@Utilitycoder
Copy link

Hi, I'm Lawal and I'll be working on this issue.

I estimate this will take 3-5 hours to complete.

This is how I would tackle this issue:

Implementation Steps:

  • Read the contract to understand the new Donator Map State variables
  • check the existing test cases to understand what has been covered.
  • Update the test module _setup function to ease testing if required
  • Implement test helper functions.
  • Implement tests with different edge-cases.

Key Test Considerations:

  • Isolation between tests using fresh contract state
  • Edge cases for donation amounts
  • Multiple donator scenarios
  • Gas efficiency in map operations

Additional Tests to Consider:

  • Zero donation handling
  • Maximum donation value tests
  • Invalid donator address tests
  • Map iteration functionality (if needed)

if you need any clarification on the approach, please let me know.

@mimisavage
Copy link

Can I contribute to this one?

@Abeeujah
Copy link
Contributor

I'd like to contribute comprehensive unit tests for the legacy map functionality introduced in #327. I plan to use the following test cases:

  • New Donator Registration: Test registering a new donator and verify their initial donation is correctly stored in the legacy map.
  • Existing Donator Update: Test adding a subsequent donation for an existing donator and verify the total donation amount is updated correctly.
  • Event Emission Order: Test the update_receive_donation method to ensure the legacy map is updated before the donation event is emitted. This will include checking the storage state and then verifying the event.
  • Event Parameter Validation: Test the update_receive_donation method to ensure the emitted donation event DonationRecieved contains the correct parameters (donator address, donated_strks, etc.).
  • Small Donation: Test with a new donator contributing a small amount.
  • Large Donation: Test with an existing donator contributing a large amount.
  • Rapid Donations: Test with multiple donations made in rapid succession to ensure consistency.

I can provide a PR with these tests shortly. ETA 4 hours.

@Yunusabdul38
Copy link

Can I contribute to this one?

@CollinsC1O
Copy link
Contributor

CollinsC1O commented Jan 23, 2025

Hello @EmmanuelAR, I will love to help with this issue.
I'm a smart contract developer and would love to provide test cases for the legacy map.

@Amizeey
Copy link

Amizeey commented Jan 23, 2025

Can I attempt this issue?

@jancris100
Copy link

Hey! I'm Jan.
Member of Dojo Coding. I have contributed before to other projects like:

• Dojo
Can I work on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers ODBoost
Projects
None yet
Development

No branches or pull requests