-
Notifications
You must be signed in to change notification settings - Fork 285
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
Sync up with bitcoinjs-lib 6 #2054
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good overall
please use https://www.conventionalcommits.org/en/v1.0.0/ for commits and mention which ref or tag you pulled the TransactionBuilder
code from in the upstream repo
modules/utxo-lib/src/networks.ts
Outdated
bech32?: string; | ||
bech32: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match the Network type from bitocinjs-lib
I'd love a better idea if you have one. I considered changing the upstream type in my "BitGo specific" commit, but it looked like it would become a maintenance pain.
"9f74390b6c7f5988772a909fc689a3e2dd680ceb8d54d4caffdd5907132bc415d7d964f4b25ce02690938cd4b62057f80b929aca4155c64db205a336b2e6ce79", | ||
"69a969c8df93bc7894d045bc5e5d73f50d815fed7f703f11080f6b46561220156a0eed3382ec0eddbfa2737a29a7b07ba572880ae26f05f56ebca40bd7a5a987" | ||
"a2074b68b115e970c8c4bee9cf75c03b82bd3e3086d58801a4adb7b31b9b5f2cea4a5615a4feef74b61db6d765bb814feaf27331fad128dda55cfe106d25d44e", | ||
"6bace9d49a0a7617e8ab40cd5361257829c0f09809d6f70ce130a70d7af3de1bf7409cbe379481e0494b32531b955fff67825cd969a3e95fc853c048692feda1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the PR description:
Schnorr signatures changed because lack of extra nonce data is now empty buffer instead of skipped`
modules/utxo-lib/test/networks.ts
Outdated
assert.strictEqual(typeof (network as any).bech32, bech32Coins(network) ? 'string' : 'undefined'); | ||
assert.strictEqual(typeof (network as any).bech32, 'string'); | ||
if (!bech32Coins(network)) { | ||
assert.strictEqual((network as any).bech32.length, 0); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO undefined
is better than zero-length string here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No disagreement, but that's not what the upstream type has.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed it so we do not use the upstream type anymore: 6f553c0
bbfb6cf
to
f185efe
Compare
Improved commit history, formatted code, and tidied up |
0b62e1f
to
e30785c
Compare
Codecov Report
@@ Coverage Diff @@
## master #2054 +/- ##
===========================================
+ Coverage 0 85.92% +85.92%
===========================================
Files 0 169 +169
Lines 0 8504 +8504
Branches 0 1275 +1275
===========================================
+ Hits 0 7307 +7307
- Misses 0 781 +781
- Partials 0 416 +416
Flags with carried forward coverage won't be shown. Click here to find out more.
|
009762f
to
3392077
Compare
These files were removed from bitcoinjs-lib in version 6, but we're not ready to give them up quite yet. Imported from BitGo/bitcionjs-lib/165f26ae18082158e531b607fcc7245ad641e263 Issue: BG-41154
* Schnorr signatures changed because lack of extra nonce data is now empty buffer instead of skipped * tiny-secp256k1 no longer works in browser w/o WASM support, so switched crypto implementation to noble-secp256k1 * Required some moderately extensive changes to noble-secp256k1 paulmillr/noble-secp256k1#50 Issue: BG-41154
Let's ignore this rule for now since it makes importing bitcoinjs-lib code more difficult. Issue: BG-41154
Mostly braces around `if` blocks Issue: BG-41154
Since TransactionBuilder now lives in `utxo-lib`, we can change the interface and remove the dependency on `bitcoinjs-lib.Network` Issue: BG-41154
Not required for updated utxolib/bitcoinjs-lib Issue: BG-41154
Ideally dependent packages should define those themselves but we will use this shortcut for now so we do not have to depend on the custom secp256k1 package everywhere. Issue: BG-41154
* bump `bip32` package to v3 * use `bip32: BIP32API` type from `@bitgo/utxo-lib` * use `bip32: BIP32Interface` type from `bip32` package This has the unfortunate downside that we are depending on `@bitgo/utxo-lib` for bip32 again, after we removed this dependency in earlier commits. We should fix this by instantiating `bip32: BIP32API` per package. However this is not easy to do here since we are depending on a slightly exotic secp256k1 library in `@bitgo/utxo-lib` and I don't want to depend on that directly in `BitGoJS` yet. Issue: BG-41154
P2TR/Schorr transaction changes due to change in extra nonce data See f185efebfe330f1ff786694b2703d76ebb87e71a for details Issue: BG-41154
P2TR/Schorr transaction changes due to change in extra nonce data See f185efebfe330f1ff786694b2703d76ebb87e71a for details Issue: BG-41154
Issues: BG-41154
3392077
to
f0a9102
Compare
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This PR was closed because it has been stalled for 10 days with no activity. |
This is a pretty major change: