From 9d97f4ebd4b7332924f822c22fa2fd7ee180d767 Mon Sep 17 00:00:00 2001 From: theanmolsharma Date: Sat, 30 Dec 2023 14:27:50 +0530 Subject: [PATCH] refactor: simplify imports Signed-off-by: theanmolsharma --- src/core/index.ts | 18 +++++++----------- test/encoding.spec.ts | 2 +- test/outputs.spec.ts | 8 ++++++-- test/scanning.spec.ts | 3 +-- test/utility.spec.ts | 8 ++++++-- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/core/index.ts b/src/core/index.ts index 0d24778..12609b3 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -1,11 +1,7 @@ -export { - decodeSilentPaymentAddress, - encodeSilentPaymentAddress, -} from './encoding.ts'; - -export { hashOutpoints, calculateSumOfPrivateKeys } from './utility.ts'; - -export { createOutputs } from './outputs.ts'; -export { scanOutputs } from './scanning.ts'; - -export { Transaction } from './transaction.ts'; +export * from './constants.ts'; +export * from './encoding.ts'; +export * from './interface.ts'; +export * from './outputs.ts'; +export * from './scanning.ts'; +export * from './transaction.ts'; +export * from './utility.ts'; diff --git a/test/encoding.spec.ts b/test/encoding.spec.ts index 1913e17..a634a8a 100644 --- a/test/encoding.spec.ts +++ b/test/encoding.spec.ts @@ -2,7 +2,7 @@ import { createLabeledSilentPaymentAddress, decodeSilentPaymentAddress, encodeSilentPaymentAddress, -} from '../src/core/encoding'; +} from '../src/core'; import { Buffer } from 'buffer'; import { unlabelled, labelled } from './fixtures/encoding'; diff --git a/test/outputs.spec.ts b/test/outputs.spec.ts index 8aca388..f706f60 100644 --- a/test/outputs.spec.ts +++ b/test/outputs.spec.ts @@ -1,5 +1,9 @@ -import { Outpoint, PrivateKey, RecipientAddress } from '../src/core/interface'; -import { createOutputs } from '../src/core'; +import { + createOutputs, + Outpoint, + PrivateKey, + RecipientAddress, +} from '../src/core'; import { testData } from './fixtures/outputs'; describe('Outputs', () => { diff --git a/test/scanning.spec.ts b/test/scanning.spec.ts index 55efc5d..668c873 100644 --- a/test/scanning.spec.ts +++ b/test/scanning.spec.ts @@ -1,5 +1,4 @@ -import { scanOutputs } from '../src/core'; -import { LabelMap } from '../src/core/interface'; +import { scanOutputs, LabelMap } from '../src/core'; import { Buffer } from 'buffer'; import { testData } from './fixtures/scanning'; diff --git a/test/utility.spec.ts b/test/utility.spec.ts index 7a521bb..59b895f 100644 --- a/test/utility.spec.ts +++ b/test/utility.spec.ts @@ -1,5 +1,9 @@ -import { Outpoint, PrivateKey } from '../src/core/interface'; -import { calculateSumOfPrivateKeys, hashOutpoints } from '../src/core'; +import { + calculateSumOfPrivateKeys, + hashOutpoints, + Outpoint, + PrivateKey, +} from '../src/core'; import { inputPrivateKeys, outpoints } from './fixtures/utility'; describe('Utility', () => {