Skip to content

Conversation

annazhlb
Copy link
Collaborator

@annazhlb annazhlb commented Aug 14, 2025

packages/core/src/utils/fixtures/getBitcoinAddress.ts

  • added helper for random generation of P2WPKH, P2SH-P2WPKH, and P2TR address types on mainnet, testnet, and regtest networks.
  • This helper function returns objects of type bitcoin.payments.Payment.
  • Also, this function returns an account for each address type.

Copy link

vercel bot commented Aug 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
rune-etcher Ignored Ignored Aug 22, 2025 1:38pm

@annazhlb annazhlb changed the title test: (getAddressType): added tests test(core): add tests for getAddressType Aug 15, 2025
expect(getAddressType(p2trRegtest!)).toBe("p2tr");
});

it("returns P2PKH type", () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we won't support P2PKH addresses in the nearest future

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed.

});

it("returns P2TR type", () => {
const { address: p2trMainnet } = bitcoin.payments.p2tr({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

	const p2wpkhMainnetAddress = bitcoin.payments.p2sh({
			redeem: bitcoin.payments.p2wpkh({
				pubkey: keyPairMainnet.publicKey,
				network: mainnet,
			}),
			network: mainnet,
		}).address as string;


let's do like this an we can opt out biome ingores

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

biome ignores are no longer used.
an string type is now provided for the address when calling the function

Copy link

codecov bot commented Aug 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@annazhlb annazhlb requested a review from opcode0x August 22, 2025 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants