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

@ -1,37 +0,0 @@
// @flow
import {
Connection,
NativeLoader,
Transaction,
sendAndConfirmTransaction,
} from '../src';
import {mockRpcEnabled} from './__mocks__/node-fetch';
import {url} from './url';
import {newAccountWithLamports} from './new-account-with-lamports';
if (!mockRpcEnabled) {
// The default of 5 seconds is too slow for live testing sometimes
jest.setTimeout(15000);
}
test('load native program', async () => {
if (mockRpcEnabled) {
console.log('non-live test skipped');
return;
}
const connection = new Connection(url);
const from = await newAccountWithLamports(connection, 1024);
const programId = await NativeLoader.load(
connection,
from,
'solana_noop_program',
);
const transaction = new Transaction().add({
keys: [{pubkey: from.publicKey, isSigner: true, isDebitable: true}],
programId,
});
await sendAndConfirmTransaction(connection, transaction, from);
});