From 7cc824e9b5768375d8d0770258f35bd67845698e Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Sat, 12 Feb 2022 22:08:08 +0100 Subject: [PATCH 1/5] chainhash: make module --- chaincfg/chainhash/go.mod | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 chaincfg/chainhash/go.mod diff --git a/chaincfg/chainhash/go.mod b/chaincfg/chainhash/go.mod new file mode 100644 index 00000000..1d865254 --- /dev/null +++ b/chaincfg/chainhash/go.mod @@ -0,0 +1,3 @@ +module github.com/btcsuite/btcd/chaincfg/chainhash + +go 1.17 From 4ad74cd4c261ab6cbb81b9ee441fc5b0e83be58b Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 8 Mar 2022 16:09:59 +0100 Subject: [PATCH 2/5] mod: use chaincfg/chainhash module --- btcec/go.mod | 6 +----- btcutil/go.mod | 1 + btcutil/psbt/go.mod | 1 + go.mod | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/btcec/go.mod b/btcec/go.mod index 53e4a1f5..bc8cf721 100644 --- a/btcec/go.mod +++ b/btcec/go.mod @@ -3,13 +3,9 @@ module github.com/btcsuite/btcd/btcec/v2 go 1.17 require ( - github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c + github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 github.com/davecgh/go-spew v1.1.1 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 ) require github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect - -// We depend on chainhash as is, so we need to replace to use the version of -// chainhash included in the version of btcd we're building in. -replace github.com/btcsuite/btcd => ../ diff --git a/btcutil/go.mod b/btcutil/go.mod index d3e460e5..50fe915d 100644 --- a/btcutil/go.mod +++ b/btcutil/go.mod @@ -6,6 +6,7 @@ require ( github.com/aead/siphash v1.0.1 github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c github.com/btcsuite/btcd/btcec/v2 v2.1.0 + github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 github.com/davecgh/go-spew v1.1.1 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 diff --git a/btcutil/psbt/go.mod b/btcutil/psbt/go.mod index 3897bf99..fbf3fe60 100644 --- a/btcutil/psbt/go.mod +++ b/btcutil/psbt/go.mod @@ -6,6 +6,7 @@ require ( github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c github.com/btcsuite/btcd/btcec/v2 v2.1.0 github.com/btcsuite/btcd/btcutil v1.1.0 + github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 github.com/davecgh/go-spew v1.1.1 ) diff --git a/go.mod b/go.mod index 7158ca24..d0825bf9 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/btcsuite/btcd require ( github.com/btcsuite/btcd/btcec/v2 v2.1.0 github.com/btcsuite/btcd/btcutil v1.1.0 + github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 From 56dfa0f7e21b00b87d95bf3b28e490d4e57de292 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 8 Mar 2022 16:10:12 +0100 Subject: [PATCH 3/5] mod: add temporary replace --- btcec/go.mod | 5 +++++ btcutil/go.mod | 5 +++++ btcutil/psbt/go.mod | 5 +++++ go.mod | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/btcec/go.mod b/btcec/go.mod index bc8cf721..55485cab 100644 --- a/btcec/go.mod +++ b/btcec/go.mod @@ -9,3 +9,8 @@ require ( ) require github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect + +// We depend on chainhash as is, so we need to replace to use the version of +// chainhash included in the version of btcd we're building in. +// TODO(guggero): Remove this as soon as we have a tagged version of chainhash. +replace github.com/btcsuite/btcd/chaincfg/chainhash => ../chaincfg/chainhash diff --git a/btcutil/go.mod b/btcutil/go.mod index 50fe915d..142db484 100644 --- a/btcutil/go.mod +++ b/btcutil/go.mod @@ -16,3 +16,8 @@ require ( replace github.com/btcsuite/btcd/btcec/v2 => ../btcec replace github.com/btcsuite/btcd => ../ + +// We depend on chainhash as is, so we need to replace to use the version of +// chainhash included in the version of btcd we're building in. +// TODO(guggero): Remove this as soon as we have a tagged version of chainhash. +replace github.com/btcsuite/btcd/chaincfg/chainhash => ../chaincfg/chainhash diff --git a/btcutil/psbt/go.mod b/btcutil/psbt/go.mod index fbf3fe60..bd209d07 100644 --- a/btcutil/psbt/go.mod +++ b/btcutil/psbt/go.mod @@ -21,3 +21,8 @@ replace github.com/btcsuite/btcd/btcec/v2 => ../../btcec replace github.com/btcsuite/btcd/btcutil => ../ replace github.com/btcsuite/btcd => ../.. + +// We depend on chainhash as is, so we need to replace to use the version of +// chainhash included in the version of btcd we're building in. +// TODO(guggero): Remove this as soon as we have a tagged version of chainhash. +replace github.com/btcsuite/btcd/chaincfg/chainhash => ../../chaincfg/chainhash diff --git a/go.mod b/go.mod index d0825bf9..a38e644d 100644 --- a/go.mod +++ b/go.mod @@ -27,6 +27,11 @@ replace github.com/btcsuite/btcd/btcutil => ./btcutil replace github.com/btcsuite/btcd/btcec/v2 => ./btcec +// We depend on chainhash as is, so we need to replace to use the version of +// chainhash included in the version of btcd we're building in. +// TODO(guggero): Remove this as soon as we have a tagged version of chainhash. +replace github.com/btcsuite/btcd/chaincfg/chainhash => ./chaincfg/chainhash + // The retract statements below fixes an accidental push of the tags of a btcd // fork. retract ( From 46f5eec021208616a05691362458912caa2d16c1 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 8 Mar 2022 16:15:14 +0100 Subject: [PATCH 4/5] mod: bump btcec/v2 module version --- btcutil/go.mod | 2 +- btcutil/psbt/go.mod | 2 +- go.mod | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/btcutil/go.mod b/btcutil/go.mod index 142db484..b8de1c3f 100644 --- a/btcutil/go.mod +++ b/btcutil/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/aead/siphash v1.0.1 github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c - github.com/btcsuite/btcd/btcec/v2 v2.1.0 + github.com/btcsuite/btcd/btcec/v2 v2.1.1 github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 github.com/davecgh/go-spew v1.1.1 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 diff --git a/btcutil/psbt/go.mod b/btcutil/psbt/go.mod index bd209d07..ffd18701 100644 --- a/btcutil/psbt/go.mod +++ b/btcutil/psbt/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c - github.com/btcsuite/btcd/btcec/v2 v2.1.0 + github.com/btcsuite/btcd/btcec/v2 v2.1.1 github.com/btcsuite/btcd/btcutil v1.1.0 github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 github.com/davecgh/go-spew v1.1.1 diff --git a/go.mod b/go.mod index a38e644d..77d930dd 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/btcsuite/btcd require ( - github.com/btcsuite/btcd/btcec/v2 v2.1.0 + github.com/btcsuite/btcd/btcec/v2 v2.1.1 github.com/btcsuite/btcd/btcutil v1.1.0 github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f From 999514c1fe1e3338c3f6f3597186726f7c08f343 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 8 Mar 2022 16:16:16 +0100 Subject: [PATCH 5/5] mod: add TODOs for removing local replaces --- btcutil/go.mod | 1 + btcutil/psbt/go.mod | 1 + go.mod | 1 + 3 files changed, 3 insertions(+) diff --git a/btcutil/go.mod b/btcutil/go.mod index b8de1c3f..e6451e4e 100644 --- a/btcutil/go.mod +++ b/btcutil/go.mod @@ -13,6 +13,7 @@ require ( golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 ) +// TODO(guggero): Remove this as soon as we have a tagged version of btcec/v2. replace github.com/btcsuite/btcd/btcec/v2 => ../btcec replace github.com/btcsuite/btcd => ../ diff --git a/btcutil/psbt/go.mod b/btcutil/psbt/go.mod index ffd18701..7ae2dcb8 100644 --- a/btcutil/psbt/go.mod +++ b/btcutil/psbt/go.mod @@ -16,6 +16,7 @@ require ( golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect ) +// TODO(guggero): Remove this as soon as we have a tagged version of btcec/v2. replace github.com/btcsuite/btcd/btcec/v2 => ../../btcec replace github.com/btcsuite/btcd/btcutil => ../ diff --git a/go.mod b/go.mod index 77d930dd..e56d76e3 100644 --- a/go.mod +++ b/go.mod @@ -25,6 +25,7 @@ require ( replace github.com/btcsuite/btcd/btcutil => ./btcutil +// TODO(guggero): Remove this as soon as we have a tagged version of btcec/v2. replace github.com/btcsuite/btcd/btcec/v2 => ./btcec // We depend on chainhash as is, so we need to replace to use the version of