Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix isValidBtcAddress function #577

Merged
merged 1 commit into from
Jul 24, 2023
Merged

Conversation

r-czajkowski
Copy link
Collaborator

Pass correct value to the validate function from bitcoin-address-validation package. The toBcoinNetwork function from tbtc-v2.ts lib returns the network as string expected by the bcoin lib(meaning main or testnet). The bitcoin-address-validation package expects mainnet or testnet that match the enumerated BitcoinNetwork values from tbtc-v2.ts lib. Here we call valuesOf on the BitcoinNetwork enum to get the expected network as string by the bitcoin-address-validation package.

Pass correct value to the `validate` function from
`bitcoin-address-validation` package. The `toBcoinNetwork` function from
`tbtc-v2.ts` lib returns the network as string expected by the `bcoin`
lib(meaning `main` or `testnet`). The `bitcoin-address-validation`
package expects `mainnet` or `testnet` that match the enumerated
`BitcoinNetwork` values from `tbtc-v2.ts` lib. Here we call `valuesOf`
on the `BitcoinNetwork` enum to get the expected network as string by
the `bitcoin-address-validation` package.
@r-czajkowski r-czajkowski added this to the v1.9.0 milestone Jul 24, 2023
@lukasz-zimnoch lukasz-zimnoch merged commit 15dbccb into main Jul 24, 2023
5 checks passed
@lukasz-zimnoch lukasz-zimnoch deleted the fix-btc-address-validation branch July 24, 2023 19:07
@github-actions
Copy link

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