Fixes #103 and adds/refactors tests so this doesn't happen again. Implements the suggestions by @laskdaf.
PriorityQueue.getMin() when the set is empty now throws. I think this is the most sensible behavior because we can't return a null value to represent that the set is empty. As a result, we no longer need to check that exitsQueue.currentSize() > 0 in the while loop condition, but do need to do so before reassigning (utxoPos, created_at) or risk throwing within the loop.
Fixes #103 and adds/refactors tests so this doesn't happen again. Implements the suggestions by @laskdaf.
PriorityQueue.getMin()
when the set is empty now throws. I think this is the most sensible behavior because we can't return a null value to represent that the set is empty. As a result, we no longer need to check thatexitsQueue.currentSize() > 0
in the while loop condition, but do need to do so before reassigning(utxoPos, created_at)
or risk throwing within the loop.Tests pass.