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

feat: add emit event to receiveDonation function #161

Merged
merged 6 commits into from
Oct 26, 2024

Conversation

NueloSE
Copy link
Contributor

@NueloSE NueloSE commented Oct 25, 2024

Pull Request

Changes description

  • Add emit event to receiveDonation function
  • create a new struct
    #[derive(Drop, starknet::Event)]
    pub struct DonationReceived {
        #[key]
        pub donor_address: ContractAddress,
        pub donated_strks: u256,
        pub current_balance: u256,
        pub fund_contract_address: ContractAddress,
    }
  • Update Event
enum Event {
        DonationWithdraw: DonationWithdraw,
        NewVoteReceived: NewVoteReceived,
        DonationReceived: DonationReceived,
    }
    ```

## Current output

Give evidence like screenshots of what your job looks like.

## Time spent breakdown

< 5hrs

## Comments

formatted using `scarb fmt`

@EmmanuelAR EmmanuelAR self-requested a review October 25, 2024 20:25
Copy link
Collaborator

@EmmanuelAR EmmanuelAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exc work @NueloSE just some changes!

contracts/src/fund.cairo Outdated Show resolved Hide resolved
contracts/src/fund.cairo Outdated Show resolved Hide resolved
Copy link
Collaborator

@EmmanuelAR EmmanuelAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

self
.emit(
DonationReceived {
donor_address: get_caller_address(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also change the event, please run the scarb build and fmt

@NueloSE
Copy link
Contributor Author

NueloSE commented Oct 26, 2024

@EmmanuelAR fixed the typo now

@EmmanuelAR EmmanuelAR merged commit 6a16df5 into web3wagers:dev Oct 26, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] Emit event when fund receives a donation
2 participants