Skip to content

fix(sdk): correct panic message in TokenSupplyType.String() and add unit test - #1756

Closed
AruneshDwivedi wants to merge 1 commit into
hiero-ledger:mainfrom
AruneshDwivedi:fix/token-supply-type-panic-message
Closed

fix(sdk): correct panic message in TokenSupplyType.String() and add unit test#1756
AruneshDwivedi wants to merge 1 commit into
hiero-ledger:mainfrom
AruneshDwivedi:fix/token-supply-type-panic-message

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

TokenSupplyType.String() panic message says TokenType.String() — copy-paste from token_type.go. Corrected to reference TokenSupplyType.

Table-driven test asserts the string mapping for both INFINITE and FINITE values.

…nit test

Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
@AruneshDwivedi
AruneshDwivedi requested review from a team as code owners June 29, 2026 12:26
@lfdt-bot

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 Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
sdk/token_supply_type.go 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
sdk/token_supply_type.go 85.71% <0.00%> (+28.57%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

for _, tt := range tests {
assert.Equal(t, tt.expected, tt.supplyType.String())
}
}

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.

Could you add a panic-path test? PanicsWithValue asserts the exact message, so it covers the branch actually changed and would've failed on the old TokenType.String() text.

@Dosik13

Dosik13 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Due to inactivity I am closing the PR.

@Dosik13 Dosik13 closed this Jul 9, 2026
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.

3 participants