fix: correct FreezeType panic typo and add tests#1727
Merged
Conversation
Signed-off-by: peter941221 <peter941221@gmail.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
15 tasks
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
Dosik13
reviewed
May 19, 2026
Contributor
|
can you sign the commit, please |
Signed-off-by: peter941221 <peter941221@gmail.com>
80085be to
cf5e4e5
Compare
Contributor
Author
|
@Dosik13 Signed off and force-pushed. Thanks. |
5 tasks
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.
This PR fixes the
FreezeType.String()panic typo and adds focused unit coverage for the defined enum values.Closes #1709.
2.1
sdk/freeze_type.goChange
unreacahbletounreachablein the panic message.2.2
sdk/freeze_type_unit_test.goAdd table-driven coverage for all defined
FreezeType.String()outputs.Add one focused assertion that unknown values still panic, so this PR stays within the current behavior contract instead of changing fallback semantics.
3.1
gofmt -w sdk/freeze_type.go sdk/freeze_type_unit_test.go3.2
go test ./sdk -tags="unit" -v -run TestUnitFreezeTypeString -timeout 9999s3.3
go build ./...3.4
golangci-lint run3.5
go test ./sdk -tags="unit" -v -timeout 9999sThis full suite still hits the pre-existing concurrent network panic in
sdk/network_unit_test.go, so it is not clean on my machine even though the FreezeType-focused coverage passes.3.6 Local environment note
This Windows host could not fetch
google.golang.org/grpc v1.81.1fromproxy.golang.org, so the broader local validation was run against a temporary offline modfile pinned to the already cachedgoogle.golang.org/grpc v1.81.0.The temporary validation files were removed after verification, and this PR does not change dependency versions.