diff --git a/src/tests/e2e/loom-provider-subscribe.ts b/src/tests/e2e/loom-provider-subscribe.ts index 7ca3f749..6a1894bc 100644 --- a/src/tests/e2e/loom-provider-subscribe.ts +++ b/src/tests/e2e/loom-provider-subscribe.ts @@ -194,6 +194,26 @@ test.only('LoomProvider + BlockByNumber transaction issue', async t => { // Just call a contract to call an event on loomchain const tx = await contract.methods.set(1).send({ from }) + // Subscribe for new heads using eth_subscribe + const ethGetBlockByNumberResult = await execAndWaitForMillisecondsAsync( + loomProvider.sendAsync({ + id: 1000, + method: 'eth_getBlockByNumber', + params: [`0x${tx.blockNumber.toString(16)}`] + }) + ) + + t.equal( + ethGetBlockByNumberResult.result.number, + `0x${tx.blockNumber.toString(16)}`, + 'Should block returned by the number match' + ) + + t.assert( + ethGetBlockByNumberResult.result.transactions.length > 0, + 'Should exists transactions on block' + ) + // Subscribe for new heads using eth_subscribe const ehtGetBlockByHashResult = await execAndWaitForMillisecondsAsync( loomProvider.sendAsync({ @@ -203,7 +223,11 @@ test.only('LoomProvider + BlockByNumber transaction issue', async t => { }) ) - console.log('length', ehtGetBlockByHashResult.result.transactions.length) + t.equal( + ehtGetBlockByHashResult.result.hash, + tx.blockHash, + 'Should block returned by the hash match' + ) t.assert( ehtGetBlockByHashResult.result.transactions.length > 0,