From b4a52513915d5a39ac055fc38cafed70098eb698 Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Thu, 25 Aug 2016 19:04:40 +0300 Subject: core: abstract out a sorted transaction hash map --- core/tx_list_test.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'core/tx_list_test.go') diff --git a/core/tx_list_test.go b/core/tx_list_test.go index ea83ca479..92b211937 100644 --- a/core/tx_list_test.go +++ b/core/tx_list_test.go @@ -41,18 +41,12 @@ func TestStrictTxListAdd(t *testing.T) { list.Add(txs[v]) } // Verify internal state - if list.first != 0 { - t.Errorf("lowest nonce mismatch: have %d, want %d", list.first, 0) - } - if int(list.last) != len(txs)-1 { - t.Errorf("highest nonce mismatch: have %d, want %d", list.last, len(txs)-1) - } - if len(list.items) != len(txs) { - t.Errorf("transaction count mismatch: have %d, want %d", len(list.items), len(txs)) + if len(list.txs.items) != len(txs) { + t.Errorf("transaction count mismatch: have %d, want %d", len(list.txs.items), len(txs)) } for i, tx := range txs { - if list.items[tx.Nonce()] != tx { - t.Errorf("item %d: transaction mismatch: have %v, want %v", i, list.items[tx.Nonce()], tx) + if list.txs.items[tx.Nonce()] != tx { + t.Errorf("item %d: transaction mismatch: have %v, want %v", i, list.txs.items[tx.Nonce()], tx) } } } -- cgit