Skip to content

Commit

Permalink
idl: Support PDA resolution of call expressions that don't have any a…
Browse files Browse the repository at this point in the history
…rguments
  • Loading branch information
acheroncrypto committed Jan 14, 2025
1 parent db6da5c commit 9b6b557
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lang/syn/src/idl/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,14 @@ fn parse_seed(seed: &syn::Expr, accounts: &AccountsStruct) -> Result<TokenStream
})
}
}
// Support call expressions that don't have any arguments e.g. `System::id()`
syn::Expr::Call(call) if call.args.is_empty() => Ok(quote! {
#idl::IdlSeed::Const(
#idl::IdlSeedConst {
value: AsRef::<[u8]>::as_ref(&#seed).into(),
}
)
}),
syn::Expr::Path(path) => {
let seed = path
.path
Expand Down

0 comments on commit 9b6b557

Please sign in to comment.