Open yourarj opened 2 years ago
Order of method args and instruction macro args should be the same.
for an eg.
#[instruction(arg1: u64)]
pub fn initialize(
ctx: Context<Initialize>,
arg1: u64,
arg2: Pubkey,
) -> Result<()> {.....}
the issue is yes it is. @0xdeepmehta please have a look at the referenced repo where I've reproduced the issue.
This is feature, not a bug 🐛.
I agree with point but the is reproducible when order is maintained.
Can you also please point me to the relevant docs also?
Creating PDA with one of seed as method argument. When the order of the arguments provided is reversed creation works fine but the other way around don't work.
and the method signature is
causes
but when parameter order is swapped of data_owner and seed_number. everything works fine.
reproduced with program here in repo https://github.com/yourarj/anchor-pda-account-creation-issue