feat: implemented useValidatorCheck and useManuallyUpdatePoolStatus h…#74
Conversation
|
@zachyo can you do a video showcasing how it works |
|
Created mock UI to test the manually_update_pool_state functionality since my wallet doesn't have validator/admin permissions on the contract. The "Caller not authorized" error prevents testing the actual transaction flow, so this mock implementation allows us to verify the frontend integration, parameter serialization, and UI interactions work correctly. This bypasses the contract's access control to demonstrate how the feature would work for authorized users. The enum serialization and CallData compilation have been tested and should work properly once authorized with proper permissions. Remember to connect with a validator wallet to see button. Adding video demo to show the complete flow and UI behavior.
|
|
@zachyo kindly fix conflict |
|
Conflict fixed @martinvibes |
|
@zachyo pls check your TG |
|
Lgtm |

Add Manual Pool State Management and Validator Authentication
Overview
This pull request introduces administrative functionality for manual pool state management and validator authentication within the Predifi application. The changes enable authorized validators to manually update pool states when necessary, providing essential administrative control over pool lifecycle management. Closes #69
Changes Made
New Hooks Added
1.
useManuallyUpdatePoolStateHooksrc/app/hooks/useManuallyUpdatePoolState.ts2.
useValidatorCheckHooksrc/app/hooks/useValidatorCheck.tsConstants Update
src/constants/functionNames.tsMANUALLY_UPDATE_POOL_STATEconstant for consistent function name usageTechnical Implementation
Pool State Management
The
updatePoolStatefunction handles the complete workflow:Validator Authentication
The validator check hook integrates with the smart contract's
is_validatorfunction to determine user permissions, enabling conditional rendering of administrative features.Error Handling
Both hooks implement comprehensive error handling:
Dependencies
This implementation relies on:
@starknet-react/corefor blockchain interactionsstarknetlibrary for Cairo utilitiesreact-hot-toastfor user notificationsBreaking Changes
None. This is an additive change that extends existing functionality without modifying current interfaces.