From 690f43d8464cf1efdaec00b4e2a4e39a33aff03d Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 11 May 2021 22:50:17 -0300 Subject: [PATCH] use built in provider.send function --- test/token/ERC20/extensions/draft-ERC20Votes.test.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/token/ERC20/extensions/draft-ERC20Votes.test.js b/test/token/ERC20/extensions/draft-ERC20Votes.test.js index 980042d1d79..5bc83acd6d9 100644 --- a/test/token/ERC20/extensions/draft-ERC20Votes.test.js +++ b/test/token/ERC20/extensions/draft-ERC20Votes.test.js @@ -19,17 +19,13 @@ const Delegation = [ { name: 'expiry', type: 'uint256' }, ]; -function send (method, params = []) { - return new Promise(resolve => web3.currentProvider.send({ jsonrpc: '2.0', method, params }, resolve)); -} - async function batchInBlock (txs) { - await send('evm_setAutomine', [false]); + await network.provider.send('evm_setAutomine', [false]); try { const promises = txs.map(fn => fn()); await Promise.all(promises.map(p => events.once(p, 'transactionHash'))); - await send('evm_mine'); + await network.provider.send('evm_mine'); const receipts = await Promise.all(promises); const minedBlocks = new Set(receipts.map(({ receipt }) => receipt.blockNumber)); @@ -37,7 +33,7 @@ async function batchInBlock (txs) { return receipts; } finally { - await send('evm_setAutomine', [true]); + await network.provider.send('evm_setAutomine', [true]); } }