Update btcwire path import paths to new location.

This commit is contained in:
Dave Collins 2015-02-05 12:58:30 -06:00
parent 612ff7f813
commit 4dd7c939ed
3 changed files with 41 additions and 41 deletions

2
doc.go
View File

@ -12,7 +12,7 @@
// For library packages, btcnet provides the ability to lookup chain parameters
// and encoding magics when passed a *Params. Older APIs not updated to the new
// convention of passing a *Params may lookup the parameters for a
// btcwire.BitcoinNet using ParamsForNet, but be aware that this usage is
// wire.BitcoinNet using ParamsForNet, but be aware that this usage is
// deprecated and will be removed from btcnet in the future.
//
// For main packages, a (typically global) var may be assigned the address of

View File

@ -7,17 +7,17 @@ package btcnet
import (
"time"
"github.com/btcsuite/btcwire"
"github.com/btcsuite/btcd/wire"
)
// genesisCoinbaseTx is the coinbase transaction for the genesis blocks for
// the main network, regression test network, and test network (version 3).
var genesisCoinbaseTx = btcwire.MsgTx{
var genesisCoinbaseTx = wire.MsgTx{
Version: 1,
TxIn: []*btcwire.TxIn{
TxIn: []*wire.TxIn{
{
PreviousOutPoint: btcwire.OutPoint{
Hash: btcwire.ShaHash{},
PreviousOutPoint: wire.OutPoint{
Hash: wire.ShaHash{},
Index: 0xffffffff,
},
SignatureScript: []byte{
@ -35,7 +35,7 @@ var genesisCoinbaseTx = btcwire.MsgTx{
Sequence: 0xffffffff,
},
},
TxOut: []*btcwire.TxOut{
TxOut: []*wire.TxOut{
{
Value: 0x12a05f200,
PkScript: []byte{
@ -56,7 +56,7 @@ var genesisCoinbaseTx = btcwire.MsgTx{
// genesisHash is the hash of the first block in the block chain for the main
// network (genesis block).
var genesisHash = btcwire.ShaHash([btcwire.HashSize]byte{ // Make go vet happy.
var genesisHash = wire.ShaHash([wire.HashSize]byte{ // Make go vet happy.
0x6f, 0xe2, 0x8c, 0x0a, 0xb6, 0xf1, 0xb3, 0x72,
0xc1, 0xa6, 0xa2, 0x46, 0xae, 0x63, 0xf7, 0x4f,
0x93, 0x1e, 0x83, 0x65, 0xe1, 0x5a, 0x08, 0x9c,
@ -65,7 +65,7 @@ var genesisHash = btcwire.ShaHash([btcwire.HashSize]byte{ // Make go vet happy.
// genesisMerkleRoot is the hash of the first transaction in the genesis block
// for the main network.
var genesisMerkleRoot = btcwire.ShaHash([btcwire.HashSize]byte{ // Make go vet happy.
var genesisMerkleRoot = wire.ShaHash([wire.HashSize]byte{ // Make go vet happy.
0x3b, 0xa3, 0xed, 0xfd, 0x7a, 0x7b, 0x12, 0xb2,
0x7a, 0xc7, 0x2c, 0x3e, 0x67, 0x76, 0x8f, 0x61,
0x7f, 0xc8, 0x1b, 0xc3, 0x88, 0x8a, 0x51, 0x32,
@ -74,21 +74,21 @@ var genesisMerkleRoot = btcwire.ShaHash([btcwire.HashSize]byte{ // Make go vet h
// genesisBlock defines the genesis block of the block chain which serves as the
// public transaction ledger for the main network.
var genesisBlock = btcwire.MsgBlock{
Header: btcwire.BlockHeader{
var genesisBlock = wire.MsgBlock{
Header: wire.BlockHeader{
Version: 1,
PrevBlock: btcwire.ShaHash{}, // 0000000000000000000000000000000000000000000000000000000000000000
PrevBlock: wire.ShaHash{}, // 0000000000000000000000000000000000000000000000000000000000000000
MerkleRoot: genesisMerkleRoot, // 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
Timestamp: time.Unix(0x495fab29, 0), // 2009-01-03 18:15:05 +0000 UTC
Bits: 0x1d00ffff, // 486604799 [00000000ffff0000000000000000000000000000000000000000000000000000]
Nonce: 0x7c2bac1d, // 2083236893
},
Transactions: []*btcwire.MsgTx{&genesisCoinbaseTx},
Transactions: []*wire.MsgTx{&genesisCoinbaseTx},
}
// regTestGenesisHash is the hash of the first block in the block chain for the
// regression test network (genesis block).
var regTestGenesisHash = btcwire.ShaHash([btcwire.HashSize]byte{ // Make go vet happy.
var regTestGenesisHash = wire.ShaHash([wire.HashSize]byte{ // Make go vet happy.
0x06, 0x22, 0x6e, 0x46, 0x11, 0x1a, 0x0b, 0x59,
0xca, 0xaf, 0x12, 0x60, 0x43, 0xeb, 0x5b, 0xbf,
0x28, 0xc3, 0x4f, 0x3a, 0x5e, 0x33, 0x2a, 0x1f,
@ -102,21 +102,21 @@ var regTestGenesisMerkleRoot = genesisMerkleRoot
// regTestGenesisBlock defines the genesis block of the block chain which serves
// as the public transaction ledger for the regression test network.
var regTestGenesisBlock = btcwire.MsgBlock{
Header: btcwire.BlockHeader{
var regTestGenesisBlock = wire.MsgBlock{
Header: wire.BlockHeader{
Version: 1,
PrevBlock: btcwire.ShaHash{}, // 0000000000000000000000000000000000000000000000000000000000000000
PrevBlock: wire.ShaHash{}, // 0000000000000000000000000000000000000000000000000000000000000000
MerkleRoot: regTestGenesisMerkleRoot, // 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
Timestamp: time.Unix(1296688602, 0), // 2011-02-02 23:16:42 +0000 UTC
Bits: 0x207fffff, // 545259519 [7fffff0000000000000000000000000000000000000000000000000000000000]
Nonce: 2,
},
Transactions: []*btcwire.MsgTx{&genesisCoinbaseTx},
Transactions: []*wire.MsgTx{&genesisCoinbaseTx},
}
// testNet3GenesisHash is the hash of the first block in the block chain for the
// test network (version 3).
var testNet3GenesisHash = btcwire.ShaHash([btcwire.HashSize]byte{ // Make go vet happy.
var testNet3GenesisHash = wire.ShaHash([wire.HashSize]byte{ // Make go vet happy.
0x43, 0x49, 0x7f, 0xd7, 0xf8, 0x26, 0x95, 0x71,
0x08, 0xf4, 0xa3, 0x0f, 0xd9, 0xce, 0xc3, 0xae,
0xba, 0x79, 0x97, 0x20, 0x84, 0xe9, 0x0e, 0xad,
@ -130,21 +130,21 @@ var testNet3GenesisMerkleRoot = genesisMerkleRoot
// testNet3GenesisBlock defines the genesis block of the block chain which
// serves as the public transaction ledger for the test network (version 3).
var testNet3GenesisBlock = btcwire.MsgBlock{
Header: btcwire.BlockHeader{
var testNet3GenesisBlock = wire.MsgBlock{
Header: wire.BlockHeader{
Version: 1,
PrevBlock: btcwire.ShaHash{}, // 0000000000000000000000000000000000000000000000000000000000000000
PrevBlock: wire.ShaHash{}, // 0000000000000000000000000000000000000000000000000000000000000000
MerkleRoot: testNet3GenesisMerkleRoot, // 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
Timestamp: time.Unix(1296688602, 0), // 2011-02-02 23:16:42 +0000 UTC
Bits: 0x1d00ffff, // 486604799 [00000000ffff0000000000000000000000000000000000000000000000000000]
Nonce: 0x18aea41a, // 414098458
},
Transactions: []*btcwire.MsgTx{&genesisCoinbaseTx},
Transactions: []*wire.MsgTx{&genesisCoinbaseTx},
}
// simNetGenesisHash is the hash of the first block in the block chain for the
// simulation test network.
var simNetGenesisHash = btcwire.ShaHash([btcwire.HashSize]byte{ // Make go vet happy.
var simNetGenesisHash = wire.ShaHash([wire.HashSize]byte{ // Make go vet happy.
0xf6, 0x7a, 0xd7, 0x69, 0x5d, 0x9b, 0x66, 0x2a,
0x72, 0xff, 0x3d, 0x8e, 0xdb, 0xbb, 0x2d, 0xe0,
0xbf, 0xa6, 0x7b, 0x13, 0x97, 0x4b, 0xb9, 0x91,
@ -158,14 +158,14 @@ var simNetGenesisMerkleRoot = genesisMerkleRoot
// simNetGenesisBlock defines the genesis block of the block chain which serves
// as the public transaction ledger for the simulation test network.
var simNetGenesisBlock = btcwire.MsgBlock{
Header: btcwire.BlockHeader{
var simNetGenesisBlock = wire.MsgBlock{
Header: wire.BlockHeader{
Version: 1,
PrevBlock: btcwire.ShaHash{}, // 0000000000000000000000000000000000000000000000000000000000000000
PrevBlock: wire.ShaHash{}, // 0000000000000000000000000000000000000000000000000000000000000000
MerkleRoot: simNetGenesisMerkleRoot, // 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
Timestamp: time.Unix(1401292357, 0), // 2014-05-28 15:52:37 +0000 UTC
Bits: 0x207fffff, // 545259519 [7fffff0000000000000000000000000000000000000000000000000000000000]
Nonce: 2,
},
Transactions: []*btcwire.MsgTx{&genesisCoinbaseTx},
Transactions: []*wire.MsgTx{&genesisCoinbaseTx},
}

View File

@ -8,7 +8,7 @@ import (
"errors"
"math/big"
"github.com/btcsuite/btcwire"
"github.com/btcsuite/btcd/wire"
)
// These variables are the chain proof-of-work limit parameters for each default
@ -45,7 +45,7 @@ var (
// selection criteria.
type Checkpoint struct {
Height int64
Hash *btcwire.ShaHash
Hash *wire.ShaHash
}
// Params defines a Bitcoin network by its parameters. These parameters may be
@ -53,12 +53,12 @@ type Checkpoint struct {
// and keys for one network from those intended for use on another network.
type Params struct {
Name string
Net btcwire.BitcoinNet
Net wire.BitcoinNet
DefaultPort string
// Chain parameters
GenesisBlock *btcwire.MsgBlock
GenesisHash *btcwire.ShaHash
GenesisBlock *wire.MsgBlock
GenesisHash *wire.ShaHash
PowLimit *big.Int
PowLimitBits uint32
SubsidyHalvingInterval int32
@ -97,7 +97,7 @@ type Params struct {
// MainNetParams defines the network parameters for the main Bitcoin network.
var MainNetParams = Params{
Name: "mainnet",
Net: btcwire.MainNet,
Net: wire.MainNet,
DefaultPort: "8333",
// Chain parameters
@ -162,7 +162,7 @@ var MainNetParams = Params{
// 3), this network is sometimes simply called "testnet".
var RegressionNetParams = Params{
Name: "regtest",
Net: btcwire.TestNet,
Net: wire.TestNet,
DefaultPort: "18444",
// Chain parameters
@ -211,7 +211,7 @@ var RegressionNetParams = Params{
// network is sometimes simply called "testnet".
var TestNet3Params = Params{
Name: "testnet3",
Net: btcwire.TestNet3,
Net: wire.TestNet3,
DefaultPort: "18333",
// Chain parameters
@ -266,7 +266,7 @@ var TestNet3Params = Params{
// just turn into another public testnet.
var SimNetParams = Params{
Name: "simnet",
Net: btcwire.SimNet,
Net: wire.SimNet,
DefaultPort: "18555",
// Chain parameters
@ -321,7 +321,7 @@ var (
)
var (
registeredNets = map[btcwire.BitcoinNet]struct{}{
registeredNets = map[wire.BitcoinNet]struct{}{
MainNetParams.Net: struct{}{},
TestNet3Params.Net: struct{}{},
RegressionNetParams.Net: struct{}{},
@ -409,11 +409,11 @@ func HDPrivateKeyToPublicKeyID(id []byte) ([]byte, error) {
}
// newShaHashFromStr converts the passed big-endian hex string into a
// btcwire.ShaHash. It only differs from the one available in btcwire in that
// wire.ShaHash. It only differs from the one available in wire in that
// it panics on an error since it will only (and must only) be called with
// hard-coded, and therefore known good, hashes.
func newShaHashFromStr(hexStr string) *btcwire.ShaHash {
sha, err := btcwire.NewShaHashFromStr(hexStr)
func newShaHashFromStr(hexStr string) *wire.ShaHash {
sha, err := wire.NewShaHashFromStr(hexStr)
if err != nil {
// Ordinarily I don't like panics in library code since it
// can take applications down without them having a chance to