btcsuite / btcutil

Provides bitcoin-specific convenience functions and types
480 stars 410 forks source link

btcutil: update module to v2 #197

Closed Roasbeef closed 2 years ago

Roasbeef commented 3 years ago

In this commit, we update the top-level go module as well as all the relevant imports to point to the new v2 version of the module. This change is long overdue after a breaking change was made to the hdkeychain package to fix a BIP 32 implementation divergence. A follow up PR will also update the psbt module as well as significant changes have been made to the API and logic since it was first added.

Fixes #193

Roasbeef commented 3 years ago

Running into a bit of a chicken and the egg here:

--- FAIL: TestUseBlockHash (0.00s)
    builder_test.go:89: Address script build failed: unable to generate payment script for unsupported address type *btcutil.AddressScriptHash

txscript is still using the v1 version of the module, and PayToAddrScript does a type assertion to know which script to generate.

Ofc, we can't update txscript yet as the module doesn't really exist (v2, this PR switches things over but doesn't include the tag)....

Short term workaround would be to skip the test for now, then work on switching everything over on the btcd end, then make a final update here (which includes making everything a sub-module?).

Roasbeef commented 2 years ago

Replaced by https://github.com/btcsuite/btcd/pull/1785