Skip to content

Commit

Permalink
Fix sortsignsend test
Browse files Browse the repository at this point in the history
  • Loading branch information
cpacia committed May 28, 2018
1 parent 7377422 commit 6b2ba99
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
16 changes: 2 additions & 14 deletions blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,18 +432,6 @@ func TestBlockchain_checkProofOfWork(t *testing.T) {
}
}

func TestBlockchain_SetChainState(t *testing.T) {
bc, err := NewBlockchain("", MockCreationTime, &chaincfg.RegressionNetParams)
if err != nil {
t.Error(err)
}
bc.SetChainState(WAITING)
if bc.ChainState() != WAITING {
t.Error("Failed to set chainstate correctly")
}
os.RemoveAll("headers.bin")
}

func TestBlockchain_calcDiffAdjust(t *testing.T) {

// Test calculation of next difficulty target with no constraints applying
Expand Down Expand Up @@ -487,7 +475,7 @@ func TestBlockchain_calcDiffAdjust(t *testing.T) {
}
}

func TestBlockchain_GetBlockLocatorHashes(t *testing.T) {
func TestBlockchain_GetBlockLocator(t *testing.T) {
bc, err := NewBlockchain("", MockCreationTime, &chaincfg.RegressionNetParams)
if err != nil {
t.Error(err)
Expand Down Expand Up @@ -517,7 +505,7 @@ func TestBlockchain_GetBlockLocatorHashes(t *testing.T) {
headers = append(headers, hdr)
}

nHashes := bc.GetBlockLocatorHashes()
nHashes := bc.GetBlockLocator()
for i := 0; i < 10; i++ {
h := headers[(len(headers)-1)-i].BlockHash()
if !nHashes[i].IsEqual(&h) {
Expand Down
1 change: 0 additions & 1 deletion sortsignsend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ func MockWallet() *SPVWallet {
peerCfg := &PeerManagerConfig{
UserAgentVersion: WALLET_VERSION,
Params: &chaincfg.TestNet3Params,
GetFilter: txstore.GimmeFilter,
}

bc, _ := NewBlockchain("", MockCreationTime, &chaincfg.TestNet3Params)
Expand Down
4 changes: 2 additions & 2 deletions txstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ func TestTxStore_GimmeFilter(t *testing.T) {
if err != nil {
t.Error(err)
}
op := wire.NewOutPoint(maxHash, 0)
op := wire.NewOutPoint(&zeroHash, 0)
err = txStore.Utxos().Put(wallet.Utxo{Op: *op})
if err != nil {
t.Error(err)
}
op2 := wire.NewOutPoint(maxHash, 1)
op2 := wire.NewOutPoint(&zeroHash, 1)
err = txStore.Stxos().Put(wallet.Stxo{Utxo: wallet.Utxo{Op: *op2}})
if err != nil {
t.Error(err)
Expand Down

0 comments on commit 6b2ba99

Please sign in to comment.