Closed esolskjaer closed 1 month ago
This could happen if you use different versions of anchor-client
and anchor-lang
, otherwise it should resolve to the same type since anchor-client
just re-exports anchor-lang
:
Wow, I could've sworn I was using the same version for both, but turns out I wasn't. Thanks for the quick answer & sorry about this stupid question 🫠
I tried to create a transaction using
declare_program!
for accounts and args andanchor_client
for building the transaction:This unfortunately doesn't build, with the following error
If I do
cargo expand
, I can also see why:declare_program!
generates an impl foranchor_lang::ToAccountMetas
, but not foranchor_client::anchor_lang::ToAccountMetas
even though these two are the exact same in practice.I've tried switching my import at the top to
use anchor_client::anchor_lang::declare_program;
but it still gives the same error. Any idea on how to fix this?