diff --git a/typescript/src/services/deposits/deposit.ts b/typescript/src/services/deposits/deposit.ts index 690cb4db3..c21c639ed 100644 --- a/typescript/src/services/deposits/deposit.ts +++ b/typescript/src/services/deposits/deposit.ts @@ -77,7 +77,7 @@ export class Deposit { /** * Detects Bitcoin funding transactions transferring BTC to this deposit. - * @return Specific UTXOs targeting this deposit. Empty array in case + * @returns Specific UTXOs targeting this deposit. Empty array in case * there are no UTXOs referring this deposit. */ async detectFunding(): Promise { diff --git a/typescript/test/services/deposits.test.ts b/typescript/test/services/deposits.test.ts index 81fa9a030..8d2a38339 100644 --- a/typescript/test/services/deposits.test.ts +++ b/typescript/test/services/deposits.test.ts @@ -672,6 +672,30 @@ describe("Deposits", () => { describe("Deposit", () => { // TODO: Implement unit tests for other functions. + describe("getBitcoinAddress", () => { + let bitcoinClient: MockBitcoinClient + let tbtcContracts: MockTBTCContracts + let depositService: Deposit + let bitcoinAddress: string + + beforeEach(async () => { + bitcoinClient = new MockBitcoinClient() + tbtcContracts = new MockTBTCContracts() + depositService = await Deposit.fromReceipt( + deposit, + tbtcContracts, + bitcoinClient + ) + bitcoinAddress = await depositService.getBitcoinAddress() + }) + + it("should return correct address", () => { + expect(bitcoinAddress).to.be.equal( + "tb1qma629cu92skg0t86lftyaf9uflzwhp7jk63h6mpmv3ezh6puvdhs6w2r05" + ) + }) + }) + describe("detectFunding", () => { let bitcoinClient: MockBitcoinClient let tbtcContracts: MockTBTCContracts