fix: end of life native loader (#404)

This commit is contained in:
Justin Starry
2019-07-16 17:53:23 -04:00
committed by Michael Vines
parent 6f05930076
commit 2e3c5e7820
5 changed files with 1 additions and 114 deletions

View File

@@ -4,7 +4,6 @@ export {BpfLoader} from './bpf-loader';
export {BudgetProgram} from './budget-program';
export {Connection} from './connection';
export {Loader} from './loader';
export {NativeLoader} from './native-loader';
export {PublicKey} from './publickey';
export {SystemProgram} from './system-program';
export {Token, TokenAmount} from './token-program';

View File

@@ -1,41 +0,0 @@
// @flow
import {Account} from './account';
import {PublicKey} from './publickey';
import {Loader} from './loader';
import type {Connection} from './connection';
/**
* Factory class for transactions to interact with a program loader
*/
export class NativeLoader {
/**
* Public key that identifies the NativeLoader
*/
static get programId(): PublicKey {
return new PublicKey('NativeLoader1111111111111111111111111111111');
}
/**
* Loads a native program
*
* @param connection The connection to use
* @param payer System account that pays to load the program
* @param programName Name of the native program
*/
static load(
connection: Connection,
payer: Account,
programName: string,
): Promise<PublicKey> {
const bytes = [...Buffer.from(programName)];
const program = new Account();
return Loader.load(
connection,
payer,
program,
NativeLoader.programId,
bytes,
);
}
}