Skip to content

Commit 9496b90

Browse files
committed
extension_nft, reference doc: final AccountConstraints straggler and em-dash sweep
https://claude.ai/code/session_01VPj6WLMxD5KL6NwvUvuz1K
1 parent f0e332e commit 9496b90

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

.reference/ANCHOR-1.0-MIGRATION.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
### Cargo.toml
66
- Change `anchor-lang = "0.32.1"``anchor-lang = "1.0.0"`
77
- Change `anchor-lang = { version = "0.32.1", ... }``anchor-lang = { version = "1.0.0", ... }`
8-
- Same for `anchor-spl` if present change to `1.0.0`
9-
- Add comment: `# Anchor 1.0.0 pin to RC until stable release`
8+
- Same for `anchor-spl` if present - change to `1.0.0`
9+
- Add comment: `# Anchor 1.0.0 - pin to RC until stable release`
1010
- **REMOVE `interface-instructions` feature** if present (removed in Anchor 1.0). This affects transfer-hook projects.
1111
- Keep all other features as-is (`idl-build`, `init-if-needed`, `cpi`, etc.)
1212

@@ -37,5 +37,5 @@
3737
### interface-instructions removal (transfer-hook projects)
3838
For projects that had `features = ["interface-instructions"]`:
3939
- Remove that feature from Cargo.toml
40-
- The `#[interface]` attribute is removed check if the program source uses it
40+
- The `#[interface]` attribute is removed - check if the program source uses it
4141
- If it does, this needs manual intervention to refactor

tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/programs/extension_nft/src/instructions/chop_tree.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ use anchor_spl::token_2022_extensions::spl_token_metadata_interface;
77
use anchor_spl::token_interface::{spl_token_2022, Token2022};
88
use session_keys::{Session, SessionToken};
99

10-
pub fn chop_tree(context: Context<ChopTree>, counter: u16, amount: u64) -> Result<()> {
10+
pub fn chop_tree(context: Context<ChopTreeAccountConstraints>, counter: u16, amount: u64) -> Result<()> {
1111
// Save game_data bump on first creation (init_if_needed). See init_player.rs
1212
// for the same pattern.
1313
let game_data_bump = context.bumps.game_data;
14-
let account: &mut ChopTree<'_> = context.accounts;
14+
let account: &mut ChopTreeAccountConstraints<'_> = context.accounts;
1515
account.player.update_energy()?;
1616
account.player.print()?;
1717

@@ -59,7 +59,7 @@ pub fn chop_tree(context: Context<ChopTree>, counter: u16, amount: u64) -> Resul
5959

6060
#[derive(Accounts, Session)]
6161
#[instruction(level_seed: String)]
62-
pub struct ChopTree<'info> {
62+
pub struct ChopTreeAccountConstraints<'info> {
6363
#[session(
6464
// The ephemeral key pair signing the transaction
6565
signer = signer,

tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/programs/extension_nft/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub mod extension_nft {
3939
ctx.accounts.player.authority.key() == ctx.accounts.signer.key(),
4040
GameErrorCode::WrongAuthority
4141
)]
42-
pub fn chop_tree(ctx: Context<ChopTree>, _level_seed: String, counter: u16) -> Result<()> {
42+
pub fn chop_tree(ctx: Context<ChopTreeAccountConstraints>, _level_seed: String, counter: u16) -> Result<()> {
4343
chop_tree::chop_tree(ctx, counter, 1)
4444
}
4545

tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/programs/extension_nft/tests/test_extension_nft.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fn mint_nft_ix(program_id: &Pubkey, signer: &Pubkey, mint: &Pubkey) -> Instructi
114114
fn chop_tree_ix(program_id: &Pubkey, signer: &Pubkey, mint: &Pubkey, counter: u16) -> Instruction {
115115
Instruction {
116116
program_id: *program_id,
117-
accounts: extension_nft::accounts::ChopTree {
117+
accounts: extension_nft::accounts::ChopTreeAccountConstraints {
118118
// session_token is optional; pass None -> the macro falls back to
119119
// the main-wallet authority check.
120120
session_token: None,

0 commit comments

Comments
 (0)