Skip to content

Commit cccb143

Browse files
committed
fix: imports
1 parent 33e929e commit cccb143

10 files changed

+9
-66
lines changed

src/helpers.ts

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -319,58 +319,6 @@ export function httpPostRequest(
319319
});
320320
}
321321

322-
/**
323-
* A helper function that uses the idiomatic Node.js convention for reading an http response body into memory.
324-
* Rejects if the http connection is terminated before the http response has been fully received.
325-
*/
326-
export function readHttpResponse(res: http.IncomingMessage): Promise<Buffer> {
327-
return new Promise<Buffer>((resolve, reject) => {
328-
const chunks: Buffer[] = [];
329-
res.on('data', chunk => chunks.push(chunk));
330-
res.on('end', () => {
331-
if (!res.complete) {
332-
return reject(
333-
new Error('The connection was terminated while the message was still being sent')
334-
);
335-
}
336-
const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks);
337-
resolve(buffer);
338-
});
339-
res.on('close', () => {
340-
if (!res.complete) {
341-
return reject(
342-
new Error('The connection was terminated while the message was still being sent')
343-
);
344-
}
345-
});
346-
res.on('error', error => {
347-
reject(error);
348-
});
349-
});
350-
}
351-
352-
/**
353-
* Create an http request using Node.js standard `http` lib, providing more fine-grain control over
354-
* capabilities compared to wrappers like `node-fetch`.
355-
* @returns The http request and response once http headers are available (the typical behavior of Node.js http requests).
356-
*/
357-
export async function httpGetRequest(url: string, opts?: http.RequestOptions) {
358-
return new Promise<[http.ClientRequest, http.IncomingMessage]>((resolve, reject) => {
359-
try {
360-
const urlObj = new URL(url);
361-
const req = http.request(urlObj, opts ?? {}, res => {
362-
resolve([req, res]);
363-
});
364-
req.on('error', error => {
365-
reject(error);
366-
});
367-
req.end();
368-
} catch (error) {
369-
reject(error);
370-
}
371-
});
372-
}
373-
374322
export function parsePort(portVal: number | string | undefined): number | undefined {
375323
if (portVal === undefined) {
376324
return undefined;

tests/2.5/pox-4-btc-address-formats.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
BurnchainRewardSlotHolderListResponse,
3131
} from '../../src/api/schemas/responses/responses';
3232
import { BurnchainRewardsTotal } from '../../src/api/schemas/entities/burnchain-rewards';
33-
import { FAUCET_TESTNET_KEYS } from 'src/api/routes/faucets';
33+
import { FAUCET_TESTNET_KEYS } from '../../src/api/routes/faucets';
3434

3535
const BTC_PRIVATE_KEY = '0000000000000000000000000000000000000000000000000000000000000002';
3636

tests/2.5/pox-4-burnchain-delegate-stx.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import {
3939
TransactionEventsResponse,
4040
} from '../../src/api/schemas/responses/responses';
4141
import { StxLockTransactionEvent } from '../../src/api/schemas/entities/transaction-events';
42-
import { FAUCET_TESTNET_KEYS } from 'src/api/routes/faucets';
42+
import { FAUCET_TESTNET_KEYS } from '../../src/api/routes/faucets';
4343

4444
// Perform Delegate-STX operation on Bitcoin.
4545
// See https://github.com/stacksgov/sips/blob/a7f2e58ec90c12ee1296145562eec75029b89c48/sips/sip-015/sip-015-network-upgrade.md#new-burnchain-transaction-delegate-stx

tests/2.5/pox-4-burnchain-stack-stx.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import { AddressStxBalance } from '../../src/api/schemas/entities/addresses';
3636
import { TransactionEventsResponse } from '../../src/api/schemas/responses/responses';
3737
import { StxLockTransactionEvent } from '../../src/api/schemas/entities/transaction-events';
3838
import { ContractCallTransaction } from '../../src/api/schemas/entities/transactions';
39-
import { FAUCET_TESTNET_KEYS } from 'src/api/routes/faucets';
39+
import { FAUCET_TESTNET_KEYS } from '../../src/api/routes/faucets';
4040

4141
// Perform Stack-STX operation on Bitcoin.
4242
// See https://github.com/stacksgov/sips/blob/0da29c6911c49c45e4125dbeaed58069854591eb/sips/sip-007/sip-007-stacking-consensus.md#stx-operations-on-bitcoin

tests/2.5/pox-4-delegate-aggregation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import { hexToBytes } from '@stacks/common';
3838
import { StackingClient } from '@stacks/stacking';
3939
import { getPublicKeyFromPrivate } from '@stacks/encryption';
4040
import { AddressStxBalance } from '../../src/api/schemas/entities/addresses';
41-
import { FAUCET_TESTNET_KEYS } from 'src/api/routes/faucets';
41+
import { FAUCET_TESTNET_KEYS } from '../../src/api/routes/faucets';
4242

4343
describe('PoX-4 - Delegate aggregation increase operations', () => {
4444
const seedKey = FAUCET_TESTNET_KEYS[4].secretKey;

tests/2.5/pox-4-delegate-revoked-stacking.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {
3434
import { hexToBytes } from '@stacks/common';
3535
import { getPublicKeyFromPrivate } from '@stacks/encryption';
3636
import { AddressStxBalance } from '../../src/api/schemas/entities/addresses';
37-
import { FAUCET_TESTNET_KEYS } from 'src/api/routes/faucets';
37+
import { FAUCET_TESTNET_KEYS } from '../../src/api/routes/faucets';
3838

3939
describe('PoX-4 - Delegate Revoked Stacking', () => {
4040
const seedKey = FAUCET_TESTNET_KEYS[4].secretKey;

tests/2.5/pox-4-delegate-stacking.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { StackingClient } from '@stacks/stacking';
2929
import { getPublicKeyFromPrivate } from '@stacks/encryption';
3030
import { hexToBytes } from '@stacks/common';
3131
import { AddressStxBalance } from '../../src/api/schemas/entities/addresses';
32-
import { FAUCET_TESTNET_KEYS } from 'src/api/routes/faucets';
32+
import { FAUCET_TESTNET_KEYS } from '../../src/api/routes/faucets';
3333

3434
describe('PoX-4 - Delegate Stacking operations', () => {
3535
const seedKey = FAUCET_TESTNET_KEYS[4].secretKey;

tests/2.5/pox-4-stack-extend-increase.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
BurnchainRewardSlotHolderListResponse,
3131
} from '../../src/api/schemas/responses/responses';
3232
import { BurnchainRewardsTotal } from '../../src/api/schemas/entities/burnchain-rewards';
33-
import { FAUCET_TESTNET_KEYS } from 'src/api/routes/faucets';
33+
import { FAUCET_TESTNET_KEYS } from '../../src/api/routes/faucets';
3434

3535
describe('PoX-4 - Stack extend and increase operations', () => {
3636
const account = FAUCET_TESTNET_KEYS[1];

tests/bns-e2e/bns-integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
} from '@stacks/transactions';
1717
import { PgWriteStore } from '../../src/datastore/pg-write-store';
1818
import { standByForTx as standByForTxShared } from '../utils/test-helpers';
19-
import { FAUCET_TESTNET_KEYS } from 'src/api/routes/faucets';
19+
import { FAUCET_TESTNET_KEYS } from '../../src/api/routes/faucets';
2020
import { logger } from '@stacks/api-toolkit';
2121

2222
function hash160(bfr: Buffer): Buffer {

tests/utils/test-helpers.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
/* eslint-disable @typescript-eslint/no-non-null-assertion */
2-
import { bytesToHex } from '@stacks/common';
32
import { StacksNetwork } from '@stacks/network';
43
import { decodeBtcAddress } from '@stacks/stacking';
54
import {
65
bufferCV,
7-
ChainID,
86
ClarityValue,
9-
createStacksPrivateKey,
10-
deserializeTransaction,
117
getAddressFromPrivateKey,
12-
TransactionSigner,
138
TransactionVersion,
149
TupleCV,
1510
tupleCV,
@@ -37,7 +32,7 @@ import { MIGRATIONS_DIR } from '../../src/datastore/pg-store';
3732
import { getConnectionArgs } from '../../src/datastore/connection';
3833
import { AddressStxBalance } from '../../src/api/schemas/entities/addresses';
3934
import { ServerStatusResponse } from '../../src/api/schemas/responses/responses';
40-
import { FAUCET_TESTNET_KEYS } from 'src/api/routes/faucets';
35+
import { FAUCET_TESTNET_KEYS } from '../../src/api/routes/faucets';
4136

4237
export async function migrate(direction: 'up' | 'down') {
4338
const connArgs = getConnectionArgs();

0 commit comments

Comments
 (0)