fix: catch up to recent upstream changes
This commit is contained in:
30
web3.js/test/native-loader.test.js
Normal file
30
web3.js/test/native-loader.test.js
Normal file
@ -0,0 +1,30 @@
|
||||
// @flow
|
||||
|
||||
import {
|
||||
Connection,
|
||||
NativeLoader,
|
||||
Transaction,
|
||||
} from '../src';
|
||||
import {mockRpcEnabled} from './__mocks__/node-fetch';
|
||||
import {url} from './url';
|
||||
import {newAccountWithTokens} from './new-account-with-tokens';
|
||||
|
||||
test('unstable - load', async () => {
|
||||
if (mockRpcEnabled) {
|
||||
console.log('non-live test skipped');
|
||||
return;
|
||||
}
|
||||
|
||||
const connection = new Connection(url);
|
||||
const from = await newAccountWithTokens(connection);
|
||||
|
||||
const noopProgramId = await NativeLoader.load(connection, from, 'noop');
|
||||
const noopTransaction = new Transaction({
|
||||
fee: 0,
|
||||
keys: [from.publicKey],
|
||||
programId: noopProgramId,
|
||||
});
|
||||
const signature = await connection.sendTransaction(from, noopTransaction);
|
||||
expect(connection.confirmTransaction(signature)).resolves.toBe(true);
|
||||
});
|
||||
|
Reference in New Issue
Block a user