Skip to main content
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>, ...
acheron's user avatar
  • 2,909
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: [...
AllBlooming's user avatar
  • 2,309
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 ...
trent.sol's user avatar
  • 4,585
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 ...
acheron's user avatar
  • 2,909
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::...
Jon C's user avatar
  • 19.6k
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 ...
sayandcode's user avatar
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 ...
chinepun.sol's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible