From 28b4b3dbef81d1bfe09cf450600891dfaffaf325 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Wed, 8 May 2024 14:27:13 +0200 Subject: [PATCH] Remove BigNumber dependency We don't need to import this dependency as it is used only in test, to mock the funding UTXO's value property. The property is not used in the code anyway, so we can ignore the TS error and make the tests pass. --- pnpm-lock.yaml | 3 --- sdk/package.json | 1 - sdk/test/data/deposit.ts | 3 --- sdk/test/modules/tbtc/Deposit.test.ts | 1 + 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 89c0b0bc4..1beeb0fc4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -145,9 +145,6 @@ importers: '@babel/preset-env': specifier: ^7.23.7 version: 7.23.7(@babel/core@7.23.3) - '@ethersproject/bignumber': - specifier: ^5.7.0 - version: 5.7.0 '@thesis-co/eslint-config': specifier: github:thesis/eslint-config#7b9bc8c version: github.com/thesis/eslint-config/7b9bc8c(eslint@8.54.0)(prettier@3.1.0)(typescript@5.3.2) diff --git a/sdk/package.json b/sdk/package.json index 519616401..d5b78e774 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -15,7 +15,6 @@ }, "devDependencies": { "@babel/preset-env": "^7.23.7", - "@ethersproject/bignumber": "^5.7.0", "@thesis-co/eslint-config": "github:thesis/eslint-config#7b9bc8c", "@types/jest": "^29.5.11", "@types/node": "^20.9.4", diff --git a/sdk/test/data/deposit.ts b/sdk/test/data/deposit.ts index adf38d735..39d55bb6b 100644 --- a/sdk/test/data/deposit.ts +++ b/sdk/test/data/deposit.ts @@ -1,5 +1,4 @@ import { BitcoinTxHash, EthereumAddress, Hex } from "@keep-network/tbtc-v2.ts" -import { BigNumber } from "@ethersproject/bignumber" import type { ChainIdentifier } from "../../src/lib/contracts" import type { DepositReceipt } from "../../src/modules/tbtc" @@ -50,13 +49,11 @@ const revealTestData: SaveRevealRequest = { const fundingUtxo: { transactionHash: BitcoinTxHash outputIndex: number - value: BigNumber } = { transactionHash: BitcoinTxHash.from( "2f952bdc206bf51bb745b967cb7166149becada878d3191ffe341155ebcd4883", ), outputIndex: 1, - value: BigNumber.from(3933200), } export { depositTestData, receiptTestData, revealTestData, fundingUtxo } diff --git a/sdk/test/modules/tbtc/Deposit.test.ts b/sdk/test/modules/tbtc/Deposit.test.ts index 5e6e48937..c0b149c63 100644 --- a/sdk/test/modules/tbtc/Deposit.test.ts +++ b/sdk/test/modules/tbtc/Deposit.test.ts @@ -57,6 +57,7 @@ describe("Deposit", () => { // Second attempt. Deposit not funded yet. .mockResolvedValueOnce([]) // Third attempt. Deposit funded. + // @ts-expect-error The missing `value` property is not used in the code. .mockResolvedValueOnce([fundingUtxo]) txPromise = deposit.waitForFunding({