Context
The frontend and backend need to list all requests created by a given payee. Currently there is only get_request(id); callers would have to scan all ids.
Acceptance criteria
- Add
requests_by_payee(payee: Address) -> Vec<u64> returning request ids where payee == payee.
- Maintain the id list in storage, appending on
create_request.
- Covered by a unit test that creates two requests for the same payee and asserts both ids are returned.
Technical notes
- Store a
Vec<u64> of all ids under an instance key (sufficient for MVP).
- Mind instance storage rent if the list grows large;
persistent is an alternative.
Testing
make test green; make lint clean.
Context
The frontend and backend need to list all requests created by a given payee. Currently there is only
get_request(id); callers would have to scan all ids.Acceptance criteria
requests_by_payee(payee: Address) -> Vec<u64>returning request ids wherepayee == payee.create_request.Technical notes
Vec<u64>of all ids under aninstancekey (sufficient for MVP).persistentis an alternative.Testing
make testgreen;make lintclean.