diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-08-26 00:04:40 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-09-02 19:15:40 +0800 |
commit | b4a52513915d5a39ac055fc38cafed70098eb698 (patch) | |
tree | 1217ca54edf4fc72734dc00bf09d4a827106bd82 /core/tx_list_test.go | |
parent | a183ea29f9313cb1d00ed8f73bfbc4ae51e9cb04 (diff) | |
download | go-tangerine-b4a52513915d5a39ac055fc38cafed70098eb698.tar.gz go-tangerine-b4a52513915d5a39ac055fc38cafed70098eb698.tar.zst go-tangerine-b4a52513915d5a39ac055fc38cafed70098eb698.zip |
core: abstract out a sorted transaction hash map
Diffstat (limited to 'core/tx_list_test.go')
-rw-r--r-- | core/tx_list_test.go | 14 |
1 files changed, 4 insertions, 10 deletions
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) } } } |