Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Create and emit events for verify() #5

Closed
zintarh opened this issue Oct 23, 2024 · 14 comments · Fixed by #23
Closed

Create and emit events for verify() #5

zintarh opened this issue Oct 23, 2024 · 14 comments · Fixed by #23
Assignees
Labels

Comments

@zintarh
Copy link
Contributor

zintarh commented Oct 23, 2024

This issues is part of ODHACK 9.0, apply via the platform

Thank you for showing interest!

Ensure that relevant data is captured in the events

Depends on #3

Please ensure to provide an ETA.

Looking forward to seeing your great work!

@CollinsC1O
Copy link

CollinsC1O commented Oct 23, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello I'm a front-end and a blockchain developer. I will love to work on this issue

How I plan on tackling this issue

Here below are the steps I intend to use in other to solve this issue:

  • I will start by examining the current implementation of the verify_product() function to understand its structure and logic.
  • I will identify the key pieces of data that need to be captured when verify_product() is called. This could include product ID, verification status, timestamps, and any other pertinent information.
  • I will define the events in the appropriate contract file, ensuring that the event signatures reflect the data I plan to emit.
  • I will update the verify_product() function to include calls to emit the newly defined events at relevant points in the logic flow.
  • I will write unit tests to verify that the events are emitted correctly under different scenarios (e.g., successful verification, failed verification).
  • Since this task depends on issue Upgrade Contracts to Cairo 2.8.4  #3, I will ensure that it is resolved and integrated before finalizing my implementation.
    ETA: 24hrs. once issue Upgrade Contracts to Cairo 2.8.4  #3 has been solved

@MullerTheScientist
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a full-stack developer with experience in QA testing and languages like Python, Cairo, Solidity, React, and JavaScript.

How I plan on tackling this issue

i will Add event emission to the verify_product() function.
Create a new ProductVerified event instance with the relevant data.

@ptisserand
Copy link
Contributor

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm a senior cairo developer with strong experience in Starknet ecosystem (since cairo 0). I have contributed to several projects on Only Dust writing smart contract code or rust backend.

How I plan on tackling this issue

After added event struct definition in smart contract, I will ensure that events are emitted through starknet foundry tests
ETA: 0.5 day

@No-bodyq
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a web3 dev with experience writing smart contracts in cairo: Here is my onlydust Profile: https://app.onlydust.com/u/No-bodyq

How I plan on tackling this issue

I will create a struct that derives from the starknet event trait and add the data fields to be be emitted with the event, add the event to an event enum then ensure it is properly emitted when the function is called
ETA: < 1 day

@Pvsaint
Copy link

Pvsaint commented Oct 24, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm Victor Peter, a front-end and smart contract developer with about 3 years experience in react

How I plan on tackling this issue

I'll need to define the event that will be emitted when the verify_product() function is called. This can be done using the events property in the smart contract.
Then I need to create a function that will emit the event when the verify_product() function is called. This can be done using the emit keyword in the smart contract.
Finally, I need to call the function that emits the event when the verify_product() function is called.

@manlikeHB
Copy link
Contributor

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 create the function with the expected functionality and full test coverage.
ETA- 2days

@ptisserand
Copy link
Contributor

ptisserand commented Oct 24, 2024

Hi @zintarh I think there is a dependency between this issue and #3 , I'm not sure but I think they are breaking changes for event testing between starknet-foundry 0.25.0 and 0.32.0

@saimeunt
Copy link

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 Starknet event and will make sure to emit it correctly where it is required.

ETA 1 day.

@ShantelPeters
Copy link
Contributor

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

i am frontend developer ,Given my experience with smart contract development and event handling, I am well-equipped to implement these changes effectively

How I plan on tackling this issue

To address the issue of ensuring that relevant data is captured in the events, I would first review the current event emission functionality within the codebase to identify where improvements can be made. I would then determine the specific data attributes that are necessary for each event based on the project requirements and ensure they are included in the event struct.

Next, I would implement the changes needed to capture this data during the event emission process. After that, I would write comprehensive unit tests to validate that the events are emitted with the correct data and that all relevant scenarios are covered.
I anticipate completing this task within [3 to 5 working days based on your assessment].

@jsanchez556
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello, I’m Jose Mario from Costa Rica. With over 15 years of experience in development, I am passionate about contributing to open-source projects and currently expanding my skill set with Rust, Cairo, and Solidity, participated in ODHacks since 7.0 as part of my involvement with Dojo Coding. I am eager to apply my extensive experience and newly acquired skills to new challenges and innovative projects.

How I plan on tackling this issue

  1. Define a new event that will be emitted when a product is verified. This should be done within the Product module(onchain/src/product/product.cairo)
  2. Modify the verify function to emit the ProductVerified event when a product is verified successfully.

@aniruddhaaps
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

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

@suhas-sensei
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

i am a blockchain dev and have prior experience in cairo

How I plan on tackling this issue

i will upgrade Contracts to Cairo 2.8.4 as requested.

@EjembiEmmanuel
Copy link
Collaborator

@manlikeHB I've assigned you. This issue depends on #3, so you can begin work as soon as it is completed.

@EjembiEmmanuel
Copy link
Collaborator

@manlikeHB this issue is now open as #3has been completed.

@EjembiEmmanuel EjembiEmmanuel changed the title Create and emit events for verify_product() Create and emit events for verify() Oct 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.