Update tests to use btcnet genesis params.
This commit is contained in:
parent
b0b090009a
commit
87bef61b30
3 changed files with 5 additions and 4 deletions
|
@ -6,6 +6,7 @@ package btcchain_test
|
|||
|
||||
import (
|
||||
"github.com/conformal/btcchain"
|
||||
"github.com/conformal/btcnet"
|
||||
"github.com/conformal/btcutil"
|
||||
"github.com/conformal/btcwire"
|
||||
"testing"
|
||||
|
@ -65,7 +66,7 @@ func TestHaveBlock(t *testing.T) {
|
|||
want bool
|
||||
}{
|
||||
// Genesis block should be present (in the main chain).
|
||||
{hash: btcwire.GenesisHash.String(), want: true},
|
||||
{hash: btcnet.MainNetParams.GenesisHash.String(), want: true},
|
||||
|
||||
// Block 3a should be present (on a side chain).
|
||||
{hash: "00000000474284d20067a4d33f6a02284e6ef70764a3a26d6a5b9df52ef663dd", want: true},
|
||||
|
|
|
@ -12,7 +12,6 @@ import (
|
|||
_ "github.com/conformal/btcdb/memdb"
|
||||
"github.com/conformal/btcnet"
|
||||
"github.com/conformal/btcutil"
|
||||
"github.com/conformal/btcwire"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
@ -103,7 +102,7 @@ func chainSetup(dbName string) (*btcchain.BlockChain, func(), error) {
|
|||
|
||||
// Insert the main network genesis block. This is part of the initial
|
||||
// database setup.
|
||||
genesisBlock := btcutil.NewBlock(&btcwire.GenesisBlock)
|
||||
genesisBlock := btcutil.NewBlock(btcnet.MainNetParams.GenesisBlock)
|
||||
_, err := db.InsertBlock(genesisBlock)
|
||||
if err != nil {
|
||||
teardown()
|
||||
|
|
|
@ -33,7 +33,8 @@ func TestCheckConnectBlock(t *testing.T) {
|
|||
|
||||
// The genesis block should fail to connect since it's already
|
||||
// inserted.
|
||||
err = chain.CheckConnectBlock(btcutil.NewBlock(&btcwire.GenesisBlock))
|
||||
genesisBlock := btcnet.MainNetParams.GenesisBlock
|
||||
err = chain.CheckConnectBlock(btcutil.NewBlock(genesisBlock))
|
||||
if err == nil {
|
||||
t.Errorf("CheckConnectBlock: Did not received expected error")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue