Skip to content

Commit 4b110ed

Browse files
Fix transfer-sol: use crate::ID instead of id() in instruction module
When instruction handlers were extracted from lib.rs into their own files, the id() function (which refers to declare_id!()) is no longer in scope. Use crate::ID to reference the program ID from a nested module.
1 parent c6289df commit 4b110ed

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

basics/transfer-sol/anchor/programs/transfer-sol/src/instructions/transfer_sol_with_program.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub struct TransferSolWithProgram<'info> {
55
/// CHECK: Use owner constraint to check account is owned by our program
66
#[account(
77
mut,
8-
owner = id() // value of declare_id!()
8+
owner = crate::ID // value of declare_id!()
99
)]
1010
payer: UncheckedAccount<'info>,
1111
#[account(mut)]

0 commit comments

Comments
 (0)