Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix and improve closing-accounts course #532

Closed
wants to merge 3 commits into from

Conversation

wuuer
Copy link
Contributor

@wuuer wuuer commented Sep 27, 2024

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 the
size 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 #

Jeff Wood and others added 3 commits September 27, 2024 09:58
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".
@mikemaccana
Copy link
Contributor

Hi @wuuer you already won closing accounts with this PR - #372 - can you please update #372 (just remove the other lessons)?

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

Successfully merging this pull request may close these issues.

2 participants