aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-08-19 06:40:56 +0800
committerDan Finlay <dan@danfinlay.com>2016-08-19 06:40:56 +0800
commit7389f9d0a0e1f798607ea8eea25583f8af854358 (patch)
tree45dba4e6ef5cf1a84a92a08a558fecd32465170a /test
parent90d6bec3ed51ba4b2d4696132642a4d97712dec9 (diff)
downloadtangerine-wallet-browser-7389f9d0a0e1f798607ea8eea25583f8af854358.tar
tangerine-wallet-browser-7389f9d0a0e1f798607ea8eea25583f8af854358.tar.gz
tangerine-wallet-browser-7389f9d0a0e1f798607ea8eea25583f8af854358.tar.bz2
tangerine-wallet-browser-7389f9d0a0e1f798607ea8eea25583f8af854358.tar.lz
tangerine-wallet-browser-7389f9d0a0e1f798607ea8eea25583f8af854358.tar.xz
tangerine-wallet-browser-7389f9d0a0e1f798607ea8eea25583f8af854358.tar.zst
tangerine-wallet-browser-7389f9d0a0e1f798607ea8eea25583f8af854358.zip
Enforce tx history limit
Diffstat (limited to 'test')
-rw-r--r--test/unit/config-manager-test.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/config-manager-test.js b/test/unit/config-manager-test.js
index b34089163..eaa5376fd 100644
--- a/test/unit/config-manager-test.js
+++ b/test/unit/config-manager-test.js
@@ -233,6 +233,17 @@ describe('config-manager', function() {
assert.equal(result.length, 1)
assert.equal(result[0].id, 1)
})
+
+ it('cuts off early txs beyond a limit', function() {
+ const limit = configManager.txLimit
+ for (let i = 0; i < limit + 1; i++) {
+ let tx = { id: i }
+ configManager.addTx(tx)
+ }
+ var result = configManager.getTxList()
+ assert.equal(result.length, limit, `limit of ${limit} txs enforced`)
+ assert.equal(result[0].id, 1, 'early txs truncted')
+ })
})
describe('#confirmTx', function() {