les: fixed tx status test and rlp encoding

This commit is contained in:
Zsolt Felfoldi 2017-10-24 20:06:21 +02:00
parent 6cef375d22
commit 192d23327c
2 changed files with 11 additions and 1 deletions

View file

@ -104,7 +104,7 @@ var (
)
// TxStatus is the current status of a transaction as seen py the pool.
type TxStatus int
type TxStatus uint
const (
TxStatusUnknown TxStatus = iota

View file

@ -464,6 +464,16 @@ func TestTransactionStatusLes2(t *testing.T) {
if _, err := chain.InsertChain(gchain); err != nil {
panic(err)
}
// wait until TxPool processes the inserted block
for i := 0; i < 10; i++ {
if pending, _ := txpool.Stats(); pending == 1 {
break
}
time.Sleep(100 * time.Millisecond)
}
if pending, _ := txpool.Stats(); pending != 1 {
t.Fatalf("pending count mismatch: have %d, want 1", pending)
}
// check if their status is included now
block1hash := core.GetCanonicalHash(db, 1)