Background:
PetChainRegistry (celo-contracts/contracts/PetChainRegistry.sol) has no way to enumerate registered vets at all — vets is a mapping(address => Vet), so a caller must already know a vet's address to look them up; isVerifiedVet only answers yes/no for a known address.
Problem:
There is no on-chain or even reasonably-cheap-to-derive way to answer "show me all verified vets" without an off-chain indexer replaying every VetRegistered/VetVerified event from genesis.
What "done" looks like:
- An internal
address[] private _vetAddresses is appended to on registration, and a paginated getVets(uint256 offset, uint256 limit) view function returns Vet structs for that page.
- Tests cover pagination and an empty registry.
Implementation guidelines:
- Key file:
celo-contracts/contracts/PetChainRegistry.sol.
PR must include:
- New enumerable directory + paginated query
- Tests
- Passing Hardhat test run
Background:
PetChainRegistry(celo-contracts/contracts/PetChainRegistry.sol) has no way to enumerate registered vets at all —vetsis amapping(address => Vet), so a caller must already know a vet's address to look them up;isVerifiedVetonly answers yes/no for a known address.Problem:
There is no on-chain or even reasonably-cheap-to-derive way to answer "show me all verified vets" without an off-chain indexer replaying every
VetRegistered/VetVerifiedevent from genesis.What "done" looks like:
address[] private _vetAddressesis appended to on registration, and a paginatedgetVets(uint256 offset, uint256 limit)view function returnsVetstructs for that page.Implementation guidelines:
celo-contracts/contracts/PetChainRegistry.sol.PR must include: