chore: cleanup flow and package.json

This commit is contained in:
Justin Starry
2021-02-08 00:57:12 +08:00
committed by Justin Starry
parent c675c67c26
commit f0a8aba2e2
50 changed files with 2167 additions and 285 deletions

View File

@@ -21,29 +21,20 @@ import {DEFAULT_TICKS_PER_SLOT, NUM_TICKS_PER_SECOND} from '../src/timing';
import {MOCK_PORT, url} from './url';
import {BLOCKHASH_CACHE_TIMEOUT_MS} from '../src/connection';
import {sleep} from '../src/util/sleep';
import type {TransactionSignature} from '../src/transaction';
import type {
Commitment,
SignatureStatus,
TransactionError,
KeyedAccountInfo,
SlotInfo,
} from '../src/connection';
import {
helpers,
mockErrorMessage,
mockErrorResponse,
uniqueSignature,
uniqueBlockhash,
mockRpcResponse,
mockServer,
} from './mocks/rpc-http';
import {
stubRpcWebSocket,
restoreRpcWebSocket,
mockRpcMessage,
} from './mocks/rpc-websockets';
import {stubRpcWebSocket, restoreRpcWebSocket} from './mocks/rpc-websockets';
import type {TransactionSignature} from '../src/transaction';
import type {
SignatureStatus,
TransactionError,
KeyedAccountInfo,
} from '../src/connection';
use(chaiAsPromised);
@@ -1712,12 +1703,9 @@ describe('Connection', () => {
lamports: 9,
}),
);
const signature3 = await sendAndConfirmTransaction(
connection,
transaction3,
[accountFrom],
{preflightCommitment: 'singleGossip'},
);
await sendAndConfirmTransaction(connection, transaction3, [accountFrom], {
preflightCommitment: 'singleGossip',
});
expect(transaction2.recentBlockhash).to.eq(transaction3.recentBlockhash);
// Sleep until blockhash cache times out
@@ -1956,7 +1944,7 @@ describe('Connection', () => {
});
it('slot notification', async () => {
let notifiedSlotInfo: SlotInfo;
let notifiedSlotInfo;
const subscriptionId = connection.onSlotChange(slotInfo => {
notifiedSlotInfo = slotInfo;
});