docs: Replace `ProgramAccount` with `Account` (#758)
This commit is contained in:
parent
beace2c000
commit
4a91606895
|
@ -35,8 +35,7 @@ Additionally,
|
||||||
notice how we take a mutable reference to `my_account` and assign the `data` to it. This leads us to
|
notice how we take a mutable reference to `my_account` and assign the `data` to it. This leads us to
|
||||||
the `Initialize` struct, deriving `Accounts`. There are two things to notice about `Initialize`.
|
the `Initialize` struct, deriving `Accounts`. There are two things to notice about `Initialize`.
|
||||||
|
|
||||||
1. The `my_account` field is of type `ProgramAccount<'info, MyAccount>`, telling the program it *must*
|
1. The `my_account` field is of type `Account<'info, MyAccount>` and the deserialized data structure is `MyAccount`.
|
||||||
be **owned** by the currently executing program, and the deserialized data structure is `MyAccount`.
|
|
||||||
2. The `my_account` field is marked with the `init` attribute. This will create a new
|
2. The `my_account` field is marked with the `init` attribute. This will create a new
|
||||||
account owned by the current program, zero initialized. When using `init`, one must also provide
|
account owned by the current program, zero initialized. When using `init`, one must also provide
|
||||||
`payer`, which will fund the account creation, `space`, which defines how large the account should be,
|
`payer`, which will fund the account creation, `space`, which defines how large the account should be,
|
||||||
|
|
Loading…
Reference in New Issue