From eb56da4a9420dc3ab324c67b82feb48df75cc671 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Sat, 29 Jun 2019 09:48:24 -0600 Subject: [PATCH] fix: fix transaction live test for credit-only accounts (#385) --- web3.js/test/connection.test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web3.js/test/connection.test.js b/web3.js/test/connection.test.js index 7fe5f2472..b4abea830 100644 --- a/web3.js/test/connection.test.js +++ b/web3.js/test/connection.test.js @@ -480,6 +480,11 @@ test('transaction', async () => { result: 31, }, ]); + if (!mockRpcEnabled) { + // Credit-only account credits are committed at the end of every slot; + // this sleep is to ensure a full slot has elapsed + await sleep((1000 * DEFAULT_TICKS_PER_SLOT) / NUM_TICKS_PER_SECOND); + } expect(await connection.getBalance(accountTo.publicKey)).toBe(31); });