Skip to content

fix: token decimals constant, storage size counter, snapshot docs, and SDK API (#483, #484, #485, #486) - #659

Merged
DeFiVC merged 1 commit into
ChainLearnOfficial:mainfrom
Prudentdev-xyz:fix/issues-483-484-485-486
Oct 19, 2026
Merged

DeFiVC merged 1 commit into
ChainLearnOfficial:mainfrom
Prudentdev-xyz:fix/issues-483-484-485-486

Conversation

@Prudentdev-xyz

Copy link
Copy Markdown

Summary of Changes

  • README claims TOKEN_DECIMALS constant exists in shared package but it does not #483: Added TOKEN_DECIMALS: u32 = 7 constant to packages/shared/src/constants.rs, re-exported it in contracts/learn-token, used it in learn-token test initialization, and updated documentation in README.md and docs/architecture.md.
  • Integration guide uses non-existent Soroban SDK API (env.events().subscribe) #484: Replaced non-existent env.events().subscribe() example in docs/integration-guide.md with standard env.events().all() test pattern and off-chain RPC event query guidance. Updated docs/deployment-guide.md to use --rpc-url and --network-passphrase CLI flags instead of deprecated --network testnet. Corrected the #[should_panic] assertion pattern in docs/testing-guide.md to match actual test error strings.
  • snapshot() only emits event but does not record any balance data #485: Clarified snapshot workflow and documented SnapshotBalance in docs/architecture.md storage layout, reflecting that snapshot() serves as an announcement marker while balances are recorded per address with record_balance_snapshot().
  • update_course_version and transfer_admin bypass write_entry, corrupting storage size counter #486: Replaced raw persistent storage .set() and .remove() calls with types::write_entry() / types::remove_entry() (in progress-tracker) and metadata::write_entry() / metadata::remove_entry() (in credential-nft) in update_course_version, earn_achievement, batch_submit_quiz_score, complete_module, batch_complete_module, and admin transfer handlers, ensuring get_storage_size() accurately tracks persistent storage entries without counter drift. Added storage size tracking tests for both contracts.

Closes #483
Closes #484
Closes #485
Closes #486

…hainLearnOfficial#485, ChainLearnOfficial#486

- ChainLearnOfficial#483: add TOKEN_DECIMALS constant to chainlearn-shared package and use in learn-token
- ChainLearnOfficial#484: correct docs for event monitoring, deployment CLI flags, and test should_panic pattern
- ChainLearnOfficial#485: clarify snapshot markers and document snapshot balances in architecture storage layout
- ChainLearnOfficial#486: route all persistent storage writes/removals through write_entry/remove_entry helpers to maintain storage size accuracy
@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@Prudentdev-xyz Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants