Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Client is_signer usage in to_account_metas #3322

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lang/syn/src/codegen/accounts/__client_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub fn generate(
AccountField::CompositeField(s) => {
let name = &s.ident;
quote! {
account_metas.extend(self.#name.to_account_metas(None));
account_metas.extend(self.#name.to_account_metas(is_signer));
}
}
AccountField::Field(f) => {
Expand All @@ -94,7 +94,7 @@ pub fn generate(
};
let is_signer = match is_signer {
false => quote! {false},
true => quote! {true},
true => quote! {is_signer.unwrap_or(true)},
};
let meta = match f.constraints.is_mutable() {
false => quote! { anchor_lang::solana_program::instruction::AccountMeta::new_readonly },
Expand Down
4 changes: 2 additions & 2 deletions lang/syn/src/codegen/accounts/__cpi_client_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub fn generate(
AccountField::CompositeField(s) => {
let name = &s.ident;
quote! {
account_metas.extend(self.#name.to_account_metas(None));
account_metas.extend(self.#name.to_account_metas(is_signer));
}
}
AccountField::Field(f) => {
Expand All @@ -95,7 +95,7 @@ pub fn generate(
};
let is_signer = match is_signer {
false => quote! {false},
true => quote! {true},
true => quote! {is_signer.unwrap_or(true)},
};
let meta = match f.constraints.is_mutable() {
false => quote! { anchor_lang::solana_program::instruction::AccountMeta::new_readonly },
Expand Down
Loading