Skip to content

Commit

Permalink
use Set to count distinct mined blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed May 11, 2021
1 parent a716d78 commit 72a1d09
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/token/ERC20/extensions/draft-ERC20Votes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ async function batchInBlock (txs) {
await send('evm_mine');
const receipts = await Promise.all(promises);

expect(receipts.map(({ receipt }) => receipt.blockNumber).every((val, _, arr) => val === arr[0]));
const minedBlocks = new Set(receipts.map(({ receipt }) => receipt.blockNumber));
expect(minedBlocks.size).to.equal(1);

return receipts;
} finally {
Expand Down

0 comments on commit 72a1d09

Please sign in to comment.