Add missing events for admin functions and pool operations#233
Conversation
- Updated `starknet-foundry` version from 0.40.0 to 0.46.0 in `.tool-versions`. - Updated `snforge_scarb_plugin` and `snforge_std` versions to 0.46.0 in `Scarb.lock` and `Scarb.toml`. - Added new events for contract management and pool lifecycle in `predifi.cairo` and `events.cairo`. - Refactored event emission logic to include new events such as `ContractPaused`, `ContractUnpaused`, `PoolCreated`, and `ValidatorConfirmationsUpdated`. - Updated integration tests to validate new event emissions and refactored user address constants for better readability.
- Fix validator reference in validator removal test - Update upgrade test to handle multiple events (OZ + custom) - Ensure all tests pass (124/124)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Akshola00
left a comment
There was a problem hiding this comment.
revert the unnecessary changes, emit all events, delete the test event file and test event inside function and we should be good to go. thanks for your contribution
…d move helper functions to test_utils.cairo
- Removed obsolete events: `ContractUpgraded` and `DisputeThresholdUpdated`. - Added new event emissions for `PoolCreationFeeCollected`, `CreatorFeesCollected`, and `ValidatorFeesDistributed`. - Updated event documentation and logic to enhance clarity and maintainability.
- Introduced a new method to retrieve the pool creator when collecting creator fees. - Updated event emission to use the retrieved creator instead of the pool's creator property.
- Updated `collect_pool_creation_fee` method to include `pool_id` as a parameter. - Adjusted fee collection logic to emit the pool ID during fee collection. - Modified tests to reflect the new method signature and ensure correct fee collection behavior.
- Streamlined event emission syntax for better readability and consistency. - Ensured all event emissions follow a uniform structure across the contract. - Minor adjustments to spacing for improved code clarity.
|
fixed @Akshola00 :) |
Akshola00
left a comment
There was a problem hiding this comment.
great work @wayzeek this implmentation and emission of event looks great
only that you removed the test completely
pls add the tests for these events as describe in previous review so we can assert that these events were emitted and we should be good to go
|
@wayzeek any updates on adding the tests back |
|
@Akshola00 still on it, shouldn't take long though |
- Added tests for new events: `ContractPaused`, `ContractUnpaused`, `DisputeRaised`, and `BetPlaced`. - Improved existing tests to verify event emissions for various contract actions, including pool creation and validator actions. - Streamlined event spy setup across multiple test cases for consistency.
|
@Akshola00 just pushed, please let me know if you need more changes :) |
|
@wayzeek pls resolve changes and format |
|
fixed @Akshola00 :) |
|
bump @Akshola00 |
|
@wayzeek thanks for your contribution |
Summary
Closes #214
Fixed missing event emissions for critical admin functions and enhanced event coverage throughout the contract.
Changes Made
ValidatorConfirmationsUpdatedevent forset_required_validator_confirmationsfunctionContractPaused,ContractUnpaused,ContractUpgradedValidatorAdded,ValidatorRemoved#[key]attributes for efficient frontend filteringTesting
This ensures full transparency and auditability of all state-changing operations in the contract.