You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for the [`gen_discriminator` method here](https://github.com/coral-xyz/anchor/blob/0e5285aecdf410fa0779b7cd09a47f235882c156/lang/syn/src/codegen/program/common.rs#L21-L24),
The key functionalities of the `#[account]` macro include:
364
364
365
-
-[Assign Program Owner](https://github.com/coral-xyz/anchor/blob/v0.30.1/lang/attribute/account/src/lib.rs#L119-L132):
365
+
-[Assign Program Owner](https://github.com/coral-xyz/anchor/blob/0e5285aecdf410fa0779b7cd09a47f235882c156/lang/attribute/account/src/lib.rs#L130-L143):
366
366
When creating an account, the program owner of the account is automatically
A unique 8 byte discriminator, specific to the account type, is added as the
370
370
first 8 bytes of account data during its initialization. This helps in
371
371
differentiating account types and is used for account validation.
372
-
-[Data Serialization and Deserialization](https://github.com/coral-xyz/anchor/blob/v0.30.1/lang/attribute/account/src/lib.rs#L202-L246):
372
+
-[Data Serialization and Deserialization](https://github.com/coral-xyz/anchor/blob/0e5285aecdf410fa0779b7cd09a47f235882c156/lang/attribute/account/src/lib.rs#L224-L270):
373
373
Account data is automatically serialized and deserialized as the account type.
374
374
375
375
```rust title="lib.rs"
@@ -411,7 +411,7 @@ pub struct NewAccount {
411
411
An account discriminator in an Anchor program refers to an 8 byte identifier
412
412
unique to each account type. You can find the implementation of the account
[sends a signed transaction](https://github.com/coral-xyz/anchor/blob/v0.30.1/ts/packages/anchor/src/program/namespace/rpc.ts#L29)
221
+
[sends a signed transaction](https://github.com/coral-xyz/anchor/blob/0e5285aecdf410fa0779b7cd09a47f235882c156/ts/packages/anchor/src/program/namespace/rpc.ts#L29)
222
222
with the specified instruction and returns a `TransactionSignature`.
223
223
224
224
When using `.rpc`, the `Wallet` from the `Provider` is automatically included as
[builds a `Transaction`](https://github.com/coral-xyz/anchor/blob/v0.30.1/ts/packages/anchor/src/program/namespace/transaction.ts#L18-L26)
251
+
[builds a `Transaction`](https://github.com/coral-xyz/anchor/blob/0e5285aecdf410fa0779b7cd09a47f235882c156/ts/packages/anchor/src/program/namespace/transaction.ts#L18-L26)
252
252
with the specified instruction without sending the transaction.
[builds a `TransactionInstruction`](https://github.com/coral-xyz/anchor/blob/v0.30.1/ts/packages/anchor/src/program/namespace/instruction.ts#L57-L61)
282
+
[builds a `TransactionInstruction`](https://github.com/coral-xyz/anchor/blob/0e5285aecdf410fa0779b7cd09a47f235882c156/ts/packages/anchor/src/program/namespace/instruction.ts#L57-L61)
283
283
using the specified instruction. This is useful if you want to manually add the
284
284
instruction to a transaction and combine it with other instructions.
0 commit comments