Skip to content

Commit

Permalink
refactor: update Rpc test
Browse files Browse the repository at this point in the history
  • Loading branch information
milapsheth committed Nov 3, 2023
1 parent 948b11e commit 03065f4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/RpcEvmCompatibility.js → test/RpcCompatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const { isHardhat, getRandomInt, waitFor, getGasOptions } = require('./utils');

const TestRpcCompatibility = require('../artifacts/contracts/test/TestRpcCompatibility.sol/TestRpcCompatibility.json');

describe('EVM RPC Compatibility Test', () => {
describe('RpcCompatibility', () => {
const maxTransferAmount = 100;

let provider;
Expand Down Expand Up @@ -322,17 +322,16 @@ describe('EVM RPC Compatibility Test', () => {

it('should support RPC method eth_subscribe', async function () {
// This uses eth_subscribe
// Setting up manually via wss rpc is tricky
const newValue = 1000;
let isSubscribe = false;
let found = false;
rpcCompatibilityContract.on('ValueUpdatedForSubscribe', (value) => {
expect(value.toNumber()).to.equal(newValue);
isSubscribe = true;
found = true;
});

await rpcCompatibilityContract.updateValueForSubscribe(newValue).then((tx) => tx.wait());
await waitFor(5, () => {
expect(isSubscribe).to.equal(true);
expect(found).to.be.true;
});
});

Expand Down

0 comments on commit 03065f4

Please sign in to comment.