Delete testing operations from obsolete functions.

This commit is contained in:
Dale Rahn 2013-10-02 18:10:00 -04:00
parent 8d1db93c82
commit 63f8993163
3 changed files with 3 additions and 50 deletions

View file

@ -93,26 +93,10 @@ out:
t.Errorf("referenced tx not found %v ", origintxsha) t.Errorf("referenced tx not found %v ", origintxsha)
} }
_, _, _, _, err := db.FetchTxAllBySha(origintxsha)
if err != nil {
t.Errorf("referenced tx not found %v err %v ", origintxsha, err)
}
_, _, _, _, err = db.FetchTxAllBySha(origintxsha)
if err != nil {
t.Errorf("referenced tx not found %v err %v ", origintxsha, err)
}
_, _, _, err = db.FetchTxBySha(origintxsha) _, _, _, err = db.FetchTxBySha(origintxsha)
if err != nil { if err != nil {
t.Errorf("referenced tx not found %v err %v ", origintxsha, err) t.Errorf("referenced tx not found %v err %v ", origintxsha, err)
} }
_, _, err = db.FetchTxBufBySha(origintxsha)
if err != nil {
t.Errorf("referenced tx not found %v err %v ", origintxsha, err)
}
_, err = db.FetchTxUsedBySha(origintxsha)
if err != nil {
t.Errorf("tx used fetch fail %v err %v ", origintxsha, err)
}
} }
} }
txlist := db.FetchTxByShaList(txneededList) txlist := db.FetchTxByShaList(txneededList)
@ -281,11 +265,6 @@ func testBackout(t *testing.T, mode int) {
t.Errorf("tx %v not located db\n", txsha) t.Errorf("tx %v not located db\n", txsha)
return return
} }
_, err = db.FetchTxUsedBySha(&txsha)
if err != nil {
t.Errorf("tx %v not located db\n", txsha)
return
}
} }
var savedblocks []*btcutil.Block var savedblocks []*btcutil.Block

View file

@ -84,7 +84,7 @@ out:
txin := tx.TxIn[0] txin := tx.TxIn[0]
origintxsha := &txin.PreviousOutpoint.Hash origintxsha := &txin.PreviousOutpoint.Hash
sqlite3.KillTx(db, origintxsha) sqlite3.KillTx(db, origintxsha)
_, _, _, _, err = db.FetchTxAllBySha(origintxsha) _, _, _, err = db.FetchTxBySha(origintxsha)
if err == nil { if err == nil {
t.Errorf("deleted tx found %v", origintxsha) t.Errorf("deleted tx found %v", origintxsha)
} }
@ -107,7 +107,7 @@ out:
if height == 248 { if height == 248 {
for _, tx := range mblock.Transactions { for _, tx := range mblock.Transactions {
txsha, err := tx.TxSha() txsha, err := tx.TxSha()
_, _, _, _, err = db.FetchTxAllBySha(&txsha) _, _, _, err = db.FetchTxBySha(&txsha)
if err == nil { if err == nil {
t.Errorf("referenced tx found, should not have been %v, ", txsha) t.Errorf("referenced tx found, should not have been %v, ", txsha)
} }

View file

@ -99,26 +99,10 @@ out:
t.Errorf("referenced tx not found %v ", origintxsha) t.Errorf("referenced tx not found %v ", origintxsha)
} }
_, _, _, _, err := db.FetchTxAllBySha(origintxsha)
if err != nil {
t.Errorf("referenced tx not found %v err %v ", origintxsha, err)
}
_, _, _, _, err = db.FetchTxAllBySha(origintxsha)
if err != nil {
t.Errorf("referenced tx not found %v err %v ", origintxsha, err)
}
_, _, _, err = db.FetchTxBySha(origintxsha) _, _, _, err = db.FetchTxBySha(origintxsha)
if err != nil { if err != nil {
t.Errorf("referenced tx not found %v err %v ", origintxsha, err) t.Errorf("referenced tx not found %v err %v ", origintxsha, err)
} }
_, _, err = db.FetchTxBufBySha(origintxsha)
if err != nil {
t.Errorf("referenced tx not found %v err %v ", origintxsha, err)
}
_, err = db.FetchTxUsedBySha(origintxsha)
if err != nil {
t.Errorf("tx used fetch fail %v err %v ", origintxsha, err)
}
} }
} }
txlist := db.FetchTxByShaList(txneededList) txlist := db.FetchTxByShaList(txneededList)
@ -287,17 +271,7 @@ func testBackout(t *testing.T, mode int) {
} }
_, _, _, err = db.FetchTxBySha(&txsha) _, _, _, err = db.FetchTxBySha(&txsha)
_, err = db.FetchTxUsedBySha(&txsha) _, _, _, err = db.FetchTxBySha(&txsha)
block = blocks[99]
mblock = block.MsgBlock()
txsha, err = mblock.Transactions[0].TxSha()
oldused, err := db.FetchTxUsedBySha(&txsha)
err = db.InsertTx(&txsha, 99, 1024, 1048, oldused)
if err == nil {
t.Errorf("dup insert of tx succeeded")
return
}
} }
func loadBlocks(t *testing.T, file string) (blocks []*btcutil.Block, err error) { func loadBlocks(t *testing.T, file string) (blocks []*btcutil.Block, err error) {