NoshonNetworks / landver

Onchain Land Management
https://landver.vercel.app/
MIT License
5 stars 18 forks source link

Implement LandStatus Enum and Update Related Functions #82

Open fishonamos opened 2 days ago

fishonamos commented 2 days ago

Description: We need to implement a LandStatus enum to represent the different states of a land parcel (Pending, Approved, Rejected) and update all related functions to use this new enum instead of the boolean is_approved field. This will provide more flexibility in managing land statuses and improve the overall clarity of the code.

Tasks:

Definition of Done: • All public functions in the LandRegistry contract have unit tests. • Edge cases are identified and tested for each function. • Test coverage is at least 90% for the LandRegistry contract.

PoulavBhowmick03 commented 1 day ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm Poulav Bhowmick, a Starknet Wolf. I am a software engineer at Invisible Studios, and a blockchain engineer with a robust background in TypeScript, Rust, Solidity Cairo, fullstack development and blockchain technology. My experience includes building robust applications, optimizing functionalities and blockchain integration. I have actively participated in events and open source contributions, enhancing my capability to tackle real-world tech challenges. My projects can be viewed on my GitHub Profile and OnlyDust Profile. Plus I´m active member of Starknet, Ethereum, Stellar ecosystem.

How I plan on tackling this issue

I can work on this I will create comprhensive test suite for the functions and test them to see if at least 90% test cases pass

ETA - 3 days

manlikeHB commented 1 day ago

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 go through the repo to understand the land registry contracts, then i'll write a robust test ensuring all edge cases are covered and it functions as espected.

Akshola00 commented 1 day ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have experience in smart contract development, specializing in creating test suites with Cairo’s testing framework. My work equips me with insight into the specific security considerations and effiecient usint testing

How I plan on tackling this issue

I would first write basic tests for all core functions like land registration, transfers, and updates. Then add edge case testing for parameters like invalid coordinates and permissions. Finally, ensure thorough test coverage using standard testing tools and methodologies. Documentation would highlight key test scenarios and expected behaviors.

DiegoB1911 commented 1 day ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm a Full Stack Developer with two years of experience. I'm also a member of Dojo Coding, where I'm expanding my expertise in Cairo and Web3 technologies. I'm enthusiastic about learning, and becoming a part of this project.

How I plan on tackling this issue

To solve this, I will:

  1. Analyze the contract functionality.
  2. Create a setup function to deploy the contract and initialize any necessary values for the test.
  3. Develop the unit tests to cover the contract functionalities.
  4. Verify that everything is working and document the code.
blessingbytes commented 1 day ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello, i'm a frontend and blockchain developer, i will love to work on this issue

How I plan on tackling this issue

ShantelPeters commented 1 day ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have a solid background in software development with a focus on blockchain and smart contract development. My experience includes working with Rust and Solidity, which has equipped me with a strong understanding of enum implementation, state management, and contract logic. I am proficient in creating well-structured code and implementing comprehensive tests to ensure functionality and security. My previous projects have required me to manage complex state transitions, making me adept at handling the various requirements associated with this task.

How I plan on tackling this issue

Define the LandStatus Enum:

I would begin by defining the LandStatus enum with the required variants: Pending, Approved, and Rejected. I will implement the necessary traits (e.g., Copy, Drop, Serde, and starknet::Store) to ensure compatibility with the existing system. Update the Land Struct:

I will modify the Land struct to replace the existing is_approved boolean field with a new field: status: LandStatus. This change will improve the clarity of the code by explicitly representing the state of the land. Implement Necessary Traits for the Land Struct:

I will ensure that the Land struct implements all necessary traits for its functionality and compatibility with existing features. Modify the register_land Function:

I will update the register_land function to set the initial status of newly registered land to LandStatus::Pending. The function will be modified to utilize the new status field instead of the boolean. Update the approve_land Function:

I will change the implementation of the approve_land function to set the land status to LandStatus::Approved. This will include checks to ensure that only lands in the Pending state can be approved. Modify the reject_land Function:

Similar to the approve_land function, I will update reject_land to set the land status to LandStatus::Rejected and ensure it only processes lands that are currently Pending. Update the transfer_land Function:

I will modify the assertions in the transfer_land function to check for LandStatus::Approved, replacing the logic that previously depended on the boolean. Revise the get_pending_approvals Function:

I will update the logic in get_pending_approvals to check for LandStatus::Pending instead of using the negated boolean value. Implement a New Function get_land_status:

I will add a function that retrieves the current status of a land parcel, providing easy access to this information. Update All Relevant Tests:

I will modify existing tests to work with the new LandStatus enum and ensure that all edge cases are covered. I will also add new tests specifically designed to cover different status transitions and edge cases, ensuring that we achieve at least 90% test coverage for the LandRegistry contract.