fix and improve closing-accounts course #532
Closed
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.
Problem
Use InitSpace to calculate space needed for accounts.
Delete "force_defund" because “CLOSED_ACCOUNT_DISCRIMINATOR” was removed in the latest version of anchor-lang
Add the new secure instruction for account closing in the "Secure account closing" section .
Delete Unnecessary parameters found in the test typescript.
Change the Logic of account closing "Sets the account discriminator to the
CLOSED_ACCOUNT_DISCRIMINATOR
variant" to "Assigning the owner of the account to the System Program and rellocating thesize of the account's data with 0 bytes."
arbitrary-cpi.md
The anchor cpi lesson link is invalid.
Magic number found on space calculation.
Summary of Changes
Use InitSpace to calculate space needed for accounts.
Delete "force_defund" because “CLOSED_ACCOUNT_DISCRIMINATOR” was removed in the latest version of anchor-lang.
Add the new secure instruction for account closing in the "Secure account closing" section.
Change the Logic of closing account "Sets the account discriminator to the
CLOSED_ACCOUNT_DISCRIMINATOR
variant" to "Assigning the owner to the System Program".Also, I made a PR for solana-closing-accounts starter branch and a PR for solana-closing-accounts solution branch
which must be synced with this PR.
Fixes #