I have Program A. It makes a CPI call to Program B via invoke_signed.
User makes a call to the Program A. These accounts will be passed to the Program B:
- token_program: AccountInfo<'a>
- source: AccountInfo<'a>
- destination: AccountInfo<'a>
- authority: AccountInfo<'a>
Then, I want Program B to make another CPI call to Program C. On behalf and using seeds of the Program A
So, the problem is - how do I pass the Program C account_info? The first thought was - can I hardcode it? like:
let program_c = Pubkey::from_str("PubKEyHere111111...")
But... I'm not allowed to 'hardcode' it in Program B. There is no way to convert PubKey to account_info. Because that's how the
Solana Runtime works - you should pass all the Account_Metas beforehand. But, is it still a way to do that except passing it explicitly to the Program A?