Skip to content

Commit acc70c4

Browse files
committed
refactor: simplify imports and remove unused variables in unit tests
- Updated imports in src/custom-xdr/index.unit.test.ts to use type imports for operation types. - Removed unused imports and variables in src/transaction-builder/signing.unit.test.ts to enhance code clarity and maintainability.
1 parent 6084fda commit acc70c4

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

src/custom-xdr/index.unit.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals, assertExists, assertThrows } from "@std/assert";
1+
import { assertEquals, assertExists } from "@std/assert";
22
import { beforeAll, describe, it } from "@std/testing/bdd";
33
import {
44
type ContractId,
@@ -9,15 +9,14 @@ import type { UTXOPublicKey } from "../core/utxo-keypair-base/types.ts";
99
import { generateP256KeyPair } from "../utils/secp256r1/generateP256KeyPair.ts";
1010

1111
import type { CreateCondition } from "../conditions/types.ts";
12-
import { Condition } from "../conditions/index.ts";
1312
import { Asset, Networks } from "@stellar/stellar-sdk";
1413

1514
import {
16-
CreateOperation,
17-
DepositOperation,
18-
SpendOperation,
15+
type CreateOperation,
16+
type DepositOperation,
17+
type SpendOperation,
1918
UTXOOperationType,
20-
WithdrawOperation,
19+
type WithdrawOperation,
2120
} from "../operation/types.ts";
2221
import { MoonlightOperation } from "../operation/index.ts";
2322
import { UTXOKeypairBase } from "../core/utxo-keypair-base/index.ts";

src/transaction-builder/signing.unit.test.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,26 @@ import { assertExists } from "@std/assert/exists";
22
import { assertEquals } from "@std/assert/equals";
33
import { MoonlightTransactionBuilder } from "./index.ts";
44
import { beforeAll, describe, it } from "@std/testing/bdd";
5-
import { ContractId, Ed25519PublicKey, LocalSigner } from "@colibri/core";
5+
import { type ContractId, LocalSigner } from "@colibri/core";
66
import { Asset, Networks } from "@stellar/stellar-sdk";
77
import { Condition } from "../conditions/index.ts";
88
import { MoonlightOperation } from "../operation/index.ts";
99

1010
describe("MoonlightTransactionBuilder", () => {
11-
let validPublicKey: Ed25519PublicKey;
12-
1311
let validAmount: bigint;
1412
let channelId: ContractId;
1513
let authId: ContractId;
1614
let assetId: ContractId;
1715
let network: string;
18-
let builder: MoonlightTransactionBuilder;
1916

2017
beforeAll(() => {
21-
validPublicKey = LocalSigner.generateRandom()
22-
.publicKey() as Ed25519PublicKey;
23-
2418
validAmount = 1000n;
2519
channelId =
2620
"CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC" as ContractId;
2721
authId =
2822
"CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA" as ContractId;
2923
network = Networks.TESTNET;
3024
assetId = Asset.native().contractId(network) as ContractId;
31-
32-
builder = new MoonlightTransactionBuilder({
33-
channelId,
34-
authId,
35-
assetId,
36-
network,
37-
});
3825
});
3926

4027
describe("Signing", () => {

0 commit comments

Comments
 (0)