4
votes
Accepted
Lifetime error after upgrade of Anchor and Solana
remaining_accounts usage in anchor-lang 0.29.0 requires explicit lifetime annotions:
pub fn submit_player_turn<'c: 'info, 'info>(
ctx: Context<'_, '_, 'c, 'info, SubmitPlayerTurn>,
...
4
votes
How would one hash two different pubkeys inside an Anchor program?
In order to get a commutative function of the two seed inputs, I would just XOR the keys together.
fn couple(prt1: Pubkey, prt2: Pubkey) -> Pubkey {
let a1: [u8; 32] = prt1.to_bytes();
let a2: [...
2
votes
Accepted
How would one hash two different pubkeys inside an Anchor program?
The seeds are already going to be hashed behind the scenes to generate the PDA, so hashing them in advance won't really buy you anything.
Would sorting the pubkeys first be sufficient for your ...
2
votes
Challenges with Lifetime Specifiers and Attribute Macros in Solana Playground: Seeking Guidance
Lifetime errors might be happening due to variety of reasons which makes it hard to give an answer without seeing the code. If you'd like to learn more about lifetimes, Validating References with ...
2
votes
Why do we use lifetime parameter when we create an account struct?
In a Solana program, accounts and their data are provided to a program, so the program can read / modify the data as it wants. The Anchor Account type wraps the solana_program::account_info::...
1
vote
could not find `__client_accounts_contributor` in the crate root
I'm facing the same issue. My error is
could not find __client_accounts_games in the crate root
So I'm beginning to think anchor expects you to export all certain things from the lib.rs file. For ...
1
vote
could not find `__client_accounts_contributor` in the crate root
Try adding solend-program = { version = "the-version", features = ["no-entrypoint"] } in your Cargo.toml file. Also, you might want to check any & you have around in your code ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
lifetimes × 8anchor × 7
rust × 3
program × 2
remaining-accounts × 2
account × 1
solana-program × 1
publickey × 1
hashing × 1
rustc × 1
accountinfo × 1