its trait bounds were not satisfied label: method `serialize` not found for this struct

156 Views Asked by At

I'm trying to save AccountInfo in a struct that #[derive(BorshSerialize, BorshDeserialize, Clone, Debug)] to send SOL to this account. AccountInfo is a struct in library that don't impl serialize method. This account is randomly chosen from a map in contract so I cannot pass it into data to make instructions. This is the code:

#[derive(BorshSerialize, BorshDeserialize, Clone, Debug)]
pub struct State<'a> {
    pub owner: AccountInfo<'a>,
}
0

There are 0 best solutions below