fix: remove buggy node polyfill plugin (#18531)
* fix: remove buggy node polyfill plugin * fix websocket test * remove assert dependency
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import bs58 from 'bs58';
|
||||
import invariant from 'assert';
|
||||
import {Buffer} from 'buffer';
|
||||
import {Token, u64} from '@solana/spl-token';
|
||||
import {expect, use} from 'chai';
|
||||
@ -19,6 +18,7 @@ import {
|
||||
sendAndConfirmTransaction,
|
||||
Keypair,
|
||||
} from '../src';
|
||||
import invariant from '../src/util/assert';
|
||||
import {DEFAULT_TICKS_PER_SLOT, NUM_TICKS_PER_SECOND} from '../src/timing';
|
||||
import {MOCK_PORT, url} from './url';
|
||||
import {
|
||||
|
@ -1,10 +1,10 @@
|
||||
import bs58 from 'bs58';
|
||||
import BN from 'bn.js';
|
||||
import invariant from 'assert';
|
||||
import * as mockttp from 'mockttp';
|
||||
|
||||
import {mockRpcMessage} from './rpc-websockets';
|
||||
import {Connection, PublicKey, Transaction, Signer} from '../../src';
|
||||
import invariant from '../../src/util/assert';
|
||||
import type {Commitment, HttpHeaders, RpcParams} from '../../src/connection';
|
||||
|
||||
export const mockServer: mockttp.Mockttp | undefined =
|
||||
@ -150,7 +150,7 @@ const processTransaction = async ({
|
||||
transaction.sign(...signers);
|
||||
|
||||
const encoded = transaction.serialize().toString('base64');
|
||||
invariant(transaction.signature !== null);
|
||||
invariant(transaction.signature);
|
||||
const signature = bs58.encode(transaction.signature);
|
||||
await mockRpcResponse({
|
||||
method: 'sendTransaction',
|
||||
|
@ -1,5 +1,4 @@
|
||||
import base58 from 'bs58';
|
||||
import invariant from 'assert';
|
||||
import {expect} from 'chai';
|
||||
|
||||
import {
|
||||
@ -9,6 +8,7 @@ import {
|
||||
SystemProgram,
|
||||
LAMPORTS_PER_SOL,
|
||||
} from '../src';
|
||||
import invariant from '../src/util/assert';
|
||||
import {MOCK_PORT, url} from './url';
|
||||
import {helpers, mockRpcResponse, mockServer} from './mocks/rpc-http';
|
||||
import {stubRpcWebSocket, restoreRpcWebSocket} from './mocks/rpc-websockets';
|
||||
|
@ -1,5 +1,4 @@
|
||||
import bs58 from 'bs58';
|
||||
import invariant from 'assert';
|
||||
import {Buffer} from 'buffer';
|
||||
import nacl from 'tweetnacl';
|
||||
import {expect} from 'chai';
|
||||
@ -10,6 +9,7 @@ import {Transaction} from '../src/transaction';
|
||||
import {StakeProgram} from '../src/stake-program';
|
||||
import {SystemProgram} from '../src/system-program';
|
||||
import {Message} from '../src/message';
|
||||
import invariant from '../src/util/assert';
|
||||
import {toBuffer} from '../src/util/to-buffer';
|
||||
|
||||
describe('Transaction', () => {
|
||||
|
@ -65,7 +65,7 @@ if (process.env.TEST_LIVE) {
|
||||
});
|
||||
|
||||
it('connect by websocket endpoint from options', async () => {
|
||||
let connection = new Connection('', {
|
||||
let connection = new Connection('http://localhost', {
|
||||
wsEndpoint: wsUrl,
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user