Add try_find_program_address syscall (bp #14118) (#14421)

* Add try_find_program_address syscall (#14118)

(cherry picked from commit ab98c1f2d4)

# Conflicts:
#	programs/bpf_loader/src/syscalls.rs
#	sdk/program/src/pubkey.rs
#	sdk/src/feature_set.rs

* fix conflicts

Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
mergify[bot]
2021-01-05 01:41:41 +00:00
committed by GitHub
parent 6960eed856
commit b8d3800f57
6 changed files with 207 additions and 34 deletions

View File

@@ -479,14 +479,31 @@ typedef struct {
*
* @param seeds Seed bytes used to sign program accounts
* @param seeds_len Length of the seeds array
* @param Progam id of the signer
* @param Program address created, filled on return
* @param program_id Program id of the signer
* @param program_address Program address created, filled on return
*/
static uint64_t sol_create_program_address(
const SolSignerSeed *seeds,
int seeds_len,
const SolPubkey *program_id,
const SolPubkey *address
const SolPubkey *program_address
);
/**
* Try to find a program address and return corresponding bump seed
*
* @param seeds Seed bytes used to sign program accounts
* @param seeds_len Length of the seeds array
* @param program_id Program id of the signer
* @param program_address Program address created, filled on return
* @param bump_seed Bump seed required to create a valid program address
*/
static uint64_t sol_try_find_program_address(
const SolSignerSeed *seeds,
int seeds_len,
const SolPubkey *program_id,
const SolPubkey *program_address,
const uint8_t *bump_seed
);
/**