mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2024-12-25 07:19:29 -05:00
2.0 KiB
2.0 KiB
How to add and test new gRPC API functions in Haveno
- Follow instructions to run Haveno's existing API tests successfully.
- Define the new service or message in Haveno's protobuf definition.
- Clean and build Haveno after modifying the protobuf definition:
make clean && make
- Implement the new service in Haveno's backend, following existing patterns.
For example, the gRPC function to get offers is implemented byGrpcServer
>GrpcOffersService.getOffers(...)
>CoreApi.getOffers(...)
>CoreOffersService.getOffers(...)
>OfferBookService.getOffers()
. - Build Haveno:
make
- Follow instructions to update the protobuf client in haveno-ui-poc.
- Add the corresponding typescript method(s) to HavenoDaemon.tsx with clear and concise documentation.
- Add clean and comprehensive tests to HavenoDaemon.test.tsx, following existing patterns.
- Verify the tests with
npm run test -- -t 'my test'
to run tests by name andnpm test
to run all tests together. - Open a pull request for review.