spv-wallet
spv-wallet copied to clipboard
feat(SPV-1085) merkle roots verifier
AI generated summary
BHS Integration:
-
config/check_block_header_service.go
: Updated imports and response models to usechainmodels
instead ofchainstate
for BHS integration. [1] [2] -
config/services.go
: Added BHS configuration options to theloadSPVWallet
function. -
engine/chain/chain_service.go
: Added BHS service to thechainService
struct and updated theNewChainService
function to include BHS configuration.
Error Handling:
-
engine/chain/errors/bhs_errors.go
: Introduced new error types specific to BHS, such asErrBHSUnreachable
,ErrBHSNoSuccessResponse
,ErrBHSUnauthorized
,ErrBHSBadRequest
, andErrBHSUnhealthy
.
Interface Updates:
-
engine/chain/interface.go
: AddedBHSService
interface and included it in the mainService
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.