Replace PR #184: Validate Generated Addresses Against Expected Ones in JS Client Library #189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces the earlier PR #184, which had issues due to a faulty rebase operation. Like the previous one, it aims to address issue #171 by implementing an enhanced validation method in the JavaScript client library. It validates the generated wallet addresses against the expected ones using the "@bitcoinerlab/descriptors" library. Here are the key updates:
Updated package.json to incorporate new dependencies "@bitcoinerlab/descriptors" and "@bitcoinerlab/secp256k1", and the latest version of "bitcoinjs-lib" to "^6.1.3".
Introduced a new test in appClient.test.ts to validate the generated address or throw an error if it doesn't match the expected one.
Made modifications in appClient.ts to integrate new imports. Changes have been made to the
AppClient
class to use these libraries for address validation. Some previous validations were removed as they are now handled more effectively with the new approach.In response to the review comments on the previous PR, I've:
registerWallet
.validatePolicy
withvalidateAddress
and removedcontainsA
.<M;N>
format. Included a test case using this format for better clarity.For further context and details, please refer to the discussion and changes in the previous PR #184.