I looked at the code generated by the #[derive(Accounts)]
macro from your example and I think the problem is that Anchor doesn't treat the case where you're using an Accounts
item defined in a different file. It forgets to append crate::
when using the generated modules for that item.
To confirm this, if you add this line to your test.rs
file, your code will compile fine:
use crate::{__client_accounts_test_common, __cpi_client_accounts_test_common};
The solutionsolutions I can recommend is to define TestCommon
in the same file as Test
.:
- define
TestCommon
in the same file asTest
- or import everything from
test_common
not justTestCommon
, so you'd use:use super::test_common::*;