Skip to content

fix(#183): update expected panic string in test_transfer_from_expired… - #185

Open
SHEROSE0 wants to merge 1 commit into
ChainLearnOfficial:mainfrom
SHEROSE0:fix/183-token-test-expired-allowance
Open

fix(#183): update expected panic string in test_transfer_from_expired…#185
SHEROSE0 wants to merge 1 commit into
ChainLearnOfficial:mainfrom
SHEROSE0:fix/183-token-test-expired-allowance

Conversation

@SHEROSE0

@SHEROSE0 SHEROSE0 commented Aug 5, 2026

Copy link
Copy Markdown

#closes #183

Summary

Fixes issue #183 by updating the incorrect expected panic string in the test_transfer_from_expired_allowance unit test under tests/unit/token_tests.rs.

Description

  • What changed: Updated the #[should_panic(expected = "...")] attribute from "allowance expired" to "insufficient allowance".
  • Why: When an expired allowance is used, the contract emits an allowance-expired event, but the execution proceeds to invoke get_allowance which returns 0, ultimately triggering an "insufficient allowance" panic. The previous expected string never matched, preventing the test from correctly validating the intended scenario.
  • Testing: Verified that the unit test now runs successfully and accurately catches the expected panic behavior.

Issue

#Closes

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.

Fix wrong expected panic string in token_tests.rs test_transfer_from_expired_allowance

1 participant