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] Test withdraw method functionality #134

Open
adrianvrj opened this issue Oct 24, 2024 · 13 comments · May be fixed by #159
Open

[test] Test withdraw method functionality #134

adrianvrj opened this issue Oct 24, 2024 · 13 comments · May be fixed by #159
Assignees
Labels
ODHack9 ODHack9.0 issue

Comments

@adrianvrj
Copy link
Member

This issue will be part of ODHack9.0, please apply via Onlydust app

  • Add a test to make sure the withdraw functionality of contracts/src/fund.cairo is working correctly.
  • Please read contributors guide before asking for an issue

Acceptance Criteria

  • All scenarios are tested
  • All tests are passing successfully
@adrianvrj adrianvrj added good first issue Good for newcomers ODHack9 ODHack9.0 issue and removed good first issue Good for newcomers labels Oct 24, 2024
@CollinsC1O
Copy link

Hello @adrianvrj I'm a Front-end and a Blockchain developer. I will love to work on this issue.

@coxmars
Copy link
Contributor

coxmars commented Oct 24, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm a software developer with 2+ years of experience and I have worked with backend technologies such as Cairo, Java, C# and frontend with React, NextJS, JS/TS. Also, I'm a member of the Dojo Coding community here in CR and I have made contributions in Cairo VM Go, Cairo VM TS, Cairo Lints etc. Likewise, I’m a Cairo developer working on ByteBeasts, a fully on-chain RPG game built using Dojo.

How I plan on tackling this issue

  • First, I'll dive into the contributors guide to ensure I follow the project’s guidelines and have a clear understanding of the existing testing setup etc.
  • I will go through the fund.cairo file to analyze the withdraw functionality and identify all the possible scenarios that need to be covered.
  • Next, I will implement the tests, making sure each scenario is thoroughly covered.
  • Finally, I’ll run the tests making sure everything passes as expected.

ET: 1-3 days.

@Lukman-01
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello! My name is Lukman, and I am a passionate Smart Contract Developer with two years of experience in writing smart contracts. My hands-on experience spans various blockchain platforms, including Ethereum and Starknet. I’m eager to leverage my skills in developing efficient, secure, and innovative solutions in the blockchain space.

How I plan on tackling this issue

To address this issue, I will begin by reviewing the withdraw function in contracts/src/fund.cairo to understand its logic and identify the various scenarios that need to be tested. I will then create a comprehensive suite of tests covering all scenarios, such as successful withdrawals, edge cases for insufficient funds, and ensuring correct event emissions. Finally, I will run all tests to confirm that they pass successfully and validate the functionality of the withdraw method.

@manlikeHB
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, I am a skilled Cairo dev with lots of experience contributing to amazing projects, my profile is a witness to that statement.

How I plan on tackling this issue

I'll write a robust test covering all edge cases and ensuring the contract functions as expected.

@codeZe-us
Copy link

codeZe-us commented Oct 24, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Mid level Cairo Developer

How I plan on tackling this issue

I will write tests for the withdraw function to validate its correctness with all tests succeeding.
ETA: 2 days

@Gianfranco99
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged
I have been a developer for over 4 years and have been contributing to the Starknet ecosystem for more than a year. My recent contributions include work on cairo-lint and scaffold-starknet. I’m eager to participate in this project as I see a lot of potential in it and believe it adds valuable functionality to the Starknet ecosystem. Also I'm part of dojo-coding comunity!

How I plan on tackling this issue
This issue is not very difficult to solve, I am going to look at the function that the test needs in detail and I am also going to see the way in which other tests of the project were carried out so that everything has the same approach in terms of the test.

@ShantelPeters
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

My background in smart contract development and testing will enable me to effectively implement comprehensive tests that ensure the robustness of this functionality.

How I plan on tackling this issue

To solve the issue of testing the withdraw functionality in contracts/src/fund.cairo, I would begin by reviewing the existing implementation to understand how the withdraw function operates. I would then create a series of test cases that cover all possible scenarios, including successful withdrawals, insufficient balance cases, and any edge cases that could arise.
Each test would be designed to validate the expected outcomes and ensure that the withdraw functionality behaves as intended. I would run all tests to confirm they pass successfully, adhering to the acceptance criteria.

@saimeunt
Copy link
Contributor

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have contributed to several Cairo projects on OnlyDust and I've worked on very similar issues in the past such as ArkProjectNFTs/bridge#236

How I plan on tackling this issue

I will carefully add the necessary tests to make sure the withdraw functionality is working as expected. I will use Starknet Foundry to reach 100% coverage.

@0xprivateChaos
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I bring 2 years of hands-on experience in writing and optimizing tests for Solidity smart contracts, which has given me strong foundation in blockchain testing patterns. Recently, I've expanded my expertise into Cairo development, actively writing contracts and their corresponding tests. My combination of established testing experience in Solidity and fresh perspective in Cairo, along with deep theoretical knowledge, positions me well to tackle this testing challenge effectively.

How I plan on tackling this issue

Add a test for the withdraw method by simulating donations until the goal is reached. Verify that the owner can successfully withdraw, check the balance change, confirm the state changes to CLOSED, and ensure the correct event is emitted with the fund address, owner address, and withdrawn amount. Add assertions to ensure only the owner can call withdraw, and it fails if the goal isn’t met.

@aniruddhaaps
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a cairo dev. A new-comer here, willing and ready to contribute to contribute to solve the issue.

@BrunoAmbricca
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello guys, I have been working for the past 4 years as a developer with multiple languages such as ts, and for the past 3 months learning and working with cairo on my own projects.

How I plan on tackling this issue

I would look the method, follow the contributor guidelines and test all it´s cases including border cases.

@diegoTech14
Copy link
Contributor

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello @adrianvrj

I'm a software engineer from Costa Rica and a proud member of Dojo Coding. I've contributed to projects like Go Stark Me, Coffiblocks, and DipDup, and I have experience with technologies such as Foundry and Cairo. I would love the opportunity to help with this issue and contribute to your project

How I plan on tackling this issue

For this issue I will:

1.I will analyze fund cairo file to understand the withdraw functionality and identify all the possible scenarios to tests

2. Testing: I will implement test cases for the withdraw functionality based on the previous analyze

3.Running tests: I will run the tests ensuring everything is okay and all tests passed

4. Documentation: I will document the tests if it is needed.

ETA: 2-3 days

Looking forward to your feedback!

Best regards,

Diego Duarte Fernández.

@ryzen-xp
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I’m experienced in developing and testing smart contracts using Cairo and Solidity. I’ve worked on projects like ARK and Worldlines Bridge

How I plan on tackling this issue

[1]=>Review the withdraw method logic to understand how it handles fund withdrawals, ensuring edge cases are considered.
[2]=>Write test cases for various scenarios, such as successful withdrawals, invalid attempts, and edge cases like insufficient balance.
[3]=>Ensure that each scenario is thoroughly tested and validated.
[4]=>Run the tests to verify that all functionalities are working as expected and all tests pass successfully.

please /assign

@manlikeHB manlikeHB linked a pull request Oct 25, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ODHack9 ODHack9.0 issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.