chaincfg: add own module, use v2

This commit is contained in:
Oliver Gugger 2023-12-19 14:12:45 +01:00 committed by Olaoluwa Osuntokun
parent 039baa2520
commit bd65d6d6bb
9 changed files with 48 additions and 11 deletions

View file

@ -3,7 +3,7 @@ chaincfg
[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions)
[![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org)
[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/chaincfg)
[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/chaincfg/v2)
Package chaincfg defines chain configuration parameters for the three standard
Bitcoin networks and provides the ability for callers to define their own custom
@ -25,7 +25,7 @@ import (
"log"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/v2"
)
var testnet = flag.Bool("testnet", false, "operate on the testnet Bitcoin network")
@ -56,7 +56,7 @@ func main() {
## Installation and Updating
```bash
$ go get -u github.com/btcsuite/btcd/chaincfg
$ go get -u github.com/btcsuite/btcd/chaincfg/v2
```
## GPG Verification Key

View file

@ -4,7 +4,7 @@ import (
"fmt"
"time"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcd/wire/v2"
)
var (

View file

@ -26,7 +26,7 @@
// "log"
//
// "github.com/btcsuite/btcd/btcutil"
// "github.com/btcsuite/btcd/chaincfg"
// "github.com/btcsuite/btcd/chaincfg/v2"
// )
//
// var testnet = flag.Bool("testnet", false, "operate on the testnet Bitcoin network")

View file

@ -7,8 +7,8 @@ package chaincfg
import (
"time"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcd/chainhash/v2"
"github.com/btcsuite/btcd/wire/v2"
)
// genesisCoinbaseTx is the coinbase transaction for the genesis blocks for

23
chaincfg/go.mod Normal file
View file

@ -0,0 +1,23 @@
module github.com/btcsuite/btcd/chaincfg/v2
go 1.23.2
require (
github.com/btcsuite/btcd/chainhash/v2 v2.0.0
github.com/btcsuite/btcd/wire/v2 v2.0.0
github.com/davecgh/go-spew v1.1.1
github.com/stretchr/testify v1.10.0
)
require (
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/crypto v0.40.0 // indirect
golang.org/x/sys v0.35.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
// TODO(guggero): Remove once we have a tagged version of the chainhash package.
replace github.com/btcsuite/btcd/chainhash/v2 => ../chainhash
// TODO(guggero): Remove once we have a tagged version of the wire package.
replace github.com/btcsuite/btcd/wire/v2 => ../wire

14
chaincfg/go.sum Normal file
View file

@ -0,0 +1,14 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View file

@ -13,8 +13,8 @@ import (
"strings"
"time"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcd/chainhash/v2"
"github.com/btcsuite/btcd/wire/v2"
)
// These variables are the chain proof-of-work limit parameters for each default

View file

@ -10,7 +10,7 @@ import (
"math/big"
"testing"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcd/wire/v2"
"github.com/stretchr/testify/require"
)

View file

@ -6,7 +6,7 @@ import (
"strings"
"testing"
. "github.com/btcsuite/btcd/chaincfg"
. "github.com/btcsuite/btcd/chaincfg/v2"
)
// Define some of the required parameters for a user-registered