feat: support restarting failed bpf loader deploys (#12163)

* feat: support restarting failed bpf loader deploys

* chore: add error message if program already exists
This commit is contained in:
Justin Starry
2020-09-23 22:54:27 +08:00
committed by GitHub
parent bb72cbe7ae
commit 54775ffedf
5 changed files with 115 additions and 28 deletions

View File

@ -31,6 +31,7 @@ export class BpfLoader {
* @param program Account to load the program into
* @param elf The entire ELF containing the BPF program
* @param loaderProgramId The program id of the BPF loader to use
* @return true if program was loaded successfully, false if program was already loaded
*/
static load(
connection: Connection,
@ -38,7 +39,7 @@ export class BpfLoader {
program: Account,
elf: Buffer | Uint8Array | Array<number>,
loaderProgramId: PublicKey,
): Promise<void> {
): Promise<boolean> {
return Loader.load(connection, payer, program, loaderProgramId, elf);
}
}