Skip to content

fix: correct FreezeType panic typo and add tests#1727

Merged
Dosik13 merged 2 commits into
hiero-ledger:mainfrom
peter941221:issue/hiero-sdk-go-1709
May 20, 2026
Merged

fix: correct FreezeType panic typo and add tests#1727
Dosik13 merged 2 commits into
hiero-ledger:mainfrom
peter941221:issue/hiero-sdk-go-1709

Conversation

@peter941221

@peter941221 peter941221 commented May 19, 2026

Copy link
Copy Markdown
Contributor
  1. Outcome

This PR fixes the FreezeType.String() panic typo and adds focused unit coverage for the defined enum values.

Closes #1709.

  1. Summary

2.1 sdk/freeze_type.go

Change unreacahble to unreachable in the panic message.

2.2 sdk/freeze_type_unit_test.go

Add 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.

  1. Validation

3.1 gofmt -w sdk/freeze_type.go sdk/freeze_type_unit_test.go

3.2 go test ./sdk -tags="unit" -v -run TestUnitFreezeTypeString -timeout 9999s

3.3 go build ./...

3.4 golangci-lint run

3.5 go test ./sdk -tags="unit" -v -timeout 9999s

This 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.1 from proxy.golang.org, so the broader local validation was run against a temporary offline modfile pinned to the already cached google.golang.org/grpc v1.81.0.

The temporary validation files were removed after verification, and this PR does not change dependency versions.

Signed-off-by: peter941221 <peter941221@gmail.com>
@peter941221 peter941221 requested review from a team as code owners May 19, 2026 09:23
@lfdt-bot

lfdt-bot commented May 19, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
sdk/freeze_type.go 100.00% <100.00%> (+100.00%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread sdk/freeze_type_unit_test.go Outdated
@Dosik13

Dosik13 commented May 19, 2026

Copy link
Copy Markdown
Contributor

can you sign the commit, please

Signed-off-by: peter941221 <peter941221@gmail.com>
@peter941221 peter941221 force-pushed the issue/hiero-sdk-go-1709 branch from 80085be to cf5e4e5 Compare May 19, 2026 12:44
@peter941221

Copy link
Copy Markdown
Contributor Author

@Dosik13 Signed off and force-pushed. Thanks.

@Dosik13 Dosik13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! thank you!

@Dosik13 Dosik13 merged commit b88cc8a into hiero-ledger:main May 20, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Good First Issue]: Fix typo in FreezeType.String() panic message and add tests for all enum values

3 participants