From daafd991d5a7de7cb9325f120c9f70a73b8d1d37 Mon Sep 17 00:00:00 2001 From: andri lim Date: Mon, 18 Feb 2019 16:48:26 +0700 Subject: [PATCH] address cheatfate comments --- eth/trie/db.nim | 2 +- tests/trie/testutils.nim | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eth/trie/db.nim b/eth/trie/db.nim index f089e6f..cc6c513 100644 --- a/eth/trie/db.nim +++ b/eth/trie/db.nim @@ -160,7 +160,7 @@ proc dispose*(t: DbTransaction) {.inline.} = t.rollback() proc safeDispose*(t: DbTransaction) {.inline.} = - if t != nil and t.state == Pending: + if (not isNil(t)) and (t.state == Pending): t.rollback() proc putImpl[T](db: RootRef, key, val: openarray[byte]) = diff --git a/tests/trie/testutils.nim b/tests/trie/testutils.nim index 51c8ebe..431f23d 100644 --- a/tests/trie/testutils.nim +++ b/tests/trie/testutils.nim @@ -1,6 +1,7 @@ import random, sets, eth/trie/trie_utils as ethUtils, - eth/rlp/types as rlpTypes, ranges/bitranges, nimcrypto/utils + eth/rlp/types as rlpTypes, ranges/bitranges, + nimcrypto/[utils, sysrand] type RandGen*[T] = object @@ -29,8 +30,7 @@ proc randString*(len: int): string = proc randBytes*(len: int): Bytes = result = newSeq[byte](len) - for i in 0..