From 8e30dbbbf252a4d912b901284a412877ddae93a1 Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Thu, 11 Aug 2022 10:10:11 +0100 Subject: [PATCH] chore: restructure utils code --- web3.js/src/account.ts | 2 +- web3.js/src/connection.ts | 12 ++++++------ web3.js/src/index.ts | 8 ++------ web3.js/src/loader.ts | 4 ++-- web3.js/src/message/legacy.ts | 4 ++-- web3.js/src/nonce-account.ts | 2 +- web3.js/src/programs/address-lookup-table.ts | 2 +- web3.js/src/programs/compute-budget.ts | 2 +- web3.js/src/programs/ed25519.ts | 2 +- web3.js/src/programs/secp256k1.ts | 4 ++-- web3.js/src/programs/stake.ts | 2 +- web3.js/src/programs/system.ts | 4 ++-- web3.js/src/programs/vote.ts | 2 +- web3.js/src/publickey.ts | 4 ++-- .../expiry-custom-errors.ts} | 0 web3.js/src/transaction/index.ts | 1 + web3.js/src/transaction/legacy.ts | 6 +++--- .../__forks__/react-native/url-impl.ts | 0 web3.js/src/{util => utils}/assert.ts | 0 web3.js/src/{util => utils}/bigint.ts | 0 web3.js/src/{util => utils}/borsh-schema.ts | 0 web3.js/src/{util => utils}/cluster.ts | 0 web3.js/src/utils/index.ts | 4 ++++ web3.js/src/{util => utils}/makeWebsocketUrl.ts | 0 web3.js/src/{util => utils}/promise-timeout.ts | 0 .../send-and-confirm-raw-transaction.ts | 0 .../send-and-confirm-transaction.ts | 0 web3.js/src/{util => utils}/shortvec-encoding.ts | 0 web3.js/src/{util => utils}/sleep.ts | 0 web3.js/src/{util => utils}/to-buffer.ts | 0 web3.js/src/{util => utils}/url-impl.ts | 0 web3.js/src/validator-info.ts | 2 +- web3.js/src/vote-account.ts | 2 +- web3.js/test/agent-manager.test.ts | 2 +- web3.js/test/cluster.test.ts | 2 +- web3.js/test/connection.test.ts | 15 ++++++++------- web3.js/test/mocks/rpc-http.ts | 2 +- .../program-tests/address-lookup-table.test.ts | 2 +- web3.js/test/program-tests/system.test.ts | 2 +- web3.js/test/shortvec-encoding.test.ts | 2 +- web3.js/test/transaction-payer.test.ts | 2 +- web3.js/test/transaction.test.ts | 4 ++-- web3.js/test/websocket.test.ts | 2 +- 43 files changed, 53 insertions(+), 51 deletions(-) rename web3.js/src/{util/tx-expiry-custom-errors.ts => transaction/expiry-custom-errors.ts} (100%) rename web3.js/src/{util => utils}/__forks__/react-native/url-impl.ts (100%) rename web3.js/src/{util => utils}/assert.ts (100%) rename web3.js/src/{util => utils}/bigint.ts (100%) rename web3.js/src/{util => utils}/borsh-schema.ts (100%) rename web3.js/src/{util => utils}/cluster.ts (100%) create mode 100644 web3.js/src/utils/index.ts rename web3.js/src/{util => utils}/makeWebsocketUrl.ts (100%) rename web3.js/src/{util => utils}/promise-timeout.ts (100%) rename web3.js/src/{util => utils}/send-and-confirm-raw-transaction.ts (100%) rename web3.js/src/{util => utils}/send-and-confirm-transaction.ts (100%) rename web3.js/src/{util => utils}/shortvec-encoding.ts (100%) rename web3.js/src/{util => utils}/sleep.ts (100%) rename web3.js/src/{util => utils}/to-buffer.ts (100%) rename web3.js/src/{util => utils}/url-impl.ts (100%) diff --git a/web3.js/src/account.ts b/web3.js/src/account.ts index 13370e7835..66abe02f05 100644 --- a/web3.js/src/account.ts +++ b/web3.js/src/account.ts @@ -2,7 +2,7 @@ import nacl from 'tweetnacl'; import type {SignKeyPair as KeyPair} from 'tweetnacl'; import type {Buffer} from 'buffer'; -import {toBuffer} from './util/to-buffer'; +import {toBuffer} from './utils/to-buffer'; import {PublicKey} from './publickey'; /** diff --git a/web3.js/src/connection.ts b/web3.js/src/connection.ts index 0e68fca94f..6a5db84406 100644 --- a/web3.js/src/connection.ts +++ b/web3.js/src/connection.ts @@ -24,7 +24,7 @@ import type {Struct} from 'superstruct'; import {Client as RpcWebSocketClient} from 'rpc-websockets'; import RpcClient from 'jayson/lib/client/browser'; -import {URL} from './util/url-impl'; +import {URL} from './utils/url-impl'; import {AgentManager} from './agent-manager'; import {EpochSchedule} from './epoch-schedule'; import {SendTransactionError, SolanaJSONRPCError} from './errors'; @@ -35,14 +35,14 @@ import {Signer} from './keypair'; import {MS_PER_SLOT} from './timing'; import {Transaction, TransactionStatus} from './transaction'; import {Message} from './message'; -import assert from './util/assert'; -import {sleep} from './util/sleep'; -import {toBuffer} from './util/to-buffer'; +import assert from './utils/assert'; +import {sleep} from './utils/sleep'; +import {toBuffer} from './utils/to-buffer'; import { TransactionExpiredBlockheightExceededError, TransactionExpiredTimeoutError, -} from './util/tx-expiry-custom-errors'; -import {makeWebsocketUrl} from './util/makeWebsocketUrl'; +} from './transaction/expiry-custom-errors'; +import {makeWebsocketUrl} from './utils/makeWebsocketUrl'; import type {Blockhash} from './blockhash'; import type {FeeCalculator} from './fee-calculator'; import type {TransactionSignature} from './transaction'; diff --git a/web3.js/src/index.ts b/web3.js/src/index.ts index 2ac89f9635..5a0f705710 100644 --- a/web3.js/src/index.ts +++ b/web3.js/src/index.ts @@ -4,6 +4,7 @@ export * from './bpf-loader-deprecated'; export * from './bpf-loader'; export * from './connection'; export * from './epoch-schedule'; +export * from './errors'; export * from './fee-calculator'; export * from './keypair'; export * from './loader'; @@ -15,12 +16,7 @@ export * from './transaction'; export * from './validator-info'; export * from './vote-account'; export * from './sysvar'; -export * from './errors'; -export * from './util/borsh-schema'; -export * from './util/send-and-confirm-transaction'; -export * from './util/send-and-confirm-raw-transaction'; -export * from './util/tx-expiry-custom-errors'; -export * from './util/cluster'; +export * from './utils'; /** * There are 1-billion lamports in one SOL diff --git a/web3.js/src/loader.ts b/web3.js/src/loader.ts index 003d6d9d8f..df4a212e15 100644 --- a/web3.js/src/loader.ts +++ b/web3.js/src/loader.ts @@ -4,8 +4,8 @@ import * as BufferLayout from '@solana/buffer-layout'; import {PublicKey} from './publickey'; import {Transaction, PACKET_DATA_SIZE} from './transaction'; import {SYSVAR_RENT_PUBKEY} from './sysvar'; -import {sendAndConfirmTransaction} from './util/send-and-confirm-transaction'; -import {sleep} from './util/sleep'; +import {sendAndConfirmTransaction} from './utils/send-and-confirm-transaction'; +import {sleep} from './utils/sleep'; import type {Connection} from './connection'; import type {Signer} from './keypair'; import {SystemProgram} from './programs/system'; diff --git a/web3.js/src/message/legacy.ts b/web3.js/src/message/legacy.ts index 2052f5445a..9d5ff3f3f0 100644 --- a/web3.js/src/message/legacy.ts +++ b/web3.js/src/message/legacy.ts @@ -6,8 +6,8 @@ import {PublicKey} from '../publickey'; import type {Blockhash} from '../blockhash'; import * as Layout from '../layout'; import {PACKET_DATA_SIZE} from '../transaction/constants'; -import * as shortvec from '../util/shortvec-encoding'; -import {toBuffer} from '../util/to-buffer'; +import * as shortvec from '../utils/shortvec-encoding'; +import {toBuffer} from '../utils/to-buffer'; import {CompiledInstruction, MessageHeader} from './index'; /** diff --git a/web3.js/src/nonce-account.ts b/web3.js/src/nonce-account.ts index e3c7f41ff3..f7b5cb625b 100644 --- a/web3.js/src/nonce-account.ts +++ b/web3.js/src/nonce-account.ts @@ -6,7 +6,7 @@ import * as Layout from './layout'; import {PublicKey} from './publickey'; import type {FeeCalculator} from './fee-calculator'; import {FeeCalculatorLayout} from './fee-calculator'; -import {toBuffer} from './util/to-buffer'; +import {toBuffer} from './utils/to-buffer'; /** * See https://github.com/solana-labs/solana/blob/0ea2843ec9cdc517572b8e62c959f41b55cf4453/sdk/src/nonce_state.rs#L29-L32 diff --git a/web3.js/src/programs/address-lookup-table.ts b/web3.js/src/programs/address-lookup-table.ts index dda4dcd158..d367d4ea70 100644 --- a/web3.js/src/programs/address-lookup-table.ts +++ b/web3.js/src/programs/address-lookup-table.ts @@ -3,7 +3,7 @@ import * as BufferLayout from '@solana/buffer-layout'; import * as Layout from '../layout'; import {PublicKey} from '../publickey'; -import * as bigintLayout from '../util/bigint'; +import * as bigintLayout from '../utils/bigint'; import {SystemProgram} from './system'; import {TransactionInstruction} from '../transaction'; import {decodeData, encodeData, IInstructionInputData} from '../instruction'; diff --git a/web3.js/src/programs/compute-budget.ts b/web3.js/src/programs/compute-budget.ts index 0059133fb0..ebf37daa10 100644 --- a/web3.js/src/programs/compute-budget.ts +++ b/web3.js/src/programs/compute-budget.ts @@ -8,7 +8,7 @@ import { } from '../instruction'; import {PublicKey} from '../publickey'; import {TransactionInstruction} from '../transaction'; -import {u64} from '../util/bigint'; +import {u64} from '../utils/bigint'; /** * Compute Budget Instruction class diff --git a/web3.js/src/programs/ed25519.ts b/web3.js/src/programs/ed25519.ts index 6953c06035..8d31a21b70 100644 --- a/web3.js/src/programs/ed25519.ts +++ b/web3.js/src/programs/ed25519.ts @@ -5,7 +5,7 @@ import nacl from 'tweetnacl'; import {Keypair} from '../keypair'; import {PublicKey} from '../publickey'; import {TransactionInstruction} from '../transaction'; -import assert from '../util/assert'; +import assert from '../utils/assert'; const PRIVATE_KEY_BYTES = 64; const PUBLIC_KEY_BYTES = 32; diff --git a/web3.js/src/programs/secp256k1.ts b/web3.js/src/programs/secp256k1.ts index f3654e0a08..b3a358d188 100644 --- a/web3.js/src/programs/secp256k1.ts +++ b/web3.js/src/programs/secp256k1.ts @@ -5,8 +5,8 @@ import sha3 from 'js-sha3'; import {PublicKey} from '../publickey'; import {TransactionInstruction} from '../transaction'; -import assert from '../util/assert'; -import {toBuffer} from '../util/to-buffer'; +import assert from '../utils/assert'; +import {toBuffer} from '../utils/to-buffer'; const {publicKeyCreate, ecdsaSign} = secp256k1; diff --git a/web3.js/src/programs/stake.ts b/web3.js/src/programs/stake.ts index 315a8bc29d..587491b1af 100644 --- a/web3.js/src/programs/stake.ts +++ b/web3.js/src/programs/stake.ts @@ -15,7 +15,7 @@ import { SYSVAR_STAKE_HISTORY_PUBKEY, } from '../sysvar'; import {Transaction, TransactionInstruction} from '../transaction'; -import {toBuffer} from '../util/to-buffer'; +import {toBuffer} from '../utils/to-buffer'; /** * Address of the stake config account which configures the rate diff --git a/web3.js/src/programs/system.ts b/web3.js/src/programs/system.ts index 0e90573f98..e833664ea3 100644 --- a/web3.js/src/programs/system.ts +++ b/web3.js/src/programs/system.ts @@ -11,8 +11,8 @@ import {NONCE_ACCOUNT_LENGTH} from '../nonce-account'; import {PublicKey} from '../publickey'; import {SYSVAR_RECENT_BLOCKHASHES_PUBKEY, SYSVAR_RENT_PUBKEY} from '../sysvar'; import {Transaction, TransactionInstruction} from '../transaction'; -import {toBuffer} from '../util/to-buffer'; -import {u64} from '../util/bigint'; +import {toBuffer} from '../utils/to-buffer'; +import {u64} from '../utils/bigint'; /** * Create account system transaction params diff --git a/web3.js/src/programs/vote.ts b/web3.js/src/programs/vote.ts index e6660c966b..6cd16671a9 100644 --- a/web3.js/src/programs/vote.ts +++ b/web3.js/src/programs/vote.ts @@ -11,7 +11,7 @@ import {PublicKey} from '../publickey'; import {SystemProgram} from './system'; import {SYSVAR_CLOCK_PUBKEY, SYSVAR_RENT_PUBKEY} from '../sysvar'; import {Transaction, TransactionInstruction} from '../transaction'; -import {toBuffer} from '../util/to-buffer'; +import {toBuffer} from '../utils/to-buffer'; /** * Vote account info diff --git a/web3.js/src/publickey.ts b/web3.js/src/publickey.ts index 89b9680263..877d2103db 100644 --- a/web3.js/src/publickey.ts +++ b/web3.js/src/publickey.ts @@ -4,8 +4,8 @@ import {Buffer} from 'buffer'; import nacl from 'tweetnacl'; import {sha256} from '@ethersproject/sha2'; -import {Struct, SOLANA_SCHEMA} from './util/borsh-schema'; -import {toBuffer} from './util/to-buffer'; +import {Struct, SOLANA_SCHEMA} from './utils/borsh-schema'; +import {toBuffer} from './utils/to-buffer'; /** * Maximum length of derived pubkey seed diff --git a/web3.js/src/util/tx-expiry-custom-errors.ts b/web3.js/src/transaction/expiry-custom-errors.ts similarity index 100% rename from web3.js/src/util/tx-expiry-custom-errors.ts rename to web3.js/src/transaction/expiry-custom-errors.ts diff --git a/web3.js/src/transaction/index.ts b/web3.js/src/transaction/index.ts index bd0a78122e..ed913f5124 100644 --- a/web3.js/src/transaction/index.ts +++ b/web3.js/src/transaction/index.ts @@ -1,2 +1,3 @@ export * from './constants'; +export * from './expiry-custom-errors'; export * from './legacy'; diff --git a/web3.js/src/transaction/legacy.ts b/web3.js/src/transaction/legacy.ts index 076263194e..f5e030099d 100644 --- a/web3.js/src/transaction/legacy.ts +++ b/web3.js/src/transaction/legacy.ts @@ -6,9 +6,9 @@ import {PACKET_DATA_SIZE, SIGNATURE_LENGTH_IN_BYTES} from './constants'; import {Connection} from '../connection'; import {Message} from '../message'; import {PublicKey} from '../publickey'; -import * as shortvec from '../util/shortvec-encoding'; -import {toBuffer} from '../util/to-buffer'; -import invariant from '../util/assert'; +import * as shortvec from '../utils/shortvec-encoding'; +import {toBuffer} from '../utils/to-buffer'; +import invariant from '../utils/assert'; import type {Signer} from '../keypair'; import type {Blockhash} from '../blockhash'; import type {CompiledInstruction} from '../message'; diff --git a/web3.js/src/util/__forks__/react-native/url-impl.ts b/web3.js/src/utils/__forks__/react-native/url-impl.ts similarity index 100% rename from web3.js/src/util/__forks__/react-native/url-impl.ts rename to web3.js/src/utils/__forks__/react-native/url-impl.ts diff --git a/web3.js/src/util/assert.ts b/web3.js/src/utils/assert.ts similarity index 100% rename from web3.js/src/util/assert.ts rename to web3.js/src/utils/assert.ts diff --git a/web3.js/src/util/bigint.ts b/web3.js/src/utils/bigint.ts similarity index 100% rename from web3.js/src/util/bigint.ts rename to web3.js/src/utils/bigint.ts diff --git a/web3.js/src/util/borsh-schema.ts b/web3.js/src/utils/borsh-schema.ts similarity index 100% rename from web3.js/src/util/borsh-schema.ts rename to web3.js/src/utils/borsh-schema.ts diff --git a/web3.js/src/util/cluster.ts b/web3.js/src/utils/cluster.ts similarity index 100% rename from web3.js/src/util/cluster.ts rename to web3.js/src/utils/cluster.ts diff --git a/web3.js/src/utils/index.ts b/web3.js/src/utils/index.ts new file mode 100644 index 0000000000..0c28bd829b --- /dev/null +++ b/web3.js/src/utils/index.ts @@ -0,0 +1,4 @@ +export * from './borsh-schema'; +export * from './cluster'; +export * from './send-and-confirm-raw-transaction'; +export * from './send-and-confirm-transaction'; diff --git a/web3.js/src/util/makeWebsocketUrl.ts b/web3.js/src/utils/makeWebsocketUrl.ts similarity index 100% rename from web3.js/src/util/makeWebsocketUrl.ts rename to web3.js/src/utils/makeWebsocketUrl.ts diff --git a/web3.js/src/util/promise-timeout.ts b/web3.js/src/utils/promise-timeout.ts similarity index 100% rename from web3.js/src/util/promise-timeout.ts rename to web3.js/src/utils/promise-timeout.ts diff --git a/web3.js/src/util/send-and-confirm-raw-transaction.ts b/web3.js/src/utils/send-and-confirm-raw-transaction.ts similarity index 100% rename from web3.js/src/util/send-and-confirm-raw-transaction.ts rename to web3.js/src/utils/send-and-confirm-raw-transaction.ts diff --git a/web3.js/src/util/send-and-confirm-transaction.ts b/web3.js/src/utils/send-and-confirm-transaction.ts similarity index 100% rename from web3.js/src/util/send-and-confirm-transaction.ts rename to web3.js/src/utils/send-and-confirm-transaction.ts diff --git a/web3.js/src/util/shortvec-encoding.ts b/web3.js/src/utils/shortvec-encoding.ts similarity index 100% rename from web3.js/src/util/shortvec-encoding.ts rename to web3.js/src/utils/shortvec-encoding.ts diff --git a/web3.js/src/util/sleep.ts b/web3.js/src/utils/sleep.ts similarity index 100% rename from web3.js/src/util/sleep.ts rename to web3.js/src/utils/sleep.ts diff --git a/web3.js/src/util/to-buffer.ts b/web3.js/src/utils/to-buffer.ts similarity index 100% rename from web3.js/src/util/to-buffer.ts rename to web3.js/src/utils/to-buffer.ts diff --git a/web3.js/src/util/url-impl.ts b/web3.js/src/utils/url-impl.ts similarity index 100% rename from web3.js/src/util/url-impl.ts rename to web3.js/src/utils/url-impl.ts diff --git a/web3.js/src/validator-info.ts b/web3.js/src/validator-info.ts index 3d70980fc7..efaa4ee321 100644 --- a/web3.js/src/validator-info.ts +++ b/web3.js/src/validator-info.ts @@ -7,7 +7,7 @@ import { } from 'superstruct'; import * as Layout from './layout'; -import * as shortvec from './util/shortvec-encoding'; +import * as shortvec from './utils/shortvec-encoding'; import {PublicKey} from './publickey'; export const VALIDATOR_INFO_KEY = new PublicKey( diff --git a/web3.js/src/vote-account.ts b/web3.js/src/vote-account.ts index 0a824d43b7..e764379550 100644 --- a/web3.js/src/vote-account.ts +++ b/web3.js/src/vote-account.ts @@ -3,7 +3,7 @@ import type {Buffer} from 'buffer'; import * as Layout from './layout'; import {PublicKey} from './publickey'; -import {toBuffer} from './util/to-buffer'; +import {toBuffer} from './utils/to-buffer'; export const VOTE_PROGRAM_ID = new PublicKey( 'Vote111111111111111111111111111111111111111', diff --git a/web3.js/test/agent-manager.test.ts b/web3.js/test/agent-manager.test.ts index 071144458c..929296a3be 100644 --- a/web3.js/test/agent-manager.test.ts +++ b/web3.js/test/agent-manager.test.ts @@ -1,7 +1,7 @@ import {expect} from 'chai'; import {AgentManager, DESTROY_TIMEOUT_MS} from '../src/agent-manager'; -import {sleep} from '../src/util/sleep'; +import {sleep} from '../src/utils/sleep'; describe('AgentManager', () => { it('works', async () => { diff --git a/web3.js/test/cluster.test.ts b/web3.js/test/cluster.test.ts index 4e1b81edbc..8acf6c3707 100644 --- a/web3.js/test/cluster.test.ts +++ b/web3.js/test/cluster.test.ts @@ -1,6 +1,6 @@ import {expect} from 'chai'; -import {clusterApiUrl} from '../src/util/cluster'; +import {clusterApiUrl} from '../src/utils/cluster'; describe('Cluster Util', () => { it('invalid', () => { diff --git a/web3.js/test/connection.test.ts b/web3.js/test/connection.test.ts index 7cc7c987ed..8149737aec 100644 --- a/web3.js/test/connection.test.ts +++ b/web3.js/test/connection.test.ts @@ -19,7 +19,7 @@ import { Keypair, Message, } from '../src'; -import invariant from '../src/util/assert'; +import invariant from '../src/utils/assert'; import {MOCK_PORT, url} from './url'; import { AccountInfo, @@ -35,7 +35,7 @@ import { SignatureResult, SlotInfo, } from '../src/connection'; -import {sleep} from '../src/util/sleep'; +import {sleep} from '../src/utils/sleep'; import { helpers, mockErrorMessage, @@ -49,16 +49,17 @@ import { restoreRpcWebSocket, mockRpcMessage, } from './mocks/rpc-websockets'; -import {TransactionInstruction, TransactionSignature} from '../src/transaction'; +import { + TransactionInstruction, + TransactionSignature, + TransactionExpiredBlockheightExceededError, + TransactionExpiredTimeoutError, +} from '../src/transaction'; import type { SignatureStatus, TransactionError, KeyedAccountInfo, } from '../src/connection'; -import { - TransactionExpiredBlockheightExceededError, - TransactionExpiredTimeoutError, -} from '../src/util/tx-expiry-custom-errors'; use(chaiAsPromised); diff --git a/web3.js/test/mocks/rpc-http.ts b/web3.js/test/mocks/rpc-http.ts index c0735327b2..a56148fec3 100644 --- a/web3.js/test/mocks/rpc-http.ts +++ b/web3.js/test/mocks/rpc-http.ts @@ -4,7 +4,7 @@ import * as mockttp from 'mockttp'; import {mockRpcMessage} from './rpc-websockets'; import {Connection, PublicKey, Transaction, Signer} from '../../src'; -import invariant from '../../src/util/assert'; +import invariant from '../../src/utils/assert'; import type {Commitment, HttpHeaders, RpcParams} from '../../src/connection'; export const mockServer: mockttp.Mockttp | undefined = diff --git a/web3.js/test/program-tests/address-lookup-table.test.ts b/web3.js/test/program-tests/address-lookup-table.test.ts index 0c9d07c03a..5b5d486052 100644 --- a/web3.js/test/program-tests/address-lookup-table.test.ts +++ b/web3.js/test/program-tests/address-lookup-table.test.ts @@ -9,7 +9,7 @@ import { Connection, sendAndConfirmTransaction, } from '../../src'; -import {sleep} from '../../src/util/sleep'; +import {sleep} from '../../src/utils/sleep'; import {helpers} from '../mocks/rpc-http'; import {url} from '../url'; diff --git a/web3.js/test/program-tests/system.test.ts b/web3.js/test/program-tests/system.test.ts index 708865286e..cfdca891b3 100644 --- a/web3.js/test/program-tests/system.test.ts +++ b/web3.js/test/program-tests/system.test.ts @@ -14,7 +14,7 @@ import { LAMPORTS_PER_SOL, } from '../../src'; import {NONCE_ACCOUNT_LENGTH} from '../../src/nonce-account'; -import {sleep} from '../../src/util/sleep'; +import {sleep} from '../../src/utils/sleep'; import {helpers} from '../mocks/rpc-http'; import {url} from '../url'; diff --git a/web3.js/test/shortvec-encoding.test.ts b/web3.js/test/shortvec-encoding.test.ts index b4262d081f..68f8415862 100644 --- a/web3.js/test/shortvec-encoding.test.ts +++ b/web3.js/test/shortvec-encoding.test.ts @@ -1,6 +1,6 @@ import {expect} from 'chai'; -import {decodeLength, encodeLength} from '../src/util/shortvec-encoding'; +import {decodeLength, encodeLength} from '../src/utils/shortvec-encoding'; function checkDecodedArray(array: Array, expectedValue: number) { expect(decodeLength(array)).to.eq(expectedValue); diff --git a/web3.js/test/transaction-payer.test.ts b/web3.js/test/transaction-payer.test.ts index 436d792300..f4127327ce 100644 --- a/web3.js/test/transaction-payer.test.ts +++ b/web3.js/test/transaction-payer.test.ts @@ -8,7 +8,7 @@ import { SystemProgram, LAMPORTS_PER_SOL, } from '../src'; -import invariant from '../src/util/assert'; +import invariant from '../src/utils/assert'; import {MOCK_PORT, url} from './url'; import {helpers, mockRpcResponse, mockServer} from './mocks/rpc-http'; import {stubRpcWebSocket, restoreRpcWebSocket} from './mocks/rpc-websockets'; diff --git a/web3.js/test/transaction.test.ts b/web3.js/test/transaction.test.ts index 273d87ac06..dd40d1ecf6 100644 --- a/web3.js/test/transaction.test.ts +++ b/web3.js/test/transaction.test.ts @@ -9,8 +9,8 @@ import {PublicKey} from '../src/publickey'; import {Transaction, TransactionInstruction} from '../src/transaction'; import {StakeProgram, SystemProgram} from '../src/programs'; import {Message} from '../src/message'; -import invariant from '../src/util/assert'; -import {toBuffer} from '../src/util/to-buffer'; +import invariant from '../src/utils/assert'; +import {toBuffer} from '../src/utils/to-buffer'; import {helpers} from './mocks/rpc-http'; import {url} from './url'; diff --git a/web3.js/test/websocket.test.ts b/web3.js/test/websocket.test.ts index 84aa9018c3..b1d9a1932f 100644 --- a/web3.js/test/websocket.test.ts +++ b/web3.js/test/websocket.test.ts @@ -5,7 +5,7 @@ import chaiAsPromised from 'chai-as-promised'; import {Connection} from '../src'; import {url, wsUrl} from './url'; -import {sleep} from '../src/util/sleep'; +import {sleep} from '../src/utils/sleep'; use(chaiAsPromised);