fix: support loading with deprecated bpf loader (#11595)

This commit is contained in:
Jack May 2020-08-12 15:54:57 -07:00 committed by GitHub
parent d4309b6481
commit 9071da6da7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -36,14 +36,22 @@ export class BpfLoader {
* @param connection The connection to use
* @param payer Account that will pay program loading fees
* @param program Account to load the program into
* @param elfBytes The entire ELF containing the BPF program
* @param elf The entire ELF containing the BPF program
* @param version The version of the BPF loader to use
*/
static load(
connection: Connection,
payer: Account,
program: Account,
elf: Buffer | Uint8Array | Array<number>,
version: number = 2,
): Promise<void> {
return Loader.load(connection, payer, program, BpfLoader.programId(), elf);
return Loader.load(
connection,
payer,
program,
BpfLoader.programId(version),
elf,
);
}
}