I'm getting this error
Error: Invalid option endTime
at OptionLayout.decode (node_modules/@project-serum/borsh/src/index.ts:148:11)
at Structure.decode (node_modules/buffer-layout/lib/Layout.js:1234:32)
at Sequence.decode (node_modules/buffer-layout/lib/Layout.js:1090:34)
at Structure.decode (node_modules/buffer-layout/lib/Layout.js:1234:32)
while trying to use
console.log(await program.account.vester.fetch(vesterPda))
The program executes just fine .
here is the account struct
#[derive(Default,AnchorSerialize, AnchorDeserialize,Clone,Debug,Copy)]
pub struct Purchase {
purch_no: u16,
purchased_nodes: u16,
}
#[derive(AnchorSerialize, AnchorDeserialize,Clone,Debug,Copy)]
pub struct VestingInfo {
pk: Pubkey,
start_time: i64,
purchs: [Purchase;10],
end_time: Option<i64>,
cur_rate : u64,
metadata: Option<Pubkey>
}
//space : 4 + (32 + 8 + (4+(2+2)*10)+ 8) *15
#[account(zero_copy)]
pub struct Vester {
schedule : [VestingInfo;15]
}
the end_time
field is throwing error cuase it has Option
type.