Browse Source

Added README.md

ohaddahan 3 years ago
parent
commit
78819428a1
1 changed files with 12 additions and 0 deletions
  1. 12 0
      basics/destroy-an-account/anchor/destroy-an-account/README.md

+ 12 - 0
basics/destroy-an-account/anchor/destroy-an-account/README.md

@@ -0,0 +1,12 @@
+# Destroy an Account
+
+1. We're creating a `PDA` using [create_user.rs](programs/destroy-an-account/src/instructions/create_user.rs)
+   instruction.
+
+
+2. We're closing it using [destroy_user.rs](programs/destroy-an-account/src/instructions/destroy_user.rs)
+   instruction, which uses `Anchor` `AccoutClose` `trait`. 
+
+
+3. In our test [destroy-an-account.ts](tests/destroy-an-account.ts) we're using `fetchNullable` since we expect 
+   the account to be `null` prior to creation and after closing.