spv-wallet icon indicating copy to clipboard operation
spv-wallet copied to clipboard

feat(SPV-1085) merkle roots verifier

Open chris-4chain opened this issue 4 months ago • 3 comments

AI generated summary

BHS Integration:

  • config/check_block_header_service.go: Updated imports and response models to use chainmodels instead of chainstate for BHS integration. [1] [2]
  • config/services.go: Added BHS configuration options to the loadSPVWallet function.
  • engine/chain/chain_service.go: Added BHS service to the chainService struct and updated the NewChainService function to include BHS configuration.

Error Handling:

  • engine/chain/errors/bhs_errors.go: Introduced new error types specific to BHS, such as ErrBHSUnreachable, ErrBHSNoSuccessResponse, ErrBHSUnauthorized, ErrBHSBadRequest, and ErrBHSUnhealthy.

Interface Updates:

  • engine/chain/interface.go: Added BHSService interface and included it in the main Service interface.

Tests and Mocking:

  • engine/chain/internal/bhs/bhs_mock_test.go: Added mock tests for BHS verification.
  • engine/chain/internal/bhs/healthcheck_test.go: Added tests for BHS health checks.

These changes ensure that the Block Header Service is properly integrated and that the system can handle various BHS-related errors effectively.

Pull Request Checklist

  • [ ] 📖 I created my PR using provided : CODE_STANDARDS
  • [ ] 📖 I have read the short Code of Conduct: CODE_OF_CONDUCT
  • [ ] 🏠 I tested my changes locally.
  • [ ] ✅ I have provided tests for my changes.
  • [ ] 📝 I have used conventional commits.
  • [ ] 📗 I have updated any related documentation.
  • [ ] 💾 PR was issued based on the Github or Jira issue.

chris-4chain avatar Oct 04 '24 13:10 chris-4chain