Skip to content

Commit 74f1898

Browse files
committed
fix(lang): Exclude Signer accounts from duplicate mutable checks in account validation
1 parent bbff6e9 commit 74f1898

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lang/syn/src/codegen/accounts/try_accounts.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ fn is_init(af: &AccountField) -> bool {
219219

220220
// Generates duplicate mutable account validation logic
221221
fn generate_duplicate_mutable_checks(accs: &AccountsStruct) -> proc_macro2::TokenStream {
222-
// Collect all mutable account fields without `dup` constraint, excluding UncheckedAccount & init accounts.
222+
// Collect all mutable account fields without `dup` constraint, excluding UncheckedAccount, Signer, and init accounts.
223223
let candidates: Vec<_> = accs
224224
.fields
225225
.iter()
@@ -231,6 +231,7 @@ fn generate_duplicate_mutable_checks(accs: &AccountsStruct) -> proc_macro2::Toke
231231
{
232232
match &f.ty {
233233
crate::Ty::UncheckedAccount => None, // unchecked by design
234+
crate::Ty::Signer => None, // signers are excluded as they're typically payers
234235
_ => Some(f),
235236
}
236237
}

0 commit comments

Comments
 (0)