coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.68k stars 1.35k forks source link

lang: split seeds and bump in `CpiContext::new_with_signer` #1244

Open paul-schaaf opened 2 years ago

paul-schaaf commented 2 years ago

In the accounts struct, we separate the normal seeds and the bump seed.

How about we adjust new_with_signer to take a struct

struct CpiSeeds {
seeds: the &[&[...][..]] type,
bump_seed: Option<u8>
}

to keep the API consistent

armaniferrante commented 2 years ago

This would be great, but I don't think that's going to work because the seeds slice is not mutable and the runtime api requires all the seeds to be together.

armaniferrante commented 2 years ago

Also the inconsistency is reduced once we do https://github.com/project-serum/anchor/issues/1039