diff --git a/typescript/src/bitcoin.ts b/typescript/src/bitcoin.ts index ceffb0fca..4abc66599 100644 --- a/typescript/src/bitcoin.ts +++ b/typescript/src/bitcoin.ts @@ -633,7 +633,7 @@ export function createOutputScriptFromAddress(address: string): Hex { * @param network Bitcoin network. * @returns The Bitcoin address. */ -export function getAddressFromScriptPubKey( +export function createAddressFromOutputScript( scriptPubKey: string, network: BitcoinNetwork = BitcoinNetwork.Mainnet ): string { diff --git a/typescript/test/bitcoin.test.ts b/typescript/test/bitcoin.test.ts index b581fb78e..ce525b06d 100644 --- a/typescript/test/bitcoin.test.ts +++ b/typescript/test/bitcoin.test.ts @@ -12,7 +12,7 @@ import { bitsToTarget, targetToDifficulty, createOutputScriptFromAddress, - getAddressFromScriptPubKey, + createAddressFromOutputScript, } from "../src/bitcoin" import { calculateDepositRefundLocktime } from "../src/deposit" import { BitcoinNetwork } from "../src/bitcoin-network" @@ -493,7 +493,7 @@ describe("Bitcoin", () => { btcAddresses[bitcoinNetwork as keyof typeof btcAddresses] ).forEach(([addressType, { address, scriptPubKey }]) => { it(`should return correct ${addressType} address`, () => { - const result = getAddressFromScriptPubKey( + const result = createAddressFromOutputScript( scriptPubKey, bitcoinNetwork === "mainnet" ? BitcoinNetwork.Mainnet