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
Compare generated taproot addresses with the expected ones in the JS client library #171
Comments
For Javascript, you can use https://bitcoinerlab.com/modules/descriptors |
Thanks! Would that work for taproot scripts, as well? |
Ah, I see your point regarding the circular dependency. To resolve this, I could attempt to decouple the hardware wallet integration as you say. Alternatively, it might be worth considering importing As for your question about taproot scripts, the current version does not support it. I haven't started incorporating taproot functionality as of yet. Is this a necessary requirement? |
I'm having trouble reproducing the circular dependency issue you mentioned. I suspect that my assumptions about the workflow might be different from what you're actually trying to do. From my understanding, you're intending to add tests using a third-party library. This library would compute addresses for a descriptor, which you would then compare with the results from the Ledger client, correct? Here are the steps I took for a quick test, based on my understanding: cd bitcoin_client_js/
npm install --save-dev @bitcoinerlab/secp256k1
npm install --save-dev @bitcoinerlab/descriptors Then I created a test in import * as secp256k1 from '@bitcoinerlab/secp256k1';
import * as descriptors from '@bitcoinerlab/descriptors';
const { Descriptor } = descriptors.DescriptorsFactory(secp256k1);
describe('BitcoinerLab Quick Experiment', () => {
const descriptor = new Descriptor({
expression:
'wpkh(02f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9)'
});
const address = descriptor.getAddress();
it('same address', () => {
expect('bc1q0ht9tyks4vh7p5p904t340cr9nvahy7u3re7zg').toEqual(address);
});
}); Running the test with
EDIT2: After further inspection of the PR referenced in this issue, I now understand the context better. It appears you're aiming to conduct runtime tests, not offline ones, which means this would not be a devDependency. I'll revisit the idea of either decoupling the packages or using it as a peerDependency. |
Solved for Segwit in #189, still to do for Taproot Scripts. |
Solved for the python client (all address types) in #227. |
#166 solved this for the Python and Rust clients; still to do for the JS client.
The text was updated successfully, but these errors were encountered: