Conversation
Created new 'StateHash' structure because 'proto.StateHash' now is an interface. Tests added.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the codebase to work with the bumped github.com/wavesplatform/gowaves dependency by moving state-hash handling from gowaves/pkg/proto into a local entities.StateHash type with compatible JSON encoding.
Changes:
- Bump
github.com/wavesplatform/gowavestov0.11.1and refresh indirect deps ingo.mod/go.sum. - Introduce
entities.StateHashwith custom JSON marshal/unmarshal (keysblockId/stateHash) and migrate usages fromproto.StateHash. - Update scraper, storage, API parsing, alert structures, and tests to use
entities.StateHash.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/storing/events/events_test.go | Update tests to build/compare entities.StateHash instead of proto.StateHash. |
| pkg/storing/events/events.go | Change StateHashAtHeight return type to entities.StateHash and drop proto import. |
| pkg/scraping/client.go | Convert debug state-hash response into entities.StateHash. |
| pkg/messaging/pair/responses.go | Switch response DTO field type to *entities.StateHash. |
| pkg/entities/statements_test.go | Add JSON compatibility tests for entities.StateHash vs gowaves state-hash JSON. |
| pkg/entities/statements.go | Add entities.StateHash type + JSON marshal/unmarshal; update NodeStatement.StateHash type. |
| pkg/entities/events.go | Update StateHashEvent to store/return *entities.StateHash. |
| pkg/entities/alerts_test.go | Add JSON round-trip test for empty StateHashAlert. |
| pkg/entities/alerts.go | Replace proto.StateHash with entities.StateHash in state-hash alert payloads. |
| pkg/api/api.go | Parse incoming state hash into *entities.StateHash and pass into events. |
| pkg/analysis/finders/fork_finder_test.go | Update finder tests to use entities.StateHash. |
| pkg/analysis/finders/fork_finder.go | Change state-hash finder APIs to return entities.StateHash. |
| pkg/analysis/criteria/state_hash_test.go | Update criterion tests to use entities.StateHash. |
| pkg/analysis/criteria/base_target_test.go | Update test struct field type to *entities.StateHash. |
| pkg/analysis/analyzer_test.go | Update analyzer tests to use entities.StateHash. |
| cmd/bots/internal/bots/templates_internal_test.go | Update template tests to use entities.StateHash. |
| go.mod | Bump gowaves + adjust indirect requirements. |
| go.sum | Update sums for bumped/added dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alexeykiselev
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.